4 weeks ago
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 name | component type | short 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:
ID | Name | Description | Description | Description |
I would like to display as shown below:
ID | Name | Address Key 1 | Address Key 2 | Description |
Could you please tell how to achieve this if I use same data element for more than one field?
Thanks!
Request clarification before answering.
It would be something like the following but it only refers to one field name and you would need to tailor the approach to your needs (kept short for brevity)...
DATA: alv_ref TYPE REF TO cl_salv_table,
cols_ref TYPE REF TO cl_salv_columns,
col_ref TYPE REF TO cl_salv_column.
* Create ALV here ...
...
cols_ref = alv_ref->get_columns( ).
TRY.
col_ref = cols_ref->get_column( 'FIELD3' ).
col_ref->set_medium_text( 'Some Text' ).
CATCH cx_salv_not_found.
ENDTRY.
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
30 | |
9 | |
9 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.