on 04-29-2008 8:09 AM
Hi,
My requirement is based the field 'Service Group' which is like Nursing,HouseKeeping, i need to show the table columns.
in my first view i have 1 select-option for date and 1input field..
based on the date i am getting the records.till here it's working fine.i bind the table to the node.and it is showing the ALV table.
but for some service groups i need not show some table fields only.how to do this?yesterday one of the forum member has told me the procedure.but i did not get it.(that didnot work)giving NULL OBJECT reference.
please help to find out any way of doing this?
hi,
can you plz tell me that are you using alv or you are using table controll.
regards,
ritwik.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lakshmi,
if you are using alv use the following code to disable your columns at runtime:
-
DATA : lr_alv_if TYPE REF TO iwci_salv_wd_table,
lr_alv_model TYPE REF TO cl_salv_wd_config_table,
lr_cmp_usage TYPE REF TO if_wd_component_usage.
lr_cmp_usage = wd_this->wd_cpuse_appr_alv( ).
IF lr_cmp_usage->has_active_component( ) IS INITIAL.
lr_cmp_usage->create_component( ).
ENDIF.
*... Invoke a Method of the ALV Interfacecontroller
lr_alv_if = wd_this->wd_cpifc_appr_alv( ).
*... Get Model
lr_alv_model = lr_alv_if->get_model( ).
get table of column settings - each line one column
lt_columns = mr_column_settings->get_columns( ).
loop over table - in each loop a column can be modified
LOOP AT lt_columns INTO ls_column .
CASE ls_column-id.
WHEN 'COLUMN NAME'.
ls_column-r_column->set_visible (abap_false).
............
hope this works.
Regards,
Ritwik.
if i use above mentioned code in the wddoinit method based on the column id,it hides the column.its ok good.but i want to hide the cloumns based on one column value.so i wrote the condition in the fill service method which fills the table with data.but it is not hiding the column.
IF lt_display IS NOT INITIAL.
LOOP AT lt_display INTO ls_display.
IF ls_display-service_grp = '00010'.
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( ).
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
DATA:
l_value TYPE REF TO cl_salv_wd_config_table.
l_value = l_ref_interfacecontroller->get_model(
).
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns INTO ls_column.
IF ls_column-id = 'WARD_NO'.
ls_column-r_column->set_visible( lv_visible ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
endloop.
endif.
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.