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: 

Parameters Obligatory

Former Member
0 Kudos
9,279

Hi experts,

I have defined 3 parameters on my selection screen one of this one like checkbox

when populate this checkbox, trhe other 2 parameters must stop being obligatory someone can indicate me if it is possible to realize this?

regards.

4 REPLIES 4

Sm1tje
Active Contributor
1,011

When you want to do so, make these fields not mandatory in the coding at first, so do NOT use

parameters: p_one type c OBLIGATORY.

At selection screen, event check if checkbox is initial or not. IF initial, create error message, saying that input fields should be filled first.

If checkbox is not initial, don't raise error message.

Former Member
0 Kudos
1,011

u can do this with..

At selection screen output.

If p_check = 'X'.

"" here u validate the other parameters if are initial put a message error

endif.

Former Member
0 Kudos
1,011

hi check this but this is not the exact case but u can do like this...but i think u cannot do this with the obligatory statement ..

parameters:p_c as checkbox,

p_test1 type i,

p_test2 type i.

AT SELECTION-SCREEN OUTPUT .

loop at screen.

if p_c = 'X'.

if screen-name = 'P_C'.

if p_test1 = ' ' and p_test2 = ' ' .

message E000 with 'the two parameters must be obligatory'.

endif.

endif.

endif.

endloop.

regards,

venkat

Former Member
0 Kudos
1,011

Hi Rodolfo,

Create a logic that if the checkbox is ticked, then paramtext1 should not be initial and paramtext2 should not be initial.

if checkbox is initial.

if paramtext1 = space.

message e001 'Parameter 1 in blank!'.

exit.

endif.

if paramtext2 = space.

message e002 'Parameter 2 in blank!'.

exit.

endif.

endif.

Hope this helps.

Benedict