cancel
Showing results for 
Search instead for 
Did you mean: 

Need inputs on how to change Field names while using class cl_salv_table

ABAPer_1631
Explorer
0 Kudos
136

Hello,

Need inputs on below case:

In a report program I am using the class CL_SALV_TABLE to display final result of the internal table using ALV.

The structure which is used for the final output table has multiple fields and some of them pointing to same data element. Here is the example.

Final table name - gt_<table_name>

gt_<table_name> is TYPE TABLE OF ZP_S_<structure_name>.

the global structure ZP_S_<structure_name> has below fields:

component namecomponent typeshort description
<field1><field_type1>ID
<field2><field_type2>NAME
<field3><field_type3>Description
<field4><field_type3>Description
<field5><field_type3>Description

As field3,4,5 using same data element it is displaying the same field label in the ALV.

But I would like display valid/relevant field names which I provide in the program as field label.

In precise, now, after I execute report program output is as below:

IDNameDescriptionDescriptionDescription

I would like to display as shown below:

IDNameAddress Key 1Address Key 2Description

Could you please tell how to achieve this if I use same data element for more than one field?

Thanks!

View Entire Topic
jakob_steen-petersen
Contributor
0 Kudos

Ryan-Crosby has the right Answer, but as this is a quite basic question I was wondering if you have checked the demo programs? They are quite useful 

Search for programs like : SALV_DEMO*