2006 Aug 28 7:36 PM
i have to design a report basing this criteria
i ve internal table with few fields
gt_cost is the internal table
leve2 lstar cost
-
-
-
om65 61 100
om65 63 200
om65 62 200
om61 96 400
om61 102 200
etc..
i ve display to in this format
96 400
102 200
-
om61 600
-
61 100
62 200
63 200
-
om65 500
-
total 1100
-
how do i go with this
i have to design a report basing this criteria
i ve internal table with few fields
gt_cost is the internal table
leve2 lstar cost
-
-
-
om65 61 100
om65 63 200
om65 62 200
om61 96 400
om61 102 200
etc..
i ve display to in this format
96 400
102 200
-
om61 600
-
61 100
62 200
63 200
-
om65 500
-
total 1100
-
how do i go with this
2006 Aug 28 7:44 PM
sort gt_cost by leve2 lstar.
loop at gt_cost.
at new lstar.
ltot = 0.
endat.
ltot = ltot + cost.
write : / lstar, cost.
at end of lstar.
uline.
write : / leve2, ltot.
uline.
total = total + ltot.
endat.
endloop.
write : / 'total', total.
Regards
Anurag
2006 Aug 28 7:45 PM
Hi Jack,
Welcome to SDN..........
Try with this code.
First of SORT the internal table and apply control commands on interna table.
SORT GT_COST BY LEVEL2.
LOOP AT GT_COST.
WRITE:/ GT_COST-LSTAR,GT_COST-COST.
AT END OF LEVLE2.
SUM.
ULINE(30).
WRITE:/ GT_COST-LEVEL2, GT_COST-COST.
ULINE(30).
SKIP.
ENDAT.
ENDLOOP.
To know more about control commands, just browse this link
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/at_itab.htm
Thanks,
Vinay
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |