Steps to enable ODATA payload in AIF transaction /AIF/ERR
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.
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.
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.