on 08-26-2014 3:39 PM
Hi,
refer below code for changing the column name
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( 'TRAVELID' ).
L_HEADER = LO_COLUMN1->GET_HEADER( ).
L_HEADER->SET_TEXT( 'Travel Adv ID' ).
DATA: LO_COLUMN2 TYPE REF TO CL_SALV_WD_COLUMN.
LO_COLUMN2 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).
L_HEADER = LO_COLUMN2->GET_HEADER( ).
L_HEADER->SET_TEXT( 'Employee Name' ).
.
.
.
.
In get_column you have to pass the attribute name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhana,
The column names appearing on the screen are the Field Texts that are defined in the data element, you can either change it there to reflect the changes here or you can change the code manually through coding.
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'KUNNAR' ). " Name of the column
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->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( 'Customer Number' ). "desired name of the column
Regards,
Harsha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.