on 05-10-2011 9:36 AM
Hi experts,
I have one requirement in which the node contains 10 attribute,but i have to show only 5 attribute in ALV Table.
Can u plz tell me how i can do this.
Thanks
Mahesh
Hi,
Try like this..
Declare ALV config table
data: ALV_CONFIG_TABLE type REF TO CL_SALV_WD_CONFIG_TABLE.
DATA: wd_table_usage TYPE REF TO if_wd_component_usage.
Create an instance of ALV component created ALV_COMP is usage name
wd_table_usage = wd_this->wd_cpuse_alv_comp( ).
IF wd_table_usage->has_active_component( ) IS INITIAL.
wd_table_usage->create_component( ).
ENDIF.
Get ALV component
DATA: wd_table TYPE REF TO iwci_salv_wd_table.
wd_table = wd_this->wd_cpifc_alv_comp( ).
alv_config_table = wd_table->get_model( ).
Declare variable to store column details
DATA: column_settings TYPE REF TO if_salv_wd_column_settings,
column TYPE REF TO cl_salv_wd_column.
column_settings ?= alv_config_table.
***************
*HIDE COLUMNS *
***************
column = column_settings->get_column( 'MANDT' ).
column->set_visible( if_wdl_core=>visibility_none ).
OR
If you want Delete Columns.
From the refernc eof CL_SALV_WD_CONFIG_TABLE you can access the method
CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN
EXPORTING
ID = ls_column-id.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use the method delete column for the not required ones .
pass their id.
here is the sample code
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_alv( ).
DATA lo_value TYPE ref to cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model(
).
lo_value->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN( 'STATUS' ). // deleting the col with id status
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Using the reference cl_salv_wd_config_model, method GET_COLUMNS of IF_SALV_WD_COLUMN_SETTINGS.
Loop through the above columns and SET VISIBILITY method and pass the value NONE.
Regards,
Lekha.
Edited by: Lekha on May 10, 2011 2:12 PM
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.