cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro Field catalog

former_member612567
Participant
0 Kudos

Hi Friends ,

I am new to webdynpro.

My issue is in SRM , ALV grid is displayed using webdynpro.

if u see in above screen shot, Dato, KL, brugernavn are the fieldtext(description of the field name) in the ALV grid, as we give SELTEXT in normal ALV Fieldcatalog

Accepted Solutions (0)

Answers (2)

Answers (2)

rajeshkothamasu
Active Participant
0 Kudos

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

harsha_jalakam
Active Contributor
0 Kudos

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