12-14-2006 10:43 PM
hello everyone,
i need some help in writin an ABAP code. Well the logic is say i have a table which sends data to BW. the data comes like :-
Order Q1
101 50
101 20
102 10
101 60
But i want to store only 1 value for each order , i.e summarize the value so in when the data package comes , i want to check all records for one order and add the qty value for each order and store it in the ODS.
so ODS for above eg should look like
Order qty
101 130
102 10
Thanks,
Will assign points to all helpful answers.
Laura.
12-14-2006 10:49 PM
You can use this Logic.
Sort I_TAB by Order. " I_TAB will be your internal table containg order and Qty
Loop at I_TAB.
at new order.
Move I_Tab-Order to I_outtab - Order.
Collect Itab. " This will sum up the quantiies at end for you
Move I_Tab-Oty to I_outtab-QTY.
Endat.
Endloop.
- Guru
12-14-2006 10:49 PM
You can use this Logic.
Sort I_TAB by Order. " I_TAB will be your internal table containg order and Qty
Loop at I_TAB.
at new order.
Move I_Tab-Order to I_outtab - Order.
Collect Itab. " This will sum up the quantiies at end for you
Move I_Tab-Oty to I_outtab-QTY.
Endat.
Endloop.
- Guru