Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

On Selection of value in dropdown box - Gray out I/O fields

Former Member
0 Kudos

Hi,

I have a issue. in a drop down box.

I have a drop down box with values A B C D, if i select value D the I/O fields should be disabled.

Can anyone help me in doing this..as I have no clue or with some example code ..

Thanks,

Shankar

5 REPLIES 5

sridhar_meesala
Active Contributor
0 Kudos

Hi,

There are many posts on similar topics in SDN. Please search.

Assign a function code for the drop down box. Use screen-input = 0/1 for disabling and enabling i/o field respectively.

Thanks,

Sri.

0 Kudos

Hi,

Sri

On screen input screen-input = '0' or '1', we can disable the I/O fields..

But here I want the case, where on select of particular value example "A' the fields should be grayed out but on select on other values the fields should not be disabled.

Former Member
0 Kudos

Provide a 3-char name for the screen group as MODIF ID. And based on this, you can provide screen-input = '0' inside the LOOP.

Please find the below code snippet:

SELECT-OPTIONS: s_locid1 FOR oijloc-locid NO-EXTENSION NO INTERVALS  MODIF ID loc.

TYPE-POOLS: vrm.

DATA: param_matnr  TYPE vrm_id,
      values_matnr TYPE vrm_values,
      value_matnr  LIKE LINE OF values_matnr.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.
    IF screen-group1 = 'LOC'.
      screen-input = '0'.
      MODIFY SCREEN.
    ENDIF.
    IF screen-group1 = 'DAT'.
      screen-input = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
     
param_matnr      = 'P_MATNR'.
    value_matnr-key  = g_matnr.
    value_matnr-text = l_matcode.
    APPEND value_matnr TO values_matnr.
    CLEAR  value_matnr.

* Drop Dwon List:
CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = param_matnr
      values          = values_matnr
    EXCEPTIONS
      id_illegal_name = 1
      OTHERS          = 2.

Hope this is useful.

Regards,

Sowmya

0 Kudos

Hi,

Sowmya

As far as i understand this code will help me in up in displaying the values in the drop down.

Using the FM - "vrm_set_values" we display the values in the dropdown.

But my requirement is : I have a drop down which has 4 values, A B C D . and along with this two drop downs, I have two I/O fields.

On select of Value A or Value B, the I/O fields should be disabled.

Kindly tell me how this can be done.

Thanks,

Shankar Sree

Former Member
0 Kudos

Hi,

if you selected value from drop down then that value is assigned to parameter. based on that parameter value you will be write

screen-input = 0 or 1.