First, relying on sy-subrc as an error indicator is incorrect for BAPI calls, sy-subrc can change its value irrelevantly to the BAPI error status. You have to analyze RETURN table (or single value) parameter for that purpose. I also recommend to use class based exceptions. The code sample...