cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancement Implementation - Removing columns in standard ALV table

Former Member
0 Kudos

Hello Friends,

I am customizing a standard WDA Component. The business requirement is to rename couple of columns in an ALV Table.

My proposed solution is to create 2 new columns with the required names and then hide the standard columns.

I have the option to ONLY remove these 2 columns, instead of simply hiding them. I want to confirm that removing these 2 columns in an Enhancement Implementation will not permanently remove these 2 standard columns from the standard component and that these 2 standard columns will be displayed once the enhancement implementation is deleted.

Friends, Can you please confirm the same.

Regards,

John.

Accepted Solutions (1)

Accepted Solutions (1)

former_member199125
Active Contributor
0 Kudos

Hi john,

Instead of creating two new columns, you can simply change the standard column names by using below code.

      • first to instantiate the alv component

DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV1( ).

IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

LO_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

      • then get the get_model method reference to make alv change

DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

LO_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV1( ).

DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(

).

      • to change the column names

DATA L_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.

DATA: LO_COLUMN1 TYPE REF TO CL_SALV_WD_COLUMN.

LO_COLUMN1 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'REQUESTID' ).

L_HEADER = LO_COLUMN1->GET_HEADER( ).

L_HEADER->SET_PROP_DDIC_BINDING_FIELD(

PROPERTY = IF_SALV_WD_C_DDIC_BINDING=>BIND_PROP_TEXT

VALUE = IF_SALV_WD_C_DDIC_BINDING=>DDIC_BIND_NONE ).

L_HEADER->SET_TEXT( 'Request ID' ).

Note: Requestid is the attribute name which you want to change the name of column.

Regards

Srinvias

Answers (2)

Answers (2)

Former Member
0 Kudos

I need to make these changes in a table NOT an ALV table. I am closing the thread.

John.

Former Member
0 Kudos

Hi John,

If you have to add & Delete the columns,

- For addition try to use the existing coulmns & Hide the other columns which u dont want.

- Be carefull in mapping the data to the node