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

Group By Without Using Any Aggregate Function

Former Member
0 Likes
863

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

5 REPLIES 5
Read only

bpawanchand
Active Contributor
0 Likes
828

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

Read only

0 Likes
828

i don't want addition l1 and l2

i want group l1 and sum l2 all according to l1 group

Read only

Former Member
0 Likes
828

Solved by myself

Read only

0 Likes
828

How?

Can you please mention what approach you followed?

Read only

0 Likes
828

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