SAP EVALUATION - Guide
Get Example source ABAP code based on a different SAP table
GUIDELINE 6.25
Evaluation
ABAP_BACKGROUND
System fields describe general system states or are set specifically by individual statements. The content of system fields is only defined as described in the documentation of the system fields or in the documentation of ABAP statements that set system fields. In contexts other than those described there, the content of system fields is not defined. Particularly statements for which no effect on system fields is documented can affect the content of specific system fields, such as the
ABAP_RULE
Evaluate system fields only in contexts for which they are defined. If an ABAP statement sets a system field in accordance with its documentation, the field should be evaluated directly after the statement. You must not evaluate system fields after statements, ho wever, for which no effect is documented.
ABAP_DETAILS
If possible, a system field should be evaluated directly after the statement that set it, to prevent it from being overwritten by other statements. The bigger the gap between the ABAP statement in question and the evaluation of a system field, the higher the risk that this system field will be influenced by a different statement in the meantime.
If necessary, the values of system fields should be saved in auxiliary variables. This applies in particular to the general
You should never evaluate statement-related system fields after statements that do not set these fields according to their documenta tion. As before, a common example is the evaluation of
Latest notes:
The static methods of the class
Bad example
The following source code shows an example where
...
... 'other statements
...
IF sy-subrc = 0.
...
ENDIF.
Good example
The following source code corrects the above example by assigning
find_subrc = sy-subrc.
...
... 'other statements
...
IF find_subrc = 0.
...
ENDIF.