05-26-2008 4:51 PM
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.
05-26-2008 4:55 PM
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.
05-26-2008 5:29 PM
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.
05-26-2008 5:55 PM
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
05-26-2008 6:01 PM
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