Application Development 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: 

How to create sub-headings in ALV grid (OO)

Former Member
0 Kudos

I'm trying to figure out how to have multiple headings in an ALV report and specifically, how to group the sub headings under another wider heading.

Example of what I'm looking to do (circled in red)

<a href="http://img689.imageshack.us/img689/894/forum14f35511154572086.jpg">http://img689.imageshack.us/img689/894/forum14f35511154572086.jpg</a>

I've done some extensive searching for a solution to this problem and so far have only read that it "can't be done". I don't believe that as I've seen it done. See my link to an example.

Can anyone help?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check out this thread. It has same issue as you are facing:

Hope it solves your problem.

Regards,

Mansi.

5 REPLIES 5

Former Member
0 Kudos

Hi,

Check out this thread. It has same issue as you are facing:

Hope it solves your problem.

Regards,

Mansi.

0 Kudos

Hi, no that doesn't solve the problem. I'm looking for a OO solution.

0 Kudos

Bump. I'm going to be really surprised if no one in here knows how to do this.

0 Kudos

As far..as the Column with 2 heading problem...uptill now no one has given a solution for the even i was having the same problem...

0 Kudos

Hi,

You can use the below code.

DATA : obj_header TYPE REF TO cl_salv_form_layout_grid,

sp_obj_header TYPE REF TO cl_salv_form_layout_grid.

TRY.

CALL METHOD cl_salv_table=>factory(

IMPORTING

r_salv_table = obj_output

CHANGING

t_table = it_display ). "Internal table to dispaly ALV output

CATCH cx_salv_error.

ENDTRY.

CREATE OBJECT sp_obj_header.

  • Create a header grid with required column and rows

obj_header = sp_obj_header->create_grid( row = 2

column = 1

colspan = 6 ).

obj_header->create_label(

row = 1

column = 1

text = 'Test line1' ).

obj_header->create_label(

row = 2

column = 1

text = 'Test line2').

obj_output->set_top_of_list( obj_header ).

  • Display Table

obj_output->display( ).

Hope this may be helpful.

Regards,

Sravanthi.V