Application Development 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: 

messages

Former Member
0 Kudos

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

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

Or you can use Statement as well.

STOP.

-Aman

4 REPLIES 4

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

Or you can use Statement as well.

STOP.

-Aman

Mohamed_Mukhtar
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

at selection-screen.

if <condition>.

message e999(zclass).

endif.