Syntax for ON

Basic form

ON CHANGE OF f.

Addition

... OR f1

Effect

Executes the processing block enclosed by the " ON CHANGE OF f " and " ENDON " statements whenever the contents of the field f change (control break processing). We use the statement to manipulate database fields during GET events or SELECT / ENDSELECT processing.

Example

TABLES T100.

SELECT * FROM T100 WHERE SPRSL = SY-LANGU

AND

MSGNR < '010'

ORDER BY PRIMARY KEY.

ON CHANGE OF T100-ARBGB.

ULINE.

WRITE: / '***', T100-ARBGB, '***'.

ENDON.

WRITE: / T100-MSGNR, T100-TEXT.

ENDSELECT.

Displays all messages with their numbers in the logon language, provided the number is less than '010'.Each time the message class changes, it is output.

Addition

... OR f1

Effect

Also executes the code whenever the contents of the field f1 changes.

Example

* Logical database F1S

TABLES: SPFLI, SFLIGHT, SBOOK.

GET SBOOK.

ON CHANGE OF SPFLI-CARRID OR

SPFLI-CONNID OR

SFLIGHT-FLDATE.

ULINE.

WRITE: /5 SPFLI-CARRID, SPFLI-CONNID,

5 SFLIGHT-FLDATE, SPFLI-FLTIME,

5 SFLIGHT-SEATSMAX, SFLIGHT-SEATSOCC.

ENDON.

ABAP TOPIC WISE COMPLETE COURSE

BDC OOPS ABAP ALE IDOC'S BADI BAPI Syntax Check
Interview Questions ALV Reports with sample code ABAP complete course
ABAP Dictionary SAP Scripts Script Controls Smart Forms
Work Flow Work Flow MM Work Flow SD Communication Interface

No comments:

Post a Comment