Get Example source ABAP code based on a different SAP table
ABAP_ITABEXP > - Side Effects This example demonstrates a possible side effect when field symbols are produced as the result.
ABAP_SOURCE_CODE DEMO CL_DEMO_TAB_EXP_SIDE_EFFECT
ABAP_DESCRIPTION A table expression is used to pass a line of an internal table and the internal table itself to a method. The passed line of the internal table is modified in the method by specifying a table expression on the left side of an assignment.
In the first method call, the table expression is passed by reference without the VALUE> operator. The result is a temporary field symbol to which the read line is assigned throughout the entire method call. The change made to the line in the table also affects the formal parameter.
In the second method call, the table expression is passed by reference with the VALUE> operator. The result is a temporary work area that exists throughout the entire method call. The change made to the line in the table does not affect the formal parameter.
The third and fourth method calls repeat the previous calls, but use pass by value instead of pass by reference. Pass by value does not produce any side effects, regardless of the result. The critical point demonstrated here also produces a syntax check warning in the extended program check for performance reasons, if not hidden using the pragma ##operator>.