Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

URGENT

harri_kishan
Participant
0 Likes
1,236

HI,

a sub-header is printed out for every change in MRP Type (DISMM). I WANT TO have the code inserted after the sub-header for every change in the MRP Controller (DISPO).SO HOW TO USE THE AT EVENT IN THE LOOP.

1 ACCEPTED SOLUTION
Read only

harri_kishan
Participant
0 Likes
1,214

THE CODE IS THIS CAN U CORRECT IT SO THAT IT CHECKS FOR THE CONDITIONS OF PLANT, DISMM, DISPO. SO IF ANY OF THE FIELD CHANGES A SUB-HEADER SHUD BE GENERATED UNDER THE PLANT .

LOOP AT TA_MAT.

ON CHANGE OF TA_MAT-WERKS.

NEW-PAGE.

ON CHANGE OF TA_MAT-DISPO.

FORMAT COLOR 7.

NEW-LINE NO-SCROLLING.

WRITE : / 'Plant: ', TA_MAT-WERKS,

20 'MRP Ctlr: ', TA_MAT-DISPO,

40 'MRP Type: ', TA_MAT-DISMM, 224 ' '.

FORMAT RESET.

ENDON.

ENDON.

WRITE : /1 TA_MAT-MATNR COLOR 1,

TA_MAT-MAKTX COLOR 1,

61(4) TA_MAT-DISMM COLOR 1,

TA_MAT-MEINS COLOR 1,

TA_MAT-EISBE COLOR 1,

TA_MAT-MINBE COLOR 1,

WRITE : 106(4) TA_MAT-DISLS COLOR 1,

111 TA_MAT-PLIFZ COLOR 1,

TA_MAT-MTH1 COLOR 1,

TA_MAT-MTH2 COLOR 1,

TA_MAT-MTH3 COLOR 1,

TA_MAT-MTH4 COLOR 1,

TA_MAT-MTH5 COLOR 1,

TA_MAT-MTH6 COLOR 1.

loop at ta_tmp4 where matnr = ta_mat-matnr and

werks = ta_mat-werks.

if ta_tmp4-LMINB <> 0 or ta_tmp4-LBSTF <> 0.

write: /61 ta_tmp4-lgort color 1 intensified on,

65 ta_tmp4-lminb color 1 intensified on,

83 ta_tmp4-lbstf color 1 intensified on.

endif.

endloop.

ENDLOOP.

HI,

a sub-header is printed out for every change in MRP Type (DISMM). I WANT TO have the code inserted after the sub-header for every change in the MRP Controller (DISPO).SO HOW TO USE THE AT EVENT IN THE LOOP.

7 REPLIES 7
Read only

Former Member
0 Likes
1,214

i am not enough clear about your requirement but it seems to me you want to use control break statement...

try like this

loop at itab.

at new dispo.

write : / 'New item'.

endat.

<if it is a first field in your itab>

<else use on change of itab-dispo and endon>

endloop.

regards

shiba dutta

Read only

0 Likes
1,214

if we have to check more than one field in the condition so then how do we use ( on change ) like i have to check two fields simulataneously for outputing data.

Read only

Former Member
0 Likes
1,214

Hi..

Loop at itab.

<b>on change of DISPO.</b> <write ur code>.

endon.

endloop.

***********************

ON CHANGE

Introduces a new branch.

<b>Syntax</b>

<b>ON CHANGE OF <f> [OR <f1> OR <f2>...].</b>Opens an ON control structure, which ends with ENDON. The statement block is executed whenever the contents of the field <f> or one of the other fields <fi> has changed since the statement was last executed.

Read only

Former Member
0 Likes
1,214

Hai,

loop at itab.

<b>ON CHANGE OF ITAB-DISPO.</b>

