‎2008 Nov 22 6:07 AM
L1 L2
54654 414.00
654654 237.60
654654
54654 1,108.80
654654 1,136.00
654654 5,956.00
NOW I WANT OUTPUT LIKE
L1 L2 sum
54654 414.00 1,522.80
54654 1,108.80 1,522.80
654654 1,136.00 7,329.60
654654 237.60 7,329.60
654654 5,956.00 7,329.60
HERE GROUP IS L1 SO
L1 54654 414
54654 1108 SO TOTAL IS 1522
‎2008 Nov 22 6:17 AM
Hi Jani
loop the internal table and add the L1 and L2 and then you print the out put and make use of control break statements
‎2008 Nov 22 6:20 AM
i don't want addition l1 and l2
i want group l1 and sum l2 all according to l1 group
‎2008 Nov 22 7:49 AM
‎2008 Nov 22 8:58 AM
‎2008 Nov 22 9:07 AM
I USE FOLLOWING LOGIC:-
sort i_data by lrnum.
loop at i_data.
on change of i_data-lrnum.
if sy-tabix = 1.
else.
itab-lrfriegh = tot_sum.
append itab.
clear itab.
clear i_data.
clear tot_sum.
endif.
endon.
at end of lrnum.
move i_data to itab.
endat.
tot_sum = tot_sum + i_data-afriegh.
at last.
itab-lrfriegh = tot_sum.
append itab.
clear itab.
clear i_data.
clear tot_sum.
endat.
endloop.
CLOSE THREAD
Edited by: krupa jani on Nov 22, 2008 10:10 AM