Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
4,018

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.


Solution:


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.

Testing:


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



Conclusion:


I hope this blog will help if you want to see the ODATA payload in the data content area.
3 Comments
Jamalpur
Explorer
0 Kudos
Hi souravpaul.1994, 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.
archana_a2
Participant
0 Kudos
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.

Regards,

Archana A
0 Kudos
Hello

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
Labels in this area