Skip to Content
-2

PERFORM and capture "MESSAGE"

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • 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.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 16 at 09:47 AM
    -1

    message E always Ends the program.

    you can message I Display like E.

    or :message E into "variable"

    Write: /"variable"

    regards

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 17 at 10:37 AM
    -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

    Add comment
    10|10000 characters needed characters exceeded

  • 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.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10 at 11:22 AM
    Add comment
    10|10000 characters needed characters exceeded