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: 

header/top of page in OO ALV

Former Member
0 Kudos
797

Hi,

I'm using OO ALV to display two ALV grid's in the output of the report.

If I double click on any of the entry in the first ALV grid,it shows the next ALV in a pop up.

Now in the pop up,I need to add a "header" for the ALV grid(to display all the common data fields).

Can anyone tell me how do I do this using OO ALV?

Also since the second ALV is being displayed in a pop up,not sure how can I add the header section?

i'm using the foll to display ALV in pop up:

   TRY.
        cl_salv_table=>factory(
          IMPORTING
            r_salv_table = gr_table
          CHANGING
            t_table      = t_det ).
      CATCH cx_root INTO v_alv_exc.                   

ENDTRY.


gr_table->set_screen_popup(
      start_column = 1
      end_column   = 70
      start_line   = 1
      end_line     = 20 ).

gr_table->display( ).

1 REPLY 1

Former Member
0 Kudos
375

Hi,

To add a header text in SALV class, first you need to get the class of display setting(using gr_table->get_display_settings( ) ) of your table, then you can set the header text using this class of display setting. I had added the code below for your reference.

DATA: gr_display TYPE REF TO cl_salv_display_settings,

           gv_title   TYPE lvc_title.


gv_title = 'This is header text'.

TRY.
        cl_salv_table=>factory(
          IMPORTING
            r_salv_table = gr_table
          CHANGING
            t_table      = t_det ).
      CATCH cx_root INTO v_alv_exc.                  

ENDTRY.

gr_display = gr_table->get_display_settings( ).              

gr_display->set_list_header( gv_title ).

gr_table->set_screen_popup(
      start_column = 1
      end_column   = 70
      start_line   = 1
      end_line     = 20 ).

gr_table->display( ).

Regards,

Xavier