on 11-30-2011 12:34 PM
Hi ,
I have created two attribute PART_NUMBER and TERM_CODE in context level with type CHAR10.
AND in ALV header PART_NUMBER and TERM_CODE is displaying, which is coming from context level.
i want to rename the header of ALV to PARTNUMBER and TERMCODE.
could any one send me the sampls code or any solution?
Thanks
Rakshar
First get access to the ALV Model object for your ALV usage:
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( ).
Then access the column you want to change the header on. In addition to setting the text of the header of the column, you must also force off the data dictionary binding for the field property text.
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'POSTING_DATE' ).
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( `Posting Date` ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. You have to, of course, adjust your component usage name for whatever you named it. I named my ALV Component usage - ALV. If you named yours XYZ, for example, you would adjust this section of code to read:"
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_xyz( ).
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_xyz( ).
data l_table type ref to cl_salv_wd_config_table.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.