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

need help

Former Member
0 Likes
569

Hi all,

I have data like this.

Type Quater1 Quater2

Tax Refund 1000 2000

Tax Refund 2000 3000

Tax Refund 2000 2000

Tax Refund 3000 1000

Tax Refund 5000. 1000

but in my final output I want to display

type Quater1 Quater2

Tax Refund 13000 9000.

How can i do that in ALV.

regards,

Ajay reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
542

Hello Ajay,

<b>Use Collect itab instead of Append Itab</b>

Vasanth

5 REPLIES 5
Read only

Former Member
0 Likes
543

Hello Ajay,

<b>Use Collect itab instead of Append Itab</b>

Vasanth

Read only

Former Member
0 Likes
542

Hi, you can collect tha dates.

If you collect you display the date how you want.

Read only

Former Member
0 Likes
542

Hi

put the data in ITAB

sort itab by first field

use at end of ..

do SUM.

and display the data.

sort itab by taxtype.

loop at itab.

at end of taxtype.

sum.

write:/ itab-taxtype, itab-amnt1, itab-amnt2.

endat.

endloop.

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
542

Use this code:

loop at itab1.
  collect itab1 into itab2.
endloop.

itab2 will have your desired output.

Please mark points if the solution was useful.

Regards,

Manoj

Read only

Former Member
0 Likes
542

Hi Ajay,

If you want to display only the TOTAL lines, then you can loop into your internal table and COLLECT the date into another internal table. Pass that to the function module.

LOOP AT ITAB1 into LS_ITAB1

LS_ITAB2 = LS_ITAB1.

COLLECT LS_ITAB2 to IT_ITAB2.

ENDLOOP.

Pass ITAB2 to your function module for ALV Grid.

If you want to display line items as well as SUM then while building Field Catalog use the property DO_SUM = X and pass it to the Function module.

<b>Reward points for informatory answers.</b>

Best Regards,

Ram.