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: 

Problem in ALV report using CL_SALV_TABLE

Former Member
0 Kudos
145

     Hi,

We have a alv report containing around 110 columns. We are able to display. But the column titles are coming from data dictionary. We want to modify the column titles of all 110 fields. How to set the total columns titles at the same time ?

regards

Janaki Ram

2 REPLIES 2

Former Member
0 Kudos
85

Hello

Please look the following code.

  data: lo_column           type ref to cl_salv_column.

  data: lo_columns_item     type ref to cl_salv_columns_table.

  data: lo_column_item      type ref to cl_salv_column_table.

  try.

      lo_columns = go_alv->get_columns( ).

      lo_column = lo_columns->get_column( 'CURRENT_NAME' ).

      lo_column->set_long_text( 'NEW_NAME' ).

*repeat above code for all the columns

    catch cx_salv_not_found.                            "#EC NO_HANDLER

  endtry.

Better to make smal subroutine and pass the current name and new name of column ,

Also see the standard program like SALV_DEMO_TABLE_LAYOUT

Thanks

Sandeep

raymond_giuseppi
Active Contributor
0 Kudos
85

Just read the documentation of the class or some googling with simple keywords to find SAP documents like Change of DDIC Reference for a Column, Column Header or Sorting by Columns in Columns (General) of ALV Object Model.

Regards,

Raymond