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

End a program normally

0 Likes
980

Hello,

I have a basic question, I am not a developper. I have an ABAP program that searches for a file in a folder. If the file does not exist, the program is interrupted. I would like to handle the job status by having a Finished status instead of an Interrupted status.

IF sy-subrc <> 0.
MESSAGE E005(ZINV) with P_FILE_N.
ELSE.
...
...

The job is always in status Interrupted if the file does not exist. How can I finish the job normally ?
If I use LEAVE PROGRAM, what whould be the status ?

Thank you for your help.

1 ACCEPTED SOLUTION
Read only

MateuszAdamus
Active Contributor
0 Likes
930

Hello admin.audioptic

The report is ended and the job has status "Interrupted" because there is an error (E) message issued. If the message is information (I) or success (S) the status would not be "Interrupted".

Kind regards,
Mateusz
2 REPLIES 2
Read only

MateuszAdamus
Active Contributor
0 Likes
931

Hello admin.audioptic

The report is ended and the job has status "Interrupted" because there is an error (E) message issued. If the message is information (I) or success (S) the status would not be "Interrupted".

Kind regards,
Mateusz
Read only

0 Likes
930

Hi Mateusz, thank you for this quick reply. Didn't even remark that the E before 005 was for the message type. And I thought that if I changed the message type, the program would have continued but there are no instructions defined in the program if the file does not exist, which makes sense. I will try to change the E by and let you know, thanks again. Still a lot to learn in ABAP programming 🙂