‎2007 Aug 10 3:56 PM
Hi,
This is sandeep....
while i am doing validation on selection-screen,in that i am not able to get the exact output...
The selection-screen like this...
selection-screen begin of block b1 with frame title text-001.
SELECT-OPTIONS:S_KUNNR FOR KNA1-KUNNR,
S_BUKRS FOR BSID-BUKRS,
S_BUDAT FOR BSID-BUDAT.
PARAMETERS:OPEN AS CHECKBOX,
CLEARED AS CHECKBOX.
selection-screen end of block b1.
the requirement is without checking the <b>"CLEARED"</b> checkbox,we not allow the user to fill the closeing date <b>"S_BUDAT"</b>...in that time we need to get the error message as <u>'Without CLEARED choosing you not allow to fill this field'</u>.....
Please help me on this issue......
Thanking You..!
With Regards,
Sandeep.
‎2007 Aug 10 4:03 PM
Hi Sandeep,
You can not fullfill your requirement using check box as selection of checkbox will not trigger any AT SELECTION.. event. So user may need to press ENTER key then only AT SELECTION SCREEN OUTPUT will be called and you can write your logic there. So better redesign the selection screen.
Regards,
Atish
‎2007 Aug 10 4:26 PM
Atish,
Not quite correct as linking USER-COMMAND to a checkbox will trigger the AT SELECTION SCREEN OUTPUT.
Surbjeet
‎2007 Aug 10 4:12 PM
tables: sscrfields.
at selection-screen.
if ( sscrfields-ucomm = 'ONLI' or
sscrfields-ucomm = 'SJOB' or
sscrfields-ucomm = 'PRIN' ) and
s_budat[] is not initial and
cleared is initial.
-
error message
endif.
‎2007 Aug 10 4:24 PM
Hi Sandeep,
Try the following code it should help you. It ensures that the budat field can only be input when the cleared flag is ticked:
SELECT-OPTIONS:s_kunnr FOR kna1-kunnr,
s_bukrs FOR bsid-bukrs,
s_budat FOR bsid-budat MODIF ID id1.
PARAMETERS: open AS CHECKBOX,
cleared AS CHECKBOX USER-COMMAND cm1.
AT SELECTION-SCREEN OUTPUT.
IF cleared IS INITIAL.
CLEAR: s_budat[].
LOOP AT SCREEN.
IF screen-group1 = 'ID1'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Let me know if it helps.
Surbjeet
‎2007 Aug 10 4:24 PM
Hi,
You can do it by Intialization event make the S_BUDAT in display move
Initialization.
LOOP AT SCREEN.
IF screen-name = 'S_BUDAT'.
screen-input = 1. "<< disable
ENDIF.
MODIFY SCREEN.
ENDLOOP.
PARAMETERS:OPEN AS CHECKBOX,
CLEARED AS CHECKBOX USER-COMMAND cmd.
then after the user click on check box CLEARED then open the S_BUDAT for input
AT SELECTION-SCREEN OUTPUT.
"" if sy-ucomm is CMD
CASE CMD.
WHEN ' '.
LOOP AT SCREEN.
IF screen-name = 'S_BUDAT'.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDCASE.
Please check the syntax of of the above command
aRs