Skip to Content

Problem with selection screen in disabling mandatory fields

Hello experts,

I have a requirement as below,

I should have two radiobuttons let it be r1 and r2, and i have two fields say f1 and f2, of which f1 is mandatory.

Now when i click r1 both the fields both the fields f1 and f2 must be disabled which i was able to acheive.

Now when i click r2 these fields f1 and f2 must be enabled, this also i acheived.

Now when again i click r1 these fields are not getting disabled and throwing an error message for filling mandatory fields, now if i fill the mandatory field and press enter the fields are getting disabled also if i fill the mandatory field and then press r1 these two fields are getting disabled.

Now when i press r1 again Can i make these two fileds disabled without filling the mandatory field.

Please help me in sorting out this issue 😊

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Dec 31, 2013 at 05:14 AM

    Hi -

    Use the event - AT SELECTION-SCREEN OUTPUT event to perform this.

    Let us know, in case any further help.

    Regards,

    Atul Mohanty

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2013 at 06:02 AM

    Hi,

    You can try this.

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    PARAMETERS : p_y RADIOBUTTON GROUP rg USER-COMMAND s DEFAULT 'X',

    p_m RADIOBUTTON GROUP rg.

    PARAMETERS: p_one TYPE Numc04 OBLIGATORY MODIF ID one,

    p_two TYPE Numc04 OBLIGATORY MODIF ID two.

    SELECTION-SCREEN END OF BLOCK b1.

    AT SELECTION-SCREEN OUTPUT.

    IF p_y = 'X'. "Suppressing The Month and Year Field

    LOOP AT SCREEN.

    IF screen-group1 = 'ONE'.

    screen-input = '0'.

    ELSEIF screen-group1 = 'TWO'.

    screen-input = '0'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ELSEIF p_m = 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'ONE'.

    screen-Input = '1'.

    ELSEIF screen-group1 = 'TWO'.

    screen-input = '1'.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    ENDIF.

    AT SELECTION-SCREEN.

    IF p_m EQ 'X'.

    p_one = '1000'.

    p_two = '2000'.

    ENDIF.

    IF p_y EQ 'X'.

    p_one = ' '.

    p_two = ' '.

    ENDIF.


    Or you can use initialization event to avoid the error message.

    Or paste your code.

    Regards.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 31, 2013 at 05:13 AM

    Hi Kumar,

    Remove the Mandatory statement in your code(Obligatory).

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 31, 2013 at 05:22 AM

    Dear Satish,

    Just move the obligatory statement from your selection screen deceleration part. The place where you have written code (Must be in event AT Selection Screen Output) to make the field disable just put:

    if screen-name eq 'F1'.

    Screen-require = 1.

    endif.

    Thanks,

    Prakash

    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.