
The sequence for execution of BAdI implementations can be controlled for BAdIs used on a multiple basis by a sort mechanism.
In the BAdI Builder (SE18), choose Utilities → Sort. The following dialog box appears.
Choose Standard Sort if sort is to take place using numeric sort values. The numeric values are entered in the displayed field Layer Value when you create the implementations and stored in a table. The implementations are executed in accordance with the specified sequence.
Choose Special Sort if sorting is to take place using non-numeric sort values. In this case, you need to enter the name of the implementation that will be created in the following step.
Proceed as follows if you require special sorting:
In addition to methods for data transmission of the sort value and for changing the BAdI implementation, the interface also contains a sort method that sorts a table of values in any specified order.
A standard table is passed to this method as a changing parameter. The table contains values only; it does not contain any implementation names. This table contains, for example, inputs for the Sort Value field when you create implementations. The user can maintain any fields as required and sort them according to any specified criteria at runtime.
The implementations are executed (for example, in numeric sequence).
Switching Off Sort Function
To switch off the sort for the execution of BAdI implementations, choose Utilities → Sort and finally No Sort. The implementations will now run in an arbitrary sequence in this case. The edit field that was displayed using a subscreen during the execution of a BAdI implementation now disappears.
Sorting of BAdI implementations can be switched on again at any time. This does not count as a modification to the standard version. The BAdI definition is not changed. Switching off or making a change, on the other hand, counts as a modification.