‎2008 May 08 11:24 AM
Hi experts,
iam doing one alv report in that report i want to do the like this
matnr kwmeng lfimg
m123 1086 30
m124 1086 30
m125 1086 15
m126 1086 20
i want to do the sum of lfimg. and at last it will be deduct from kwmeng. bal = 1086-95 as like this
rewards are helpful answers.
thanks& regards,
Narasimha Rao.
‎2008 May 08 11:36 AM
Hi Narayanadas,
You might have stored the data in the internal table itab.
loop at itab.
at last.
sum.
g_lfmng = itab-lfmng.
endat.
endloop.
Now the summation value will be available in g_lfmng.
g_bal = itab-kwmeng - g_lfmng.
here g_lfmng, g_bal are global variable which you have to declare.
thanks & regards
Kishore Kumar Maram
‎2008 May 08 11:36 AM
Hi Narayanadas,
You might have stored the data in the internal table itab.
loop at itab.
at last.
sum.
g_lfmng = itab-lfmng.
endat.
endloop.
Now the summation value will be available in g_lfmng.
g_bal = itab-kwmeng - g_lfmng.
here g_lfmng, g_bal are global variable which you have to declare.
thanks & regards
Kishore Kumar Maram
‎2008 May 08 11:41 AM
Hi,
Is KWMENG a one time value... i mean in the example you have added LFIMG values and subtracted from single value of KWMENG. Pls be clear in this regard.
Regards,
Anu.
‎2008 May 08 11:52 AM
hi check this..
for the sum at the end
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-reptext_ddic = 'Material description'.
wa_fieldcat-do_sum = 'X'.
append wa_fieldcat to it_fieldcat .
regards,
venkat