Skip to Content
avatar image
Former Member

return to the selection screen after error message.

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Oct 29, 2009 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 29, 2009 at 07: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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 29, 2009 at 08:33 AM

    use

    
      MESSAGE 'ur MEssage' ' TYPE 'S' DISPLAY LIKE 'E'.
      STOP.
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 29, 2009 at 07:10 AM

    Hi,

    Try using 'LEAVE LIST-PROCESSING.' within the IF .. ENDIF block.

    Regards,

    Akshata Shetty

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 29, 2009 at 08: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 29, 2009 at 08:37 AM

    Thank you so much friends

    Add comment
    10|10000 characters needed characters exceeded