Skip to Content
author's profile photo Former Member
Former Member

Select Options Read Only Fields

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 09:16 PM

    I'd like to follow up with a 2nd question regarding the select options component. By making a parameter field obligitory, the message manger is indeed displaying errors should a null value be present.

    My question is, I am having trouble understanding exactly how to control processing around this error message. Take for instance the example above. I'd like for three of the parameters to be required out of 6. Should the user not enter values, I would not continue processing (which in this case would be table selects based off the inputs). However, my traditional way of handling isn't working since the global message manager I am using does not know of the errors (I assume the instantiated component has its own instance of the message manager). I have tried using some of the helper functions and none of them seem to be working (check parameters, check selection screen).

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 11, 2009 at 08:42 AM

    Hi Robert,

    Where have you written this code and the code where you initially add the select options.

    Regards,

    Reema.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2009 at 08:56 PM

    Closing.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.