Skip to Content
avatar image
Former Member

ALV List Header jumbled after executing SALV

Greetings Everyone,

I have a requirement which required me to display different ALVs depending on the selected report in the Selection Screen. One of the reports is using SALV, while another is using ALV List. The header (TOP_OF_PAGE) of the report using ALV List has texts and the ALV column headers (the original ALV column header has been disabled, and has been "redrawn" along with another layer of column headers). As per arrangement, the header would display first followed by the drawn ALV headers (see picture 1).

This is working fine when executing the said report first. However, after executing the report using SALV, the header of the report using ALV List seems jumbled when executed; the drawn ALV column headers display first before the text (see picture 2).

Kindly suggest on how to address this behavior.

Thank you.

picture-1.png (10.0 kB)
picture-2.png (9.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 05, 2017 at 08:57 AM
    -2

    Hi,

    There are multiple limitations by using SALV class.

    Better I suggest use the FM GET_GLOBALS_FROM_SLVC_FULLSCR

    and use the referance object for CL_GUI_ALV_GRID.

    If you try by this there won't be any issue with header.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Yes friend,

      There are still many challenges with SALV.

      If the requirement is complex I still prefer CL_GUI_ALV_GRID from start.

      Regards,

      Ankit Mahajan

  • Oct 05, 2017 at 11:26 AM

    I don't have any issue:

    Code:

    REPORT.
    DATA: ispfli     TYPE TABLE OF spfli,
          gr_table   TYPE REF TO cl_salv_table,
          gr_columns TYPE REF TO cl_salv_columns_list,
          lo_grid    TYPE REF TO cl_salv_form_layout_grid.
    SELECT * INTO TABLE ispfli FROM spfli.
    cl_salv_table=>factory( EXPORTING list_display = abap_true IMPORTING r_salv_table = gr_table CHANGING t_table = ispfli ).
    gr_columns ?= gr_table->get_columns( ).
    gr_columns->set_headers_visible( if_salv_c_bool_sap=>false ).
    CREATE OBJECT lo_grid.
    lo_grid->add_row( )->create_text( text = '                  |-------------|' ).
    lo_grid->add_row( )->create_text( text = '                  |     Text    |' ).
    lo_grid->add_row( )->create_text( text = '                  |-------------|' ).
    lo_grid->add_row( )->create_text( text = '                  | Text | Text |' ).
    gr_table->set_top_of_list( lo_grid ).
    gr_table->display( ).
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Indeed. Though due to the requirement, we are made to do the above approach. Anyhow, I resorted with the use of CL_GUI_ALV_GRID in lieu of SALV.

      Thanks for the help