Skip to Content
Author's profile photo Former Member

Full-length message class and number information in Purchasing BAPIs return structure BAPIRETURN

Sometimes when we use BAPI that has return structure type BAPIRETURN we get incomplete message information in field BAPIRETURN-CODE

It happens if the length of message class greater than 2

For example if BAPI returns message 020 of message class MEPO then field BAPIRETURN-CODE contains value ME020

This is incorporated in standard source code

This is not convenient because we have cropped information on message

So I found the following solution for myself

Extended standard structure BAPIRETURN with APPEND-structure

consisting of two fields: message class and message number

With the help of implicit enchancement added some lines of code to standard form FILL_BAPIRETURN in program LMEWQF10

Now when I analyze return log of BAPI  I get full length information about message class and number in my custom fields

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Alejiandro Sensejl
      Alejiandro Sensejl

      Hi Vasily,

      I'm not sure if you should really recommend to add an append to structure BAPIRETURN.

      This structure is used in many BAPIs which are exposed to the outside world and can be called from external SAP systems and non-SAP applications which could break by adapting your solution. I think you cannot gauge the impact of such a change since it's not only affecting BAPIs of module MM but many more!