Skip to Content

ALV List Header jumbled after executing SALV

Oct 05, 2017 at 08:10 AM


avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

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


There are multiple limitations by using SALV class.


and use the referance object for CL_GUI_ALV_GRID.

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

Show 8 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Ankit,

Quite strange, since the one encountering the issue is the report using ALV List, not the one using SALV.

Not sure why the SALV is affecting the header of the ALV List. As I've mentioned above, the issue does not occur when the SALV report has not been executed before the ALV List report.


Former Member

Hi Jon,

I got your point.

SALV does have multiple issues with that.
I suggest you to use CL_GUI_ALV_GRID instead.

Or you can try once by clearing the SALV object .


You have twice mentioned 'multiple issues' yet not really provided a reason why function modules and outdated classes are better than the more modern, SAP-recomended SALV approach. Could you elaborate?

Former Member

Hi Mike,

I still consider CL_GUI_ALV_GRID as my first option,

When I really need to deliver ALV fast then I choose SALV (Its really quicker).

Just to add very brief I face challenges in this area :

  • You can not change the column text of trafic light in SALV.
  • You have problem in dynamic PF status changes (to precise making buttons grey etc).
  • Fewer option for modifying display setting as the methods in SALV display modifications are declared private,

thus gives lesser control and more security.


Ankit Mahajan


None of these have any relevance’s to the OP’s issue, but for what it’s worth:

  • Any column text is changeable, I’ve not had any such issues. ALV->get_columns( )->get_column( ‘STATUS’ )->set_medium_text( ... ).
  • You would have to place the ALV in a container to do that. To be honest I’m too lazy to do that and just create a couple of statuses with the button configurations I need. It just takes one statement to switch between them.
  • Not sure what you mean here, there are quite a few options to control displays right down to the individual cell.
The only thing I miss is edit mode, but there are workarounds for that.But this is not really the place for this discusson, why not post some new questions?
Former Member


I don't want to dive you deep.

Mike lets close this now as we are diverting from the main issue.

Former Member

Greetings Ankit,

Sorry for the late response. After deliberating, we decided to go with CL_GUI_ALV_GRID in lieu of SALV. Not sure why SALV behaves as such. Could be one of the mysteries we would never know... :)

Anyways, thanks again for the suggestion.

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.


Ankit Mahajan

Sandra Rossi Oct 05, 2017 at 11:26 AM

I don't have any issue:


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 ).
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( ).

b24ux.png (92.0 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Aligning the header is quite the (hard) work! I wouldn't be doing it unless someone is pointing a gun at my head ;)

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