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

regarding list display

Former Member
0 Likes
783

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.

1 ACCEPTED SOLUTION
Read only

former_member404244
Active Contributor
0 Likes
761

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.

5 REPLIES 5
Read only

former_member404244
Active Contributor
0 Likes
762

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

Read only

Former Member
0 Likes
761

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.

Read only

0 Likes
761

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.

Read only

0 Likes
761

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.

Read only

former_member787646
Contributor
0 Likes
761

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