Durch den sehr modularen Aufbau von Befehlen ist es möglich sehr gezielt einzelne Teile der Standardlogik zu ersetzen.
Um einen einzelnen Schritt vollständig zu ersetzen oder um eine eigene, zusätzlich Logik zu erweitern muss das 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 des Erweiterungsspot of the extension spot /PCH/CFW_APPLICATION implementiert werden. Das BAdI verfügt über einen Filter, mit dem definiert werden kann, in welchen Anwendungen die Erweiterung aktiviert werden soll.
Es stehen grundsätzlich zwei Methoden zu Verfügung, die pro Schritt je einmal aufgerufen werdenmust 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
Beiden Methoden wird als Hauptinformation der Befehl und der Schritt übergeben. Die Methode
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 können die Schritte eines Befehls verändert werden. Es wird dringend davon abgeraten, Standardschritte zu entfernen oder zu verändern. Es ist jedoch möglich weitere Schritte hinzuzufügen. Hierzu muss ein einzelner Schritt jedoch vollständig spezifiziert werden und zur Tabelle der Schritte (Parameter 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) hinzugefügt werden (Siehe Kapitel Befehle definieren der API Dokumentation). Anschliessend kann der Schritt wie oben beschrieben behandelt werden.
Eigene Daten
Die Daten eines Befehls werden also sog. Befehlsparameter durch den Command Controller verwaltet. Es besteht keine Möglichkeit diese Parameter zu erweitern. Stattdessen sind eigene Daten selber zu verwalten. Hierzu bieten sich besonders die Methoden (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 und and AFTER_DO_COMMAND an. Letztere Methode wird aufgerufen, wenn der Befehl beendet ist oder frühzeitig abgebrochen wurdeare particularly suitable for this. The latter method is called when the command has been completed or aborted prematurely.