cancel
Showing results for 
Search instead for 
Did you mean: 

SALV_WD_TABLE Column name problem??

Former Member
0 Kudos

Hello,

In my WDA View, i am using SALV_WD_TABLE Component. By default, when i am running this application, i am getting the Short version of Field Label declared inside Data Element which i don't want. So, inside the WDDOINIT method i wrote the following code:

method wddoinit.
data lr_cmp_usage     type ref to if_wd_component_usage.
  data lr_if_controller type ref to iwci_salv_wd_table.
  data lr_cmdl          type ref to cl_salv_wd_config_table.
  data lr_col           type ref to cl_salv_wd_column.
  data lr_header        type ref to cl_salv_wd_column_header.

*--- Instantiate ALV component
  lr_cmp_usage =   wd_this->wd_cpuse_usage_alv( ).
  if lr_cmp_usage->has_active_component( ) is initial.
    lr_cmp_usage->create_component( ).
  endif.

*--- Get reference to model
  lr_if_controller =   wd_this->wd_cpifc_usage_alv( ).
  lr_cmdl          = lr_if_controller->get_model( ).

*--- Set tooltip of column header
  lr_col = lr_cmdl->if_salv_wd_column_settings~get_column( 'FNAME' ).
  lr_header = lr_col->get_header( ).
  lr_header->set_text( exporting value = 'First Name' ).
endmethod.

When i run my application i still see the column name as FNAME and not First Name. Is anything wrong with the above code?

And, is it possible to forcefully display Medium or Long version of Field Label directly from Data Element? Thanks.

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vasu,

You need to do the coding like as follows to set forcefully the Medium or short or long or tilte.

  lr_column = wd_comp_controller->r_table->if_salv_wd_column_settings~get_column( 'FNAME' ). 
   lr_column->r_header->set_ddic_binding_field( 00, 01, 02 ,03, 04 ).
<b>          Here 00 means None
                  01 means Short
                  02 means Medium
                  03 means Long
                  04 means Title</b>

This will solve your problem.

Reward me if it solves your problme.

Warm Regards,

Vijay

Answers (1)

Answers (1)

Former Member
0 Kudos

hi Vasu ,

Please refer to <b>SALV_WD_DEMO</b> .Demo package provided by SAP for ALV in WebDynpro ABAP. See weather that help you or not.

Cheers

Parry