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: 

Rename Columns Titles

sastry_gunturi
Active Participant
0 Kudos

How do I rename the column heading while displaying output in ALV using CL_SALV_TABLE.... I am using the following code which is not working.

LR_COLUMN = IR_COLUMNS->GET_COLUMN( 'HEADER' ).
      LR_COLUMN->SET_TECHNICAL( IF_SALV_C_BOOL_SAP=>FALSE ).
      LR_COLUMN->SET_MEDIUM_TEXT( 'Requisition Title' ).

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

Is HEADER a column name? Should be.

This code works fine for me


data: gr_columns type ref to cl_salv_columns_table,
          gr_column type ref to cl_salv_column_table.

...
gr_columns = gr_table->get_columns( ). 
gr_column ?= gr_columns->get_column( 'CARRID' ).  "column name
gr_column->set_long_text( 'Long text' ). 
gr_column->set_medium_text( 'Medium text' ).
gr_column->set_short_text( 'Short text' ).
....
gr_table->display( ).

Regards

Marcin

1 REPLY 1

MarcinPciak
Active Contributor
0 Kudos

Is HEADER a column name? Should be.

This code works fine for me


data: gr_columns type ref to cl_salv_columns_table,
          gr_column type ref to cl_salv_column_table.

...
gr_columns = gr_table->get_columns( ). 
gr_column ?= gr_columns->get_column( 'CARRID' ).  "column name
gr_column->set_long_text( 'Long text' ). 
gr_column->set_medium_text( 'Medium text' ).
gr_column->set_short_text( 'Short text' ).
....
gr_table->display( ).

Regards

Marcin