Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
diogo_awaihara
Explorer

Objective

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):

  1. request: fixed value
  2. directory: fixed value
  3. filename: value will be dynamically configured using IDOC number

HTTP_AAE Communication Channel

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”:

  1. Parameter 1 (URLParamOne): request
  2. Parameter 2 (URLParamTwo): directory
  3. Parameter 3 (URLParamThree): filename

DynamicConfiguration

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.

12 Comments
Labels in this area