‎2010 Jul 05 4:19 AM
hi all,
i have 2 parameters here,
param 1
param 2
in my scenario, when param 2 is choosen, i have to set few fields to mandatory, the problem now is when these
2 are choosen, the mandatory fields remains, the case should be when these two are choosen the fields will be cleared
from anything.
do you have any idea?
thanks AUD
‎2010 Jul 05 4:58 AM
Hello Aud,
Unfortunately this is how SAP is designed. Once the mandatory attribute of a field is turned on, you can't turn it off
But there are alternatives which you can employ to resolve this situation:
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI' OR 'PRIN'. "ONLI --> Online Run, 'PRIN' --> BG mode
IF PARAM2 = <some value>.
"Check the fields are not INITIAL. If INITIAL, give error message
ENDIF.
ENDIF.BR,
Suhas
PS: Do not turn the MANDATORY attribute for the field
‎2010 Jul 05 4:58 AM
Hello Aud,
Unfortunately this is how SAP is designed. Once the mandatory attribute of a field is turned on, you can't turn it off
But there are alternatives which you can employ to resolve this situation:
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI' OR 'PRIN'. "ONLI --> Online Run, 'PRIN' --> BG mode
IF PARAM2 = <some value>.
"Check the fields are not INITIAL. If INITIAL, give error message
ENDIF.
ENDIF.BR,
Suhas
PS: Do not turn the MANDATORY attribute for the field
‎2010 Jul 05 1:19 PM
Hi,
You can set the fields as mandatory in at selection screen output by using modify screen concept.
You can check if the fields is selected param 2 in your case and then for the field you want to set as mandatory pass these
fields to the screen-name parameter of the screen structue
Let say you have to make param 3 as mandtory if param2 is selected.
At selection-screen output.
if param 2 = 'X' .
loop at screen.
if screen-name = 'param 3'.
screen-required = 1.
modify screen.
endif.
endloop.
endif.
Thanks.
‎2010 Jul 05 2:36 PM
Hi Aud,
I think you want either Param1 or Param2 should be selected but not both.
So you can use Radio Button option.
At selection-screen depending on Param1 or param2 you can clear the unneccessary fields.
Hope this helps.
Regards
Sajid