This blog tackles a small hurdle that you might come across when your aim is to integrate an SAP system with Salesforce (SFDC) using SAP PI/PO as a middleware.
I was tasked to develop an S/4 to SFDC integration on PO using the SFDC REST API. That API is strongly making use of the http PATCH operation. This short blog explains two ways to achieve this.
In case you’re on an older PO version before 7.50 SP09, the REST adapter doesn’t support this HTTP operation:
The Integration Directory (IB or NWDS) GUI doesn’t list the PATCH request as an option.
There are two solutions to this:
- Since SP09 of PO 7.50, it is possible to issue PATCH calls in a REST receiver channel by setting an adapter module parameter (of module sap.com/com.sap.aii.adapter.rest.app/RESTAdapterBean). Unfortunately, the method was not added to the GUI, as shown above. Nevertheless, you can configure the following module parameter to enable the PATCH method in the REST receiver adapter (excerpt from SAP note 2498897 (S-user log-in required)):
Parameter Name: overrideHttpMethod
Parameter Value: PATCH
By doing this, you switch the http client library from SAP’s native to the one form Apache.
- Now there is another and easier option you can use in case your system is not yet on the required SP level or you maybe face other issues with the Apache library. The trick is pertaining to Salesforce (and obviously can’t be used with other receivers than that). It is applied by simply adding the parameter ?_HttpMethod=PATCH to the target URL, and selecting POST as the HTTP operation in the channel.Quoting from the SFDC docs:
If you use an HTTP library that doesn’t allow overriding or setting an arbitrary HTTP method name, you can send a POST request and provide an override to the HTTP method via the query string parameter _HttpMethod.
Although No. 2 is a proprietary feature of a third party vendor and SAP offers a way on patched PI/PO systems to achieve the same with their own means, it might still help the developers which are facing the above mentioned restrictions, or would like to avoid setting the adapter module parameter.
If you have questions or remarks, let me know in the comments.