2009 Feb 26 10:45 AM
Hi Guys,
I have a internal table with all transfer order details.
For example I have 3 Items in one delivery,each item contains 3 ordered quantities with some weight and volume.
Let's say 1st Item has 3 ordered quantities with total weight 150lbs and volume 75cft.
Now I need to calculate how much each ordered quantity has how much weight and volume.
After calculating I need to append each quantity, weight and volume to another Internal table.
My final internal table should look like
VBELN Qty Wt Vl
1144 1 50 25
1144 2 50 25
1144 3 50 25
Thanks,
Prasad.
2009 Feb 26 10:51 AM
use the following code
loop at itab.
collect itab into itab2. " itab2 just like itab1
endloop.
2009 Feb 26 10:51 AM
use the following code
loop at itab.
collect itab into itab2. " itab2 just like itab1
endloop.
2009 Feb 26 10:53 AM
Hi,
You can do this with Control break commands.
sort itab by vbeln.
field-symbols: <fs_tab> like itab.
take three variable for qty, weight and volume
Loop at itab assigning <fs_tab>.
qty = qty + <fs_tab>-qty.
wt = wt + <fs_tab>-wt.
vl = vl + <fs_tab>-vl.
at end of vbeln.
wa = <fs_tab>.
wa-qty = qyt.
wa-wt = wt.
wa-vl = vl.
append wa to itab2.
endat.
Endloop.
Now you itab2 will have unique document number with total sum of quantity weight volume.
Regards,
Venkatesh
2009 Feb 26 11:17 AM
Thanks to all of you guys.
I am writing my own logic using do and enddo...