2008 Aug 11 8:22 AM
hi all,
I want to display a list output like this.
for a machine code M1 there can be 3 or more items and 3 or more Reasons. How to display all with items and reasons repeating & machine code not repeating.
tell me for classical or alv.
if i am using on change of , all data is not starting in same line.
2008 Aug 11 8:31 AM
Hi,
Try like this
loop at itab.
at new machine.
move : itab-machine to final_tab-machine.
endat.
move : itab-item to final_tab-item,
itab-reason to final_tab-reason.
append final_tab.
endloop.
if ur using ALV then in the output u can sort on machine directly..No need for above coding.
Regards,
Nagaraj
hi all,
I want to display a list output like this.
for a machine code M1 there can be 3 or more items and 3 or more Reasons. How to display all with items and reasons repeating & machine code not repeating.
tell me for classical or alv.
if i am using on change of , all data is not starting in same line.
2008 Aug 11 8:31 AM
Hi,
Try like this
loop at itab.
at new machine.
move : itab-machine to final_tab-machine.
endat.
move : itab-item to final_tab-item,
itab-reason to final_tab-reason.
append final_tab.
endloop.
if ur using ALV then in the output u can sort on machine directly..No need for above coding.
Regards,
Nagaraj
2008 Aug 11 8:33 AM
try using the control break statements at new , at end of
LOOP AT ITAB INTO WA
AT NEW M1
WRITE / WA-ITEM1.
ENDAT.
WRITE : / WA-ITEM2, WA-ITEM3.
AT END OF M1.
WRITE /.
ENDAT.
ENDLOOP.
2008 Aug 11 9:16 AM
If I am using above code it is leaving a blank line next to every machine code & displaying the item data.
I want the machine code & item data starting in same line.
2008 Aug 11 10:32 AM
this is my code :
LOOP AT i_final1.
ON CHANGE OF i_final-workcenter.
WRITE : /4 i_final1-zzopt_token LEFT-JUSTIFIED, 11 sy-vline,
12 i_final1-zzopt_token1 LEFT-JUSTIFIED, 19 sy-vline,
20 i_final1-ktext LEFT-JUSTIFIED, 29 sy-vline.
LOOP AT i_breakdown WHERE kapid = i_final1-workcenter.
WRITE : /144 i_breakdown-zrcod LEFT-JUSTIFIED, 148 sy-vline,
149 i_breakdown-zdure RIGHT-JUSTIFIED, 155 sy-vline,
156 i_breakdown-zrdes.
ENDLOOP.
ENDON.
WRITE : /30 i_final1-maktx NO-GAP LEFT-JUSTIFIED, 71 sy-vline,
72 i_final1-ferth , 83 sy-vline,
84 i_final1-pcode LEFT-JUSTIFIED, 93 sy-vline,
94 i_final1-blow RIGHT-JUSTIFIED, 98 sy-vline,
99 i_final1-lmnga RIGHT-JUSTIFIED, 113 sy-vline,
114 i_final1-xmnga RIGHT-JUSTIFIED, 128 sy-vline,
129 i_final1-zzcnt_readi LEFT-JUSTIFIED, 135 sy-vline,
136 i_final1-zzcnt_readf LEFT-JUSTIFIED, 143 sy-vline.
ENDLOOP.
my aim is whenever workcenter gets changed on change & endon fields get displayed once and other fields in i_final1 internal table displayed mulitiple times.
but this is not working properly.
2008 Aug 11 8:34 AM
Hi
Data: flag type I value 0.
Loop at ITAB.
At New ITAB-Matnr.
flag = 1.
EndAt.
If flag = 1.
WRITE:/30 ITAB-Matnr,50 ITAB-Item,70 ITAB-Reason.
flag = 0.
else.
WRITE:/50 ITAB-Item,70 ITAB-Reason.
endif.
EndLoop.
Hope it helps.
Murthy
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |