If you previously worked with the ABAP form routines of the update rules and transfer rules, you should first familiarize yourself with the differences to working with routines in the transformation.
You are in the transformation editing screen.
To create a start routine, choose Start Routine
To create an end routine, choose End Routine
To create a characteristic routine, double-click the characteristic in the transformation group to open the maintenance screen for the rule details. Select the rule type Routine.
If you are creating a characteristic routine, the routine editor appears immediately. If you are creating a start routine or an end routine, you can first select fields that are to be updated. However, some fields are required for further processing, meaning that they must be updated. For details, see the F1 help.
You are in the routine editor. To create a routine, enter the following:
Between *$*$ begin of global ... and *$*$ end of global ..., you can define global data declarations 'CLASS DATA'. These are available in all routines. Data declarations with 'DATA' can only be accessed in the current package.
This means that you can use intermediate results in other routines, for example, or reuse results when you call a routine again at a later time.
When you perform serial loads, one process instance is used for the entire request. In this case, data with the 'CLASS DATA' data declaration can be accessed for the entire request (all packages).
Several process instances are used when you perform parallel loads.
A single process instance can be used a number of times. This depends on the number of data packages that are to be processed and the number of process instances that are available. This means that with parallel loads too, data with the 'CLASS DATA' data declaration is not initialized for each data package and may still contain data from predecessor packages.
Therefore use 'CLASS DATA' or 'DATA' for the global data, depending on the scenario.
In the routine editor, a maximum of 72 characters per line are currently permitted. Any additional characters are cut off when you save.
Insert your program code for the routine between *$*$ begin of routine ... and *$*$ end of routine .... For information about the parameters of the routine, see
Do not use a SAP COMMIT (ABAP statement: COMMIT WORK) in your coding. When this statement is executed, the cursor that is used from the source for reading is lost. Use a DB COMMIT (call function module DB_COMMIT) instead, or avoid using such COMMITs altogether.
Check the syntax of your routine.
Save the routine. You end the editing of the routine by leaving the editor.