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

multiple line output

Former Member
0 Likes
706

hi experts,

i m facing a new problem IN ALV REPORT .

my OUTPUT data is like that.

component UOM ALTBOM1 ALTBOM2 ALTBOM3 ALTBOM4 ALTB

11000000 TO 0.500 0.000 0.000 0.000 0.000

11000000 TO 0.500 15.000 0.000 0.000 0.000

11000007 TO 0.450 0.000 0.000 0.000 0.000

11000007 TO 0.450 0.550 0.000 0.000 0.000

19000020 M3 10.000 0.000 0.000 0.000 0.000

19000021 M3 5.000 0.000 0.000 0.000 0.000

19000021 M3 5.000 8.000 0.000 0.000 0.000

19000021 M3 5.000 8.000 10.000 0.000 0.000

19000021 M3 5.000 8.000 10.000 12.000 0.000

19000022 M3 7.000 0.000 0.000 0.000 0.000

19000022 M3 7.000 10.000 0.000 0.000 0.000

19000022 M3 7.000 10.000 12.000 0.000 0.000

SO for each component my last line is the correct output . so i wanna to remove rows that are not needed.

component UOM ALTBOM1 ALTBOM2 ALTBOM3 ALTBOM4 ALTB

11000000 TO 0.500 15.000 0.000 0.000 0.000

11000007 TO 0.450 0.550 0.000 0.000 0.000

19000020 M3 10.000 0.000 0.000 0.000 0.000

19000021 M3 5.000 8.000 10.000 12.000 0.000

19000022 M3 7.000 10.000 12.000 0.000 0.000

so i waana last row for each component , what should i do, please help me for that.

thanks in advance.

regards

vijay dwivedi

marks will b sure for each helpfull answer*

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
688

sort itab by idnrk stlal descending.

delete adjacent duplicates from itab.

now pass the utab in alv fm

regards

shiba dutta

6 REPLIES 6
Read only

Former Member
0 Likes
688

hi

i am not sure if it's showing duplicate entries or some extra values, but if u want the last line of each component alone in the output, then do somehting like this

loop at original_tab.

at end of component.

move-corresponding original_tab to temp_tab.

append temp_tab.

endat.

endloop.

pass temp_tab to alv.

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
688

Use

AT-END fieldname(UOM).

regards

prabhu

reward if it is helpful

Read only

Former Member
0 Likes
689

sort itab by idnrk stlal descending.

delete adjacent duplicates from itab.

now pass the utab in alv fm

regards

shiba dutta

Read only

Former Member
0 Likes
688

hi vijay

try this.

<b>read table itab1 with key <field name>/component.

on change of <field name>

select <f1> <f2>.. from ztable into itab2.

end on.

regards

ravish

<b>dont forget to reward points if helpful</b>

Read only

Former Member
0 Likes
688

sorry

sort itab by idnrk stlal descending.

delete adjacent duplicates from itab comparing idnrk stlal."here stlal is alt bom2

regards

shiba dutta

Read only

0 Likes
688

hi shiba,

thanks a lot for ur valuable suggestion.

i used sorting only over idnrk and then delete adjecent it is working nicely.

thanks once again.