cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to determine if a BAPI execution is successful or not?

hemanth_shetty
Product and Topic Expert
Product and Topic Expert
0 Kudos
459

Hi everyone,

I'm new to BAPIs and trying to understand the best way to determine whether a BAPI execution was successful. I have a few questions regarding this:

  1. Is the RETURN array the correct field to always check for execution status? If so, are there any standard rules for interpreting it? For example:

    • If any entry in the RETURN array has TYPE = 'E', consider it a failure.
    • If all entries have TYPE = 'S', consider it a success.
    • How should we interpret other types like W (Warning) or I (Information)?
    • What should be considered when the RETURN array is completely empty? Does an empty RETURN array always indicate success?
  2. Is there a better or more reliable way to determine the execution status of a BAPI?

Any insights or best practices would be greatly appreciated!

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

RaymondGiuseppi
Active Contributor

Basically

  • If RETURN contains an error message of type 'E' or an abort message of type 'A', then the BAPI execution has failed, aborted (time for BAPI_TRANSACTION_ROLLBACK).
  • Otherwise, the BAPI was able to process something, but some 'W' or even 'S' and 'I' messages may contain information such as 'field xxx was not changed', but this depends on the BAPI. (time for BAPI_TRANSACTION_COMMIT and read BAPI documentation)

Your application could store the contents of RETURN in an application log to be viewed and analysed later with SLG1.