SAP MODIFY ITAB RESULT ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• ELSE UNASSIGN MODIFY itab
• CASTING MODIFY itab
• ASSIGNING MODIFY itab
• REFERENCE INTO MODIFY itab

MODIFY itab, result
Short Reference

ABAP_SYNTAX
ABAP_KEY ... ${ ASSIGNING <(><)> $[CASTING$] $[ELSE UNASSIGN$] $}
$| ${ REFERENCE INTO dref $}.

What does it do?
These additions are possible only when modifying single lines. If modified successfully, the addition ASSIGNING is used to assign the line to a field symbol and the addition REFERENCE INTO is used to set a reference to the modified line in a reference variable.
The syntax and meaning are the same as when specifying the output behavior in the statement READ TABLE and the same restrictions apply regarding the modification of key fields for primary and secondary table keys. In particular, inline declarations using the declaration operators DATA, FINAL and FIELD-SYMBOL are possible. The addition ELSE UNASSIGN sets the state of the field symbol behind ASSIGNING to unassigned if the modification was not successful and sy-subrc is set to 4. Otherwise, the field symbol keeps its previous state.

ABAP_EXAMPLE_VX5
Conversion of smoking seats to non-smoking seats in an internal table of flight bookings. After the loop, each line in the reference table reftab references a line in itab in which a change took place.
ABEXA 00431
ABAP_EXAMPLE_END

...More SAP MODIFY Examples

Return to menu