Skip to Content
Technical Articles
Author's profile photo Sourav Paul

Steps to enable ODATA payload in AIF transaction /AIF/ERR

Problem Statement:

Recently I was working in a POC to integrate ODATA in AIF. We already have SAP blogs available on how to integrate ODATA in AIF. So I think there is no benefit in sharing the same again.


However during the implementation of the same, I have faced an issue and I couldn’t find any available blog or SAP answer for that. The issue was ODATA payload was not displaying in the data content area in error handling TCode /AIF/ERR. Please see the screenshot below.


Now let’s discuss on the solution for the issue. After doing some debugging, I found one implementable BADI(later on I found same BADI also has been mentioned in one of the SAP note related to ODATA AIF integration) in which SAP has given us the option to prepare the payload structure.

The BADI name is “/AIF/ODATA_FILL_RAW_STRUC_BADI” and its a filter dependent BADI. The filter fields are Namespace, Interface Name and Interface Version.

We will have to create the BADI implementation with the respective AIF interface details.

Next we will have to write logic in the BADI implementation method “/AIF/IF_ODATA_FILL_RAW_STRUC~GET_PAY_LOAD_DATA” to prepare the payload structure from the requested ODATA payload. Please find below the sample code.


Please note, if the ODATA payload is in JSON format then you will have to write the logic accordingly to fill the AIF payload structure.


Once the implementation is done, now check the payload for the same entry again. This time we can see the payload.


I hope this blog will help if you want to see the ODATA payload in the data content area.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo HARSHIT R. JAMALPUR

      Hi Sourav Paul, Thanks for this nice bog. Some reason I get error while activating BADI Implementation. But somehow by doing enhancement in our sandbox, I am able to see payload for failed OData API calls.
      Is it possible to Log successful OData messages via AIF ?. Job setup via Program /AIF/ODATA_TRANSFER_JOB, is picking logs which we see in /N/IWFND/ERROR_LOG of gateway. couldn't fine how we can log successful OData calls. Any clues would be appreciated.

      Author's profile photo Archana A
      Archana A

      Hello Experts,

      When we restart an error in AIF, it opens the payload in gw_client, after correcting the error in gateway client the odata is successful but the status of the restarted aif error is still in red with the error message. Any way where we can add success messages as well in AIF error log?

      Thanks a lot in advance for the response.


      Archana A

      Author's profile photo Camille Laroche
      Camille Laroche


      thanks for sharing.
      How can you have dynamic payload ? I mean if we have many different flows for many different areas i will have to deal with "material", "orders" etc . Here you have a static payload structure right ?


      Also can we limit the "restart" to only some fieds or do we have always all the payload ? If i click restart SAP is opening the gateway client, which is showing the entire payload, not only the field i wants . If i dont want people are able to change some fields is there a way to lock them?


      Thanks for help