on 07-10-2011 1:49 PM
Hi Gyus,
I'm struggling with a WD problem. I want to dynamically disable/enable columns of a table but I'm not sure how to do this.
I have a view which contains a UI table object and a DDic control table to indicate which columns should be displayed in my view.
The UI table structure looks as follows:
TABLE (TABLE)
- TC_1 (TableColumn
- TE_1 (TextView)
- TH_1 (Caption)
- TC_2
- TE_2
- TH_2
- TC_3
- TE_3
- TH_3
- TC_4
- TE_4
- TH_4
Let's say, I want to disable column TC_2. What would be the correct coding in method WDDOMODIFYVIEW to do this?
Any hint would be helpful. Thanks.
Thomas
Hi thomas,
try to get the UI element and disable the required clolumn ,
if the coloumn TC_2 is input field below method will work
DATA LO_COL TYPE REF TO cl_wd_input_field.
lo_col ?= view->get_element('TC_2').
CALL METHOD LO_COL->SET_ENABLED
EXPORTING
VALUE = ''
.
Bhargava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi thomos,
when you want disable your column?
Create one attribute of type WDY_BOOLEAN and bind this table column of Readonly property.
Set this value using set_attribute whenever you want to disable the cell by passing ABAP_FALSE.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are talking about ALV table then below is the method..
Create component usage for alv component
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( ).
ENDIF.
Get config model
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( ).
DATA: lr_column TYPE REF TO cl_salv_wd_column.
lr_column = l_value->if_salv_wd_column_settings~get_column( 'column attribute name in capital letter'' ).
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column_settings ?= l_value.
lr_column_settings ->set_read_only( abap_true ).
Regards
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI thomas,
Sorry initially i din't observe your query. your table is normal table, i can say by reading your table properties.
FYI if it is alv table , in output you will find "export to excel " button in table status bar.
So follow the kris solution, and I think you are very new to webdynpro.
Regards
Srinivas
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.