Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

messages

Former Member
0 Likes
647

hi experts

i want to use an error message if an error has occured and that after a the message the report will stop and will return to the selection screen.

how can i do that.

thanks

amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
615
MESSAGE E001(00) WITH 'This is an error'.

Or you can use Statement as well.

STOP.

-Aman

hi experts

i want to use an error message if an error has occured and that after a the message the report will stop and will return to the selection screen.

how can i do that.

thanks

amit

4 REPLIES 4
Read only

Former Member
0 Likes
616
MESSAGE E001(00) WITH 'This is an error'.

Or you can use Statement as well.

STOP.

-Aman

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
615

Hi

for example

PARAMETERS : p_upload TYPE rlgrap-filename.

AT SELECTION-SCREEN.
 IF  p_upload IS INITIAL .
    MESSAGE text-018 TYPE 'E'.
    LEAVE TO SCREEN 1000.  " you can use leave to list-processing here as well
  ENDIF.

Regards

Read only

Former Member
0 Likes
615

Hi,

You can do something like this :


"Select data from tables etc..
  IF NOT SY-SUBRC IS INITIAL.
    MESSAGE Snnn.   " Give a success message here
" Check if the program was called from 
     IF NOT SY-CALLD IS INITIAL.
       LEAVE.
    ELSE.
       LEAVE TO TRANSACTION SY-TCODE.
  ENDIF.

The only problem here is that you will have to assign a transaction code for your program.

Hope this helps.

regards,

Advait

Read only

Former Member
0 Likes
615

at selection-screen.

if <condition>.

message e999(zclass).

endif.