Skip to Content
-2

PERFORM and capture "MESSAGE"

Apr 10 at 08:40 AM

55

avatar image

Hi there,

Is there a way to capture an error message or at least make it not break the program flow ?

BDC solution is not an option.


Scenario:

REPORT ZPROG_1.
FORM test.
  message e001(00).
ENDFORM.

REPORT ZPROG_2.
  PERFORM test(ZPROG_1).
  WRITE: / 'I would like to continue here'.

Cheers,

Bart

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Matthew Billingham
Apr 10 at 11:24 AM
-1

Best solution: refactor the external program so that the application logic can be run directly. I.e. put the application logic into a class.

Not the best solution: Encapsulate the external program call in an RFC enabled function module. Then use

CALL FUNCTION... STARTING NEW TASK... CALLING method ON END OF TASK.

Share
10 |10000 characters needed characters left characters exceeded
Stefan Seeburger 3 days ago
-1

message E always Ends the program.

you can message I Display like E.

or :message E into "variable"

Write: /"variable"

regards

Share
10 |10000 characters needed characters left characters exceeded
Himanshu Gupta
2 days ago
-1

Message type E will always break the current processing .

You can come up with either solutions

1) change type to 'S' or 'I' and display like 'E' if you want to show it.

2) if you want to capture you can use "Message with Into " clause.

Regards

himanshu

Share
10 |10000 characters needed characters left characters exceeded
Salah ZINET Apr 10 at 09:35 AM
-2

Hi Bart,

You can use the a TRY CATCH block to solve this problem, the links bellow can help you:

https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abaptry.htm

Best regards,

Salah.

Share
10 |10000 characters needed characters left characters exceeded
Horst Keller
Apr 10 at 11:22 AM
0
Share
10 |10000 characters needed characters left characters exceeded