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: 

PERFORM and capture "MESSAGE"

0 Kudos

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

5 REPLIES 5

salah_zinet
Participant
0 Kudos

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.

matt
Active Contributor
0 Kudos

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.

former_member220028
Active Contributor
0 Kudos

message E always Ends the program.

you can message I Display like E.

or :message E into "variable"

Write: /"variable"

regards

former_member564522
Active Participant
0 Kudos

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