An interface should be created to send an IDOC to a legacy system using HTTP, post request method with three key fields (in this order):
To accomplish that we need to create a Receiver HTTP_AAE Communication Channel, setting Message Protocol = POST and all the Destination and Security information.
After that, in “Advanced” tab, scrolling down, in the Adapter-Specific Message Properties, we mark “Set Adapter-Specific Message Properties” and “URL Parameters”:
To dynamically set all three parameters, I use Message Mapping and UDF, but it is possible to use the same code for Java Mapping as well.
The UDF should have three input parameters that will be used to dynamically set HTTP_AAE parameters values:
public String setDynamicURLParameters(String request, String directory, String filename, Container container) throws StreamTransformationException{
//Get the dynamic configuration from the container
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//Create the URLParamOne key in namespace http://sap.com/xi/XI/System. This key will hold the dynamically created request parameter
DynamicConfigurationKey keyParam1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System", "URLParamOne");
//Create the URLParamTwo key in namespace http://sap.com/xi/XI/System. This key will hold the dynamically created directory parameter
DynamicConfigurationKey keyParam2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System", "URLParamTwo");
//Create the URLParamThree key in namespace http://sap.com/xi/XI/System. This key will hold the dynamically created filename parameter
DynamicConfigurationKey keyParam3 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System", "URLParamThree");
//Put the parameters values from the input in the configuration under the specified key
conf.put(keyParam1, request);
conf.put(keyParam2, directory);
conf.put(keyParam3, filename);
return filename;
}
To use the UDF, we create a Variable by right clicking the root element and choosing “Add Variable”:
Finally, for this Variable mapping we create two Constants to set the first two Parameters that will have fixed values and push DOCNUM of IDOC structure from source message to use as the third parameter, filename.
We can check in SXI_MONITOR the parameters set in DynamicConfiguration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |