Ansicht
Dokumentation

Unexpected behavior from ON CHANGE OF <br />Tip-No.: 811 ( INFO811 )

Unexpected behavior from ON CHANGE OF
Tip-No.: 811 ( INFO811 )

TXBHW - Original Tax Base Amount in Local Currency   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Short text

Unexpected behavior from ON CHANGE OF
Tip-No.: 811

Symptom

Language element "ON CHANGE OF" does not trigger a group change, even
though it should.

Cause

"ON CHANGE OF field. ... ENDON."
is represented internally as:
"IF field &lt;&gt; save_field.
save_field = field.
...
ENDIF."
(where every ON-CHANGE-OF statement possess its own, global
save_field).

Consequently, ON CHANGE OF behaves unexpectedly in following situations:

1 A loop, containing an ON CHANGE OF, is run thru several times. At the
ith iteration (i>=2), a group change is not recognised if the field,
that is to be checked for group change, has the same value at the
start of the ith iteration as save_field at the end of the i-1th
iteration.

2 During the first execution of the ON-CHANGE-OF statement, no group
change is recognised, if the field to checked for group change has
an initial value.

Solution

Program the group change yourself.






PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 1190 Date: 20240329 Time: 133852     sap01-206 ( 16 ms )