In some scenario, SAP ERP can consume or call vendor API though SOAP Webservice protocol, per requirement provider endpoint can be different for each kind of data.
In SOAP receiver channel we can have two options for identify service endpoint and SOAP Action.
We can use fix endpoint URL and SOAP action and can use dynamic adapter specific attributes configuration.
In some scenario, we need to connect to different service provider base on incoming message data and logic.
In this article, i will show you simple way to pass service endpoint dynamically in SAP PO.
There are two company codes in SAP ERP system A and B, Data of each company code will send to two third party system with different service endpoint.
There are two ways to mapping company code data and service endpoints
- Define Custom table, abap program can filter company code and do mapping with service endpoint (URL and SOAP Action).
- Use value mapping in SAP PO and check logic from incoming message to do mapping service endpoint.
Not recommend option 2:
There are may have many condition can be apply to identify service endpoint. So, the mapping logic will more complicate to develop.
3.1-Define incoming message structure
3.2-User Define Function (UDF)
url: SOAP Service endpoint URL
action: SOAP Action
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key=DynamicConfigurationKey.create(“http://sap.com/xi/XI/System/SOAP”, “TServerLocation”); conf.put(key, url); key=DynamicConfigurationKey.create(“http://sap.com/xi/XI/System/SOAP”, “THeaderSOAPACTION”);
3.4-SOAP Receiver Channel
Set parameters into attributes:
3.5-Message Monitoring checking