Replace and Extend Steps
Due to the very modular structure of commands, it is possible to replace individual parts of the standard logic in a very targeted manner.
To replace a single step completely or to extend it by an own, additional logic the BAdI /PCH/CFW_CTRL_COMMAND of the extension spot /PCH/CFW_APPLICATION must be implemented. The BAdI has a filter which can be used to define in which applications the extension should be activated.
Basically two methods are available which are called once for each step:
BEFORE_DO_COMMAND_STEP
AFTER_DO_COMMAND_STEP
Both methods are passed the command and the step as main information. The method BEFORE_DO_COMMAND_STEP is called before the execution of the standard function and contains the parameter CV_SUPPRESS_STEP, with which the execution of the standard step can be suppressed. A transport of command-specific data (command parameters) is not provided in the interface, since these are dependent on the actual command. Reading and writing of parameters is only possible directly via the command controller. Access is made via the central framework instance (IO_FRW), which is also included in the interface:
io_frw->mo_ctrl_command->parameter_[set,...get,exists,delete]
Additional steps
By implementing the BAdI method AFTER_READ_COMMAND the steps of a command can be changed. It is strongly discouraged to remove or modify default steps. However, it is possible to add additional steps. To do this, however, a single step must be fully specified and added to the table of steps (parameter CT_COMMAND_STEPS) (see chapter Defining Commands of the API documentation). Afterwards the step can be handled as described above.
Own data
The data of a command are thus so-called command parameters managed by the command controller. There is no possibility to extend these parameters. Instead, own data must be managed by the command controller itself. The methods BEFORE_DO_COMMAND and AFTER_DO_COMMAND are particularly suitable for this. The latter method is called when the command has been completed or aborted prematurely.
© ProNovia AG | Imprint | Data Protection