10-29-2009 7:02 AM
hello friends,
I have selection screen report using screen (Call screen 2001)
In Start-of-selection
i have used 1 perform and 1 more in the first perform. And checking condition in the second perform.
My requirement is if condition is not satisfied, disply error message and return to the selection screen.
e.g.
Start-of-selection.
PERFORM process1.
FORM process1.
------
------
PERFORM process2
ENDFORM.
FORM process2.
------
------
IF sy-subrc <> 0.
Display error and return to the selection screen.
ENDIF.
ENDFORM.
Can we do that?
Regards,
RH
10-29-2009 7:10 AM
Hi,
Try like this,
Start-of-selection.
PERFORM process1.
FORM process1.
------
------
PERFORM process2
ENDFORM.
FORM process2.
------
------
IF sy-subrc 0.
message 'Error message' TYPE 'S' DISPLAY LIKE 'E'.
EXIT.
ENDIF.
ENDFORM.
Vikranth
10-29-2009 7:10 AM
Hi,
Try using 'LEAVE LIST-PROCESSING.' within the IF .. ENDIF block.
Regards,
Akshata Shetty
10-29-2009 7:18 AM
10-29-2009 7:10 AM
Hi,
Try like this,
Start-of-selection.
PERFORM process1.
FORM process1.
------
------
PERFORM process2
ENDFORM.
FORM process2.
------
------
IF sy-subrc 0.
message 'Error message' TYPE 'S' DISPLAY LIKE 'E'.
EXIT.
ENDIF.
ENDFORM.
Vikranth
09-12-2019 4:42 PM
Thanks. Solved my problem almost after a decade you posted the solution.
10-29-2009 7:35 AM
do like below:
Start-of-selection.
PERFORM process1.
FORM process1.
-
-
PERFORM process2
check v_flg NE 'X'.ENDFORM.
FORM process2.
-
-
IF sy-subrc 0.
v_flg = 'X'.
* message s001(00) with 'error message'.*
STOP. ENDIF.
ENDFORM.
10-29-2009 8:22 AM
Hi
Try the below code.
Start-of-selection.
PERFORM process1.
FORM process1.
------
------
PERFORM process2
ENDFORM.
FORM process2.
------
------
IF sy-subrc 0.
message 'ERROR' type 'E'.
call screen 2001 *** the selection screen number.
ENDIF.
ENDFORM.
Thanks,
Harini
10-29-2009 8:37 AM
10-29-2009 8:33 AM
09-13-2019 5:27 AM
Hello,
You can try below methods!
First method:
write you validation logic in At Selection screen event, and use leave list processing after displaying the error message.
Second method:
Once your error condition is satisfied, Try displaying your error message in the form of Type 'I'. Post that Try calling the same selection screen using Call transaction method.
This Should Satisfy Your requirement but one thing you would miss here is you will lose all the Data which was entered in the selection screen earlier.
Note: Am not sure if you have designed a selection screen (2001), i hope this should be the screen which is called after your selection screen validations. If this is the case then First method should definitely work. Try to keep all your validations in At Selection screen Event. Key point to remember here is your selection screen Number is different from screen 2001.
In case you have designed your selection screen itself then go for second method.
Cheers!!!
Satish