/* Insert your new code here.

<b>ENDON.</b>

endloop.

Hope your problem could be solved.

<b>Reward points if it helps you.</b>

Regds,

Rama.Pammi

Read only

harri_kishan
Participant
0 Likes
1,215

THE CODE IS THIS CAN U CORRECT IT SO THAT IT CHECKS FOR THE CONDITIONS OF PLANT, DISMM, DISPO. SO IF ANY OF THE FIELD CHANGES A SUB-HEADER SHUD BE GENERATED UNDER THE PLANT .

LOOP AT TA_MAT.

ON CHANGE OF TA_MAT-WERKS.

NEW-PAGE.

ON CHANGE OF TA_MAT-DISPO.

FORMAT COLOR 7.

NEW-LINE NO-SCROLLING.

WRITE : / 'Plant: ', TA_MAT-WERKS,

20 'MRP Ctlr: ', TA_MAT-DISPO,

40 'MRP Type: ', TA_MAT-DISMM, 224 ' '.

FORMAT RESET.

ENDON.

ENDON.

WRITE : /1 TA_MAT-MATNR COLOR 1,

TA_MAT-MAKTX COLOR 1,

61(4) TA_MAT-DISMM COLOR 1,

TA_MAT-MEINS COLOR 1,

TA_MAT-EISBE COLOR 1,

TA_MAT-MINBE COLOR 1,

WRITE : 106(4) TA_MAT-DISLS COLOR 1,

111 TA_MAT-PLIFZ COLOR 1,

TA_MAT-MTH1 COLOR 1,

TA_MAT-MTH2 COLOR 1,

TA_MAT-MTH3 COLOR 1,

TA_MAT-MTH4 COLOR 1,

TA_MAT-MTH5 COLOR 1,

TA_MAT-MTH6 COLOR 1.

loop at ta_tmp4 where matnr = ta_mat-matnr and

werks = ta_mat-werks.

if ta_tmp4-LMINB <> 0 or ta_tmp4-LBSTF <> 0.

write: /61 ta_tmp4-lgort color 1 intensified on,

65 ta_tmp4-lminb color 1 intensified on,

83 ta_tmp4-lbstf color 1 intensified on.

endif.

endloop.

ENDLOOP.

Read only

0 Likes
1,214

if your int table fields are in PLANT, DISMM, DISPO oreder then you have to write at new dispo.. it will trigger if PLANT, DISMM, DISPO any one will change from its previous row...

data : wamat like ta_mat.

LOOP AT TA_MAT.

move-corresponding ta_mat to wamat

at new DISPO.

NEW-PAGE.

FORMAT COLOR 7.

NEW-LINE NO-SCROLLING.

WRITE : / 'Plant: ', wamat-WERKS,

20 'MRP Ctlr: ', wamat-DISPO,

40 'MRP Type: ', wamat-DISMM, 224 ' '.

FORMAT RESET.

endat.

WRITE : /1 TA_MAT-MATNR COLOR 1,

TA_MAT-MAKTX COLOR 1,

61(4) TA_MAT-DISMM COLOR 1,

TA_MAT-MEINS COLOR 1,

TA_MAT-EISBE COLOR 1,

TA_MAT-MINBE COLOR 1,

WRITE : 106(4) TA_MAT-DISLS COLOR 1,

111 TA_MAT-PLIFZ COLOR 1,

TA_MAT-MTH1 COLOR 1,

TA_MAT-MTH2 COLOR 1,

TA_MAT-MTH3 COLOR 1,

TA_MAT-MTH4 COLOR 1,

TA_MAT-MTH5 COLOR 1,

TA_MAT-MTH6 COLOR 1.

loop at ta_tmp4 where matnr = ta_mat-matnr and

werks = ta_mat-werks.

if ta_tmp4-LMINB <> 0 or ta_tmp4-LBSTF <> 0.

write: /61 ta_tmp4-lgort color 1 intensified on,

65 ta_tmp4-lminb color 1 intensified on,

83 ta_tmp4-lbstf color 1 intensified on.

endif.

endloop.

ENDLOOP.

regards

shiba dutta

Read only

harri_kishan
Participant
0 Likes
1,214

thanks a lot ur answers solved them thank you