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 skip required check on mandatory field of selection screen

Former Member
0 Kudos

Hi expert,

In my report, I define two rodiobutton to show block1 or block2, but every time I click each radiobutton, the message "Fill in all required entry" shown, so my question is how can I skip required check when click radiabutton?

Some of my selection-screen code is :

PARAMETER: P_block1 RADIOBUTTON GROUP GRP1 DEFAULT 'X' USER-COMMAND UC1.

PARAMETER: P_block2 RADIOBUTTON GROUP GRP1.

SELECT-OPTIONS S_ERDAT FOR VBRK-ERDAT OBLIGATORY.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You can't. You will have to remove the OBLIGATORY key word and code the check yourself in AT SELECTION-SCREEN.

3 REPLIES 3

Former Member
0 Kudos

You can't. You will have to remove the OBLIGATORY key word and code the check yourself in AT SELECTION-SCREEN.

Former Member
0 Kudos

Try as below:

PARAMETER: p_block1 RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND uc1.
PARAMETER: p_block2 RADIOBUTTON GROUP grp1.
SELECT-OPTIONS s_erdat FOR vbrk-erdat. " OBLIGATORY.

AT SELECTION-SCREEN.

  IF s_erdat[] IS INITIAL AND NOT sy-ucomm = 'UC1'..
    MESSAGE e001(00) WITH 'Fill in Creation Date'.
  ENDIF.

Former Member
0 Kudos

Hi,

If you dont want PAI to be triggered when you select the radio button, then you can remove the USER-COMMAND while declaring parameter.

If User Command is necessary, use following code

PARAMETER: P_block1 RADIOBUTTON GROUP GRP1 DEFAULT 'X' USER-COMMAND UC1.

PARAMETER: P_block2 RADIOBUTTON GROUP GRP1.

SELECT-OPTIONS S_ERDAT FOR VBRK-ERDAT .

AT SELECTION-SCREEN.

CHECK SY-UCOMM NE 'UC1'.

IF S_ERDAT IS INITIAL.

MESSAGE E038(001) WITH 'ERDAT IS MANDATORY'.

ENDIF.

*********************

Please Reward points.