‎2007 Jun 04 1:15 PM
Hi ,
Have used inner joni and have collect the data in an internal table.Now I am not able to go forward to accumulate the data..The interbal table have the following field.
VKORG | KUNNR | MATNR | KWMENG | ZDON..I have sorted the table with the fields
Sort I_VBPA by Vkorg kunnr matnr zdon.I wanted to collect then total of Kwmeng for a set of VKORG | KUNNR | MATNR and ZDON.
EG:
VKORG | KUNNR | MATNR | KWMENG | ZDON..
XXXX yyyy ZZZZ 20 SSSS
XXXX yyyy ZZZZ 10 SSSS.
I wanted to get it as :
XXXX YYYY ZZZZ 30 ssss.
Please let me have ur input ASAP
Thanks
‎2007 Jun 04 1:26 PM
Hi,
<fs> type I_VBPA
<fs2> type I_VBPA
Sort I_VBPA by Vkorg kunnr matnr zdon
V_index = 0.
loop at I_VBPA assigning <fs>.
V_index = sy-tabix + 1.
read I_VBPA assigning <fs2> with index V_index .
if sy-subrc = 0.
--if <fs>-VKORG= <fs2>-VKORG
and <fs>-KUNNR = <fs2>-KUNNR
and <fs>-MATNR = <fs2>-MATNR
and <fs>-ZDON = <fs2>-ZDON .
-
<fs>-KWMENG= <fs>-KWMENG = <fs2>-KWMENG.
-
deleteI_VBPA index V_index.
--endif.
endif.
endloop.
Regards,
Sooness.
‎2007 Jun 04 1:20 PM
Hi,
Use the break events processing like eg:
LOOP AT ITAB.
AT LAST.
SUM.
ENDAT.
ENDLOOP.
TOTALORDAMT = ITAB-ORDAMT.
or
Do this.
data: totalorderamt(12) type n
Loop at itab.
totalorderamt = totalorderamt + itab-amount.
endloop.
Hope this info helps.
Regards,
Kumar.
‎2007 Jun 04 1:20 PM
Hi,
You simply use collect insead of append in iternal table... By this your non numeric fields collect in single row with unique non numeric field combination..
Regards,
Reema Jain.
‎2007 Jun 04 1:20 PM
Hello Donny,
use collect statement.
Eg.
if u hv data in table itab1 then collect data in internal table itab2.
loop at itab1.
move itab1 to itab2.
collect itab2.
endloop.
‎2007 Jun 04 1:26 PM
Hi,
<fs> type I_VBPA
<fs2> type I_VBPA
Sort I_VBPA by Vkorg kunnr matnr zdon
V_index = 0.
loop at I_VBPA assigning <fs>.
V_index = sy-tabix + 1.
read I_VBPA assigning <fs2> with index V_index .
if sy-subrc = 0.
--if <fs>-VKORG= <fs2>-VKORG
and <fs>-KUNNR = <fs2>-KUNNR
and <fs>-MATNR = <fs2>-MATNR
and <fs>-ZDON = <fs2>-ZDON .
-
<fs>-KWMENG= <fs>-KWMENG = <fs2>-KWMENG.
-
deleteI_VBPA index V_index.
--endif.
endif.
endloop.
Regards,
Sooness.
‎2007 Jun 04 1:28 PM
‎2007 Jun 04 1:26 PM
hi,
ty this one
sort itab by VKORG KUNNR MATNR KWMENG ZDON.
loop at itab.
at end of vkorg.
sum.
write:/ vkorg..................
endat.
endloop.
if not working try this one
loop at itab.
at end of zdon.
sum.
write:/ vkorg..................
endat.
endloop.
dont forget to reward points,
Regards,
Imran