on 04-27-2009 10:34 PM
Hi,
I have an ALV grid in which there is a default column appearing for 'Client' (its not be selected in the context field catalog ) which should be removed . Can you pls give some examples to do this .
Thanks,
Kumar.
You can delete the column as follows
DATA: l_column_settings TYPE REF TO if_salv_wd_column_settings.
l_column_settings ?= lo_value.
l_column_settings->delete_column( id ). " id = column name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With this method you can hidden your collums
DATA: lr_col_header TYPE REF TO cl_salv_wd_column_header,
lt_columns TYPE salv_wd_t_column_ref,
ls_column TYPE salv_wd_s_column_ref.
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns INTO ls_column.
lr_col_header = ls_column-r_column->get_header( ).
CASE ls_column-id.
WHEN 'MANDT'.
ls_column-r_column->set_visible( cl_wd_uielement=>e_visible-none ).
ENDCASE.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
DATA: LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
DATA: LR_INTF_CTRL TYPE REF TO IWCI_SALV_WD_TABLE.
DATA: LR_MODEL TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
LR_INTF_CTRL = WD_THIS->WD_CPIFC_ALV( ).
LR_MODEL = LR_INTF_CTRL->GET_MODEL( ).
WD_THIS->M_MODEL = LR_MODEL.
LR_MODEL->IF_SALV_WD_COLUMN_SETTINGS~DELETE_COLUMN( ID = 'MANDT' ).
Use the above code to delete the column through coding, where ALV is the component usage name in
WD_CPUSE_ALV( ).
Abhi
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.