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: 

Selection Options with multiple Blocks + Obligatory fileds?

Former Member
0 Kudos

Hi Guys,

I declared 4 blocks in which 1 st block has 3 radio Button based on these 3 Radio Buttons i had activated the rest of Blocks.In blocks 2 , 3 and 4 i have some fileds,i made mandatory for some of the fields in Blocks 2 , 3 and 4.

By default 1st Radio Button is selected so that the Block 2 will be activated.

Now the problem is when i select the 2nd radio button i am getting problem why means i made some fields are Obligatory in 2nd block so while selecting the 2nd radio button the 3rd block is not getting activated beacuse i am getting an error please fill the Mandatory fileds. so how to overcome this problem? or can we decide fields Obligatory Dynamically?

Thanks,

Gopi.

6 REPLIES 6

Former Member
0 Kudos

Hi,

Declare all field as optional and handle the case in AT SELECTION SCREEN event.

Based upon the radio button selected, check for the associated block and in that block if the value is not entered, display error message to enter the value.

AT SELECTION-SCREEN.

  • Suppose 2nd radio button is selected, it will activate 3rd box which contain select option for PO

IF RB_SECOND = 'X' AND S_EBELN[] IS INITIAL.

MESSAGE E000 WITH 'Please enter Purchase Order No'.

ENDIF.

Hope this helps.

ashish

0 Kudos

Hi Ashish,

I know we can do like this but other than this is there any other way?

0 Kudos

Instead of Doing a Mandatory Check based on the RADIO button and the Values of the Field, Do the Check when the Sy-ucomm is 'ONLI'.... i.e. only when the User has pressed the execute button... then the check for Mandatory on the required fields based on the selected radio button should be done.

Regards,

Abhishek

0 Kudos

Gopi,

I am not aware of any other way. When you declare a field as mandatory in selection screen, first it checks for the value and then it proceeds to validations so i feel this is the best way to handle the case.

ashish

Former Member
0 Kudos

I think you have to make the fields obligatory dynamically.

That is At-selection screen event you have to write the logic.

Thanks,

Srinivas

0 Kudos

Hi Srinivas,

Can u please write logic how to make the fields Dynamically Mandatory?

Thanks,

Gopi.