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.

1-Business Scenario
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.
2-Integration design
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-Integration Implementation
3.1-Define incoming message structure

3.2-User Define Function (UDF)
Parameters:
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”);
conf.put(key, action);
return “”;

3.3-Message Mapping

3.4-SOAP Receiver Channel

Set parameters into attributes:
TServerLocation
THeaderSOAPACTION


3.5-Message Monitoring checking

Thanks,
Cuong Dang