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: 

How to change the required field to un required field in selection screen

Former Member
0 Kudos

Hi all,

In my selection Screen, i have one mandatory field and the check box. After selecting the check box i have to make it the mandatory field to un-required field.

I have tried by using the SCREEN table with modify screen option,but i am not getting the result,plz any one can provide the sample code/example.

Thanks in advance,

selvapandian

2 REPLIES 2

Former Member
0 Kudos

Hi,

Dont make your field OBLIGATORY, Just do a validation.

If CHECK is selected and Field is blank , Display message asking for an entry.

Vice-Versa.

Rgds,

Manohar

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Using the "required" field of the screen doesn't work very well in my opinion, maybe you can use the input field instead. The "required" option does all of the handling on the frontend. Here is some code that will show you how to do this with the "input" field.



report zrich_0001 .

parameters: p_field1 type char10 default 'abc',
            p_check1 as checkbox user-command check.

at selection-screen output.

  loop at screen.
    if screen-name = 'P_FIELD1'.
      if p_check1 = 'X'.
        screen-input = '1'.
        modify screen.
        continue.
      endif.
    endif.
  endloop.

Regards,

Rich Heilman