Skip to Content
0
Former Member
Mar 11, 2008 at 07:22 AM

How to make total using AT END OF ??

105 Views

Hello experts,

I want to make some of quantities. I cant use SUM because i am using 'ASIGNING' with loop because its gives error.

here, is my code.....

loop at itab assigning <fs>.

w_info-qty1 = <fs>-qty1.

w_info-uom = <fs>-uom.

w_info-mfrgr = <fs>-mfrgr.

w_info-qty2 = <fs>-qty2.

endloop.

here my current data in itab......

QTY1 UOM MFRGR QTY2

1 CA ZA1 4

2 CA ZA1 5

2 CA ZA2 6

1 CA ZA1 2

3 CA ZA2 4

I need result like......

QTY1 UOM MFRGR QTY2

4 CA ZA1 11

5 CA ZA2 10

I have tried with following code.......

loop at itab assigning <fs>.

AT END OF mfrgr.

SUM.

w_info-qty1 = <fs>-qty1.

w_info-uom = <fs>-uom.

w_info-mfrgr = <fs>-mfrgr.

w_info-qty2 = <fs>-qty2.

ENDAT.

endloop.

but........it shows error : SUM cannot be used with LOOP.......ASIGNING. and its true.

Can any one tell me any other idea ?

<REMOVED BY MODERATOR>

Regards,

RH

Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:37 PM