Skip to Content
0
Former Member
Aug 10, 2009 at 05:08 PM

Select Options Read Only Fields

200 Views

Hi, currently I am using the SAP provided select options component and while I am able to set a particular field to read only easily enough at creation, it seems that I am unable to do during run time. I have the code below which is envoked by the clicking of a tab in the tab strip control. My goal is that when they select the PG tab, field EKGRP should be read only; in all other cases it is not. However, despite the fact that the correct nodes are being reached programatically, the actual read only status of the field is not changing. Any help is appreciated.

DATA lo_nd_ui TYPE REF TO if_wd_context_node.

DATA lo_nd_tabs_update TYPE REF TO if_wd_context_node.

DATA lo_el_tabs_update TYPE REF TO if_wd_context_element.

DATA lv_selected_tab TYPE string.

lo_nd_ui = wd_context->get_child_node( name = wd_this->wdctx_ui ).

lo_nd_tabs_update = lo_nd_ui->get_child_node( name = wd_this->wdctx_tabs_update ).

lo_el_tabs_update = lo_nd_tabs_update->get_element( ).

" get the selected tab

lo_el_tabs_update->get_attribute(

EXPORTING name = `SELECTED_TAB`

IMPORTING value = lv_selected_tab ).

CASE lv_selected_tab.

WHEN 'TAB_PG'.

wd_this->gr_sel_helpr->upd_selection_field( i_id = 'EKGRP' i_read_only = abap_true ).

WHEN 'TAB_GR'.

wd_this->gr_sel_helpr->upd_selection_field( i_id = 'EKGRP' i_read_only = abap_false ).

WHEN 'TAB_UP'.

wd_this->gr_sel_helpr->upd_selection_field( i_id = 'EKGRP' i_read_only = abap_false ).

WHEN 'TAB_GG'.

wd_this->gr_sel_helpr->upd_selection_field( i_id = 'EKGRP' i_read_only = abap_false ).

ENDCASE.