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

ALV doubt

Former Member
0 Likes
343

Hi all

I am a fresher in abap, I have to do alv list report.

I have some data in ITAB like this,

AAAAAA 1 1

AAAAAA 1 2

AAAAAA 2 8

BBBBBB 6 7

BBBBBB 7 9

BBBBBB 1 0

BBBBBB 2 2

BBBBBB 3 1

CCCCCC 5 8

CCCCCC 7 0

CCCCCC 8 3

CCCCCC 9 3

I want to get the alv list like this.

Some heading for "AAAAAA"

AAAAAA 1 1

< space > 1 2

< space > 2 8

total for AAAAA : xxx

Some heading for "BBBBBB"

BBBBBB 6 7

< space > 7 9

< space > 1 0

< space > 2 2

< space > 3 1

total for BBBBB : xxxx

Some heading for "CCCCCC"

CCCCCC 5 8

< space > 7 0

< space > 8 3

< space > 9 3

total for CCCCC :xxxx

anyone know how to do using field catelog or anyhow....

and the heading should come between the rows.

expecting helps from yours.

thanks and regards

Jose

1 REPLY 1
Read only

Former Member
0 Likes
298

Hi,

Lets assume your internal table gt_output has the following data. This table is sorted.

Field1 Field 2 Field 3

AAAAAA 1 1

AAAAAA 1 2

AAAAAA 2 8

BBBBBB 6 7

BBBBBB 7 9

BBBBBB 1 0

BBBBBB 2 2

BBBBBB 3 1

CCCCCC 5 8

CCCCCC 7 0

CCCCCC 8 3

CCCCCC 9 3

The logic should be like this.

Loop at gt_output into <work_area>.

At-new field1.

ls_final_output-field1 = <work_area>-field1.

ENDAT

ls_final_output-field2 = <work_area>-field2.

ls_final_output-field3 = <work_area>-field3.

Append ls_final_output into gt_final_output.

clear ls_final_output.

Endloop.

Call the ALV using gt_final_output.

Please get back in case you want any more details.

Regards,

Sandeep