on 09-14-2007 10:07 AM
Hi,
how can i delete or hide a column in ALV? I just try it with the following code but it doesn't work.
*... Invoke a method of the ALV Interfacecontroller
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_usage_alv( ).
DATA:
lr_cmdl TYPE REF TO cl_salv_wd_config_table.
*... get model
lr_cmdl = l_ref_interfacecontroller->get_model(
).
**... hide column field2
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA: lr_column TYPE REF TO cl_salv_wd_column.
* get Column
lr_column_settings ?= lr_cmdl.
lr_column = lr_column_settings->get_column( 'DESCR' ).
lr_column->set_visible( '01' ).
regards,
Sharam
Hi, try this :
data lt_columns TYPE STANDARD TABLE OF salv_wd_s_column_ref,
Data ls_columns TYPE salv_wd_s_column_ref.
settings->if_salv_wd_column_settings~get_columns(
RECEIVING value = lt_columns ).
LOOP AT lt_columns INTO ls_columns.
lr_column = settings->if_salv_wd_column_settings~get_column(
ls_columns-id ).
CASE ls_columns-id.
WHEN 'DESCR'.
ls_columns-r_column->set_visible( '01' ).
ENDCASE.
ls_columns-r_column->set_visible( '01' ).
ENDLOOP.
and to delete a column :
settings->if_salv_wd_column_settings~delete_column(
'DESCR' ).
Mayaa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
u will need to do a work-around. U define a node w.r.t a db table and then map this node to ur ALV grid. Now ur grid will show ALL fields in the db. To only display the selected fields inside the ALV table clear the dictionary reference in property DICTIONARY STRUCTURE in the node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharam
Try This
lr_column_settings ?= lr_cmdl.
lr_column_settings->delete_column( 'DESCR' ).
Regards
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.