‎2009 Dec 31 5:02 AM
Hi experts,
I have a below given piece of code:
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS: s1 RADIOBUTTON GROUP rad2 DEFAULT 'X' USER-COMMAND ucom,
s2 RADIOBUTTON GROUP rad2 .
SELECTION-SCREEN: END OF BLOCK b4.
SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
PARAMETERS: p_path LIKE rlgrap-filename.
SELECTION-SCREEN: END OF BLOCK b5.
AT SELECTION-SCREEN OUTPUT.
IF s1 IS NOT INITIAL.
LOOP AT SCREEN.
IF screen-name = 'P_PATH'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
In the above code, if the user selects the S2 radio button, only then the p_path text box gets enabled, otherwise not.
Now I have a req. in which once the user selects S2 and the p_path is enabled, if the user presses F8 without entering any value in p_path, there should be a proper message thrown to input the value in p_path.
How can I achieve this functionality?
Thanks,
Ajay.
‎2009 Dec 31 5:12 AM
Hi Ajay ,
Try the code
at SELECTION-SCREEN.
BREAK-POINT.
if s2 = 'X' and p_path is INITIAL and sy-ucomm = 'ONLI'.
MESSAGE ID 'message if' TYPE 'E'
NUMBER '242'.
endif.
SY-UCOMM = ONLI , when F8 is pressed.
Hope this helps.
Regadrs
Arun
‎2009 Dec 31 5:08 AM
‎2009 Dec 31 5:12 AM
Hi Ajay ,
Try the code
at SELECTION-SCREEN.
BREAK-POINT.
if s2 = 'X' and p_path is INITIAL and sy-ucomm = 'ONLI'.
MESSAGE ID 'message if' TYPE 'E'
NUMBER '242'.
endif.
SY-UCOMM = ONLI , when F8 is pressed.
Hope this helps.
Regadrs
Arun
‎2009 Dec 31 5:30 AM
Hi,
Check this code.
IF S2 = CNS_X AND S_ISSUE IS INITIAL.
SET CURSOR FIELD 'S_ISSUE-LOW'.
MESSAGE E001(ZGSD001) WITH TEXT-017.
ENDIF.
Hope it helps.
Regards,
Raj
‎2009 Dec 31 5:27 AM
Hi Ajay,
You need to write code in "START-OF-SELECTION" EVENT for your requirement.
There you need to check whether the S2 radio-button is selected and P_path is empty and then you should give
Information Message and then "LEAVE LIST-PROCESSING".
This will resolve the issue.
Please check the below code.
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS: s1 RADIOBUTTON GROUP rad2 DEFAULT 'X' USER-COMMAND ucom,
s2 RADIOBUTTON GROUP rad2 .
SELECTION-SCREEN: END OF BLOCK b4.
SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
PARAMETERS: p_path LIKE rlgrap-filename.
SELECTION-SCREEN: END OF BLOCK b5.
AT SELECTION-SCREEN OUTPUT.
IF s1 IS NOT INITIAL.
LOOP AT SCREEN.
IF screen-name = 'P_PATH'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
IF s2 IS NOT INITIAL AND p_path IS INITIAL.
MESSAGE 'Enter value for path' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.
WRITE 123.Regards
Pinaki
‎2009 Dec 31 5:40 AM
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS: s1 RADIOBUTTON GROUP rad2 DEFAULT 'X' USER-COMMAND ucom,
s2 RADIOBUTTON GROUP rad2 .
SELECTION-SCREEN: END OF BLOCK b4.
SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
PARAMETERS: p_path LIKE rlgrap-filename.
SELECTION-SCREEN: END OF BLOCK b5.
AT SELECTION-SCREEN OUTPUT.
IF s1 IS NOT INITIAL.
LOOP AT SCREEN.
IF screen-name = 'P_PATH'.
screen-input = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
START-OF-SELECTION.
IF s2 IS NOT INITIAL AND p_path IS INITIAL.
MESSAGE 'Enter p_path' TYPE 'E'.
ENDIF.
‎2009 Dec 31 5:43 AM
You can try to use the component "REQUIRED" of the table "SCREEN". this component makes the field mandatory.
http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbab6f35c111d1829f0000e829fbfe/content.htm
Chk the site for information about the table "SCREEN"
‎2009 Dec 31 5:51 AM
chk the following code:
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS: S1 RADIOBUTTON GROUP RAD2 USER-COMMAND FCODE,
S2 RADIOBUTTON GROUP RAD2.
SELECTION-SCREEN: end OF BLOCK b4.
SELECTION-SCREEN: BEGIN OF BLOCK b5 WITH FRAME TITLE text-005.
PARAMETERS: p_path LIKE RLGRAP-FILENAME modif id MOD.
SELECTION-SCREEN: END OF BLOCK b5.
AT SELECTION-SCREEN OUTPUT.
IF S2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'MOD'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
at selection-screen on p_path.
if p_path is initial.
message 'Enter value' type 'S'.
endif.
Regards