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

summing

Former Member
0 Likes
854

hi friends,

my requirement is to capture carrid and sum seatsmax field and display at once.

for ex : 'LH' lufthansa we have a big list.

i need to capture carrid and sum seatsmax and display at once ...like wise all carrid with out any duplicates.

result should be LH 5500.

AA 6600.

thanks&regards

deepika.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
820

Use DELETE ADJACENT DUPLICATES FROM ITAB COMPARUNG FIELD.

AND write---- AT LAST.

SUM.

END AT.

OR use collect statement.

6 REPLIES 6
Read only

Former Member
0 Likes
820

HI ,

use DELETE ADJACENT DUPLICATES FROM for deleting the repeated entries in the internal table .

regards

chinnaiya

Read only

Former Member
0 Likes
821

Use DELETE ADJACENT DUPLICATES FROM ITAB COMPARUNG FIELD.

AND write---- AT LAST.

SUM.

END AT.

OR use collect statement.

Read only

0 Likes
820

yes thanks for your reply.

i have done by using loop statements but im not getting required output.

thanks&regards

deepika.

Read only

0 Likes
820

Hi,

Don't use the DELETE DUPLICATE Statment.

SORT ITAB BY CARRID.
LOOP AT ITAB.

L_SEAT = L_SEAT + itab-seatsmax.

AT END OF CARRID.
 WRITE:/ ITAB-CARRID, L_SEAT.
 CLEAR L_SEAT.
ENDAT.

ENDLOOP.

Read only

0 Likes
820

thank you very much.

thanks&regards

deepika.

Read only

Former Member
0 Likes
820

you can use collect if yu are in a loop

Regards,

Lalit Mohan gupta.