on 03-14-2008 6:49 AM
hi,
how do we remove a particular column from an alv grid in runtime.
and also let me know how do we find wether a column is empty or not in runtime.
Thanks & Regards,
Ritwik.
hi ritwik,
The table u r passing to alv has to be checked whether it has any empty colums.
only those columns has to be set invisible.
Logic for checking empty columns
u define one structure with flags. for each column in the data table u have to define one flag in the structure.
suppose my table is having columns A B C
then i will define structure
types begin of str_flags,
A_f type c ,
B_f type c,
C_f type c,
end of str_flags.
loop on the internal table and check each column whether it is empty or not
if it is not empty set the flag as 'X'.
finally after the end of loop u will come to know which columns r empty.
Regards,
janakiram.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ritwik,
how to hide a column:
DATA: lr_column TYPE REF TO cl_salv_wd_column,
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lv_set_column_visible TYPE wdy_uie_library_enum_type,
lr_salv_wd_conf_table TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
lr_alv_site_view_ci TYPE REF TO IWCI_SALV_WD_TABLE.
lr_alv_site_view_ci = wd_this->wd_cpifc_alv( ).
lr_salv_wd_conf_table = lr_alv_site_view_ci->get_model( ).
lr_column_settings ?= lr_salv_wd_conf_table.
lr_column = lr_column_settings->get_column( 'COLUMN_NAME' ).
lv_set_column_visible = cl_wd_uielement=>e_visible-none.
lr_column->set_visible( lv_set_column_visible ).
Please note, that in the WD component, in the component usage, my SALV_WD_TABLE component is called simply 'ALV' in my component, you need to change this coding above according to your settings.
how to find empty column:
the easiest way, if you loop through the table behind the ALV and check, whether the column is empty.
BR,
Peter.
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.