on 02-08-2010 2:35 PM
hi all,
I am using standard table as dictionary structure for my context node .
So when i m seeing the ouput in ALV the header is coming up with field names . But I want to display field lables so that it can be understood by users .
Could you please send information on this .
thanks
Hi Santosh,
As i understood you want to change the columns headers and if this is right then you can make use of CL_SALV_WD_COLUMN_HEADER class to achieve it.
1. get the ref to all the columns
data: lt_columns type salv_wd_t_column_ref.
data: ls_column type salv_wd_s_column_ref.
lt_columns = lo_value->if_salv_wd_column_settings~get_columns().
2. read the column you want to add custom header
loop at lt_columns into ls_column.
case ls_column-id.
when 'MATNR'.
data lr_col_header type ref to cl_salv_wd_column_header.
lr_col_header = ls_column-r_column->create_header().
lr_col_header->set_text('Test Header').
endcase.
endloop.
this will set the column header as "test header" for the field matnr.
Thanks,
Abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
lo_value here refers to class cl_salv_wd_config_Table.
This is how you get ta reference to this class.
DATA: lo_cmp_usage type ref to if_wd_component_usage.
DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
DATA: lo_value TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
*create an instance of your ALV component
lo_cmp_usage = wd_this->wd_cpuse_OVERVIEW_POTENT_ALV( ). " replace it by your ALV name
* if not initialized, then initialize
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
* get ALV component
lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_POTENT_ALV( ). "replace it by your ALV usage name
lo_value = lr_salv_wd_table->get_model( ).
You can write this code in doinit of view.
Regards
Manas Dua
Hi santhosh..
Check the Type of all the attributes within tat node..Whether it refers to the dictionary element.. like MARA-MATNR..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
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.