Skip to Content
0
Former Member
Feb 07, 2008 at 08:17 PM

General

10 Views

Hey folks,

I want to sum and modify the same table itself.

How wud i do this.

I am creating a field by name qty in the same table i_resb1 , I want the summed up values to be in this field.

Qty shud be sum of all N4's.

i have written the code like this but its not working cud u please correct me if i am wrong

loop at i_resb1 into wa_resb.

read table i_mara into wa_mara with key matnr = wa_resb-matnr binary search.

if wa_mara-meins is initial and i_resb-bdter LE condition_date.

N4 = wa_resb-erfmg.

ELSE.

N4 = wa_resb-erfmg / ( wa_mara-umrez / wa_mara-umren ).

wa_resb-qty = wa_resb-qty + N4.

ENDIF.

modify i_resb1 from wa_resb.

endloop.

Its urgent could somebody please help me..

regards

Rock