2. ON CHANGE OF USE IN SAP
ABAP.
REPORT zctrlbrk_on_change NO STANDARD PAGE HEADING.
TYPES: BEGIN OF ty_tab,
werks TYPE mard-werks,
matnr TYPE mard-matnr,
lgort TYPE mard-lgort,
END OF ty_tab.
DATA: wtab TYPE ty_tab,
itab TYPE TABLE OF ty_tab.
START-OF-SELECTION.
SELECT matnr werks lgort
UP TO 25 ROWS FROM mard
INTO CORRESPONDING FIELDS OF TABLE itab.
IF sy-subrc = 0.
SORT itab BY werks.
WRITE: / 'Material', 20 'Plant', 27 'Storage Location'.
ULINE.
LOOP AT itab INTO wtab.
WRITE: / wtab-matnr, 20 wtab-werks, 27 wtab-lgort.
ON CHANGE OF wtab-werks.
WRITE: '=== On Change Of triggers at plant - ', wtab-werks.
ENDON.
ENDLOOP.
ENDIF.
TYPES: BEGIN OF ty_tab,
werks TYPE mard-werks,
matnr TYPE mard-matnr,
lgort TYPE mard-lgort,
END OF ty_tab.
DATA: wtab TYPE ty_tab,
itab TYPE TABLE OF ty_tab.
START-OF-SELECTION.
SELECT matnr werks lgort
UP TO 25 ROWS FROM mard
INTO CORRESPONDING FIELDS OF TABLE itab.
IF sy-subrc = 0.
SORT itab BY werks.
WRITE: / 'Material', 20 'Plant', 27 'Storage Location'.
ULINE.
LOOP AT itab INTO wtab.
WRITE: / wtab-matnr, 20 wtab-werks, 27 wtab-lgort.
ON CHANGE OF wtab-werks.
WRITE: '=== On Change Of triggers at plant - ', wtab-werks.
ENDON.
ENDLOOP.
ENDIF.
No comments:
Post a Comment