Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Report display

Former Member
0 Likes
393

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

2 REPLIES 2
Read only

Former Member
0 Likes
364

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

Read only

Former Member
0 Likes
364

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