Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
With XI 3.0 SP14, some paramters in the Integration Directory's Communication Channel can be dynamically determined during runtime.  A couple of examples are the filename and directory used by the File Receiver Adapter.  The values for filename and directory can be obtained from the payload of the XML message.


Now, with XI 3.0 SP16, these values plus many additional ones can also be dyanmically configured using mapping programs, e.g. Message Mapping. In addition, many of these parameters are not available for dynamic configuration by using the Communication Channel as you can do with filename and directory.


For example, for an HTTP Receiver Adapter, the URL can be dynamically assigned with Message Mapping. In addition, the HTTP Header fields can also be assigned within Message Mapping.


Another benefit of using Message Mapping is that the value to be assigned does not have to be in the payload of the XML message, as what the File Receiver Communication Channel configuration requires in the case of filename and directory.


How do we determine which parameters can be assigned with a mapping program? Well, they will be listed in each of the Communication Channel configuration section, "Adapter-Speocific Message Attributes". Once the option, "Use Adapter-Speocific Message Attributes", is checked, all the values will be displayed.


For the discussion here, we will use the HTTP Receiver Adapter as an example. We will assign a value to the HTTP header, DOCTYPE, using Message Mapping.


Here are the steps:


  • Configure the HTTP Receiver Communication Channel.


    In the section, "Adapter-Speocific Message Attributes", check the options: "Use Adapter-Speocific Message Attributes" and "Apply HTTP Header Fields". Enter "DOCTYPE" in "Field 1". This will be the HTTP header name.





    1. Create a user-function in Message Mapping:




The source code is below:




(Please note "HeaderFieldOne" is the technical name for "Field 1" in the Communication Channel configuration. The namespace used is also specific to the adapter. Please reference help.sap.com for the namespace and technical names.)


    1. Use the user-function in Message Mapping:



ALL_HTTP=HTTP_CONNECTION:close
HTTP_CONTENT_LENGTH:123
HTTP_CONTENT_TYPE:text/xml
HTTP_ACCEPT:/
HTTP_ACCEPT_ENCODING:gzip
HTTP_HOST:nspad391.pal.sap.corp
HTTP_USER_AGENT:SAP Web Application Server (1.0;640)
HTTP_DOCTYPE:SalesOrder


ALL_RAW=Connection: close
Content-Length: 123
Content-Type: text/xml
Accept: /
Accept-Encoding: gzip
Host: nspad391.pal.sap.corp
User-Agent: SAP Web Application Server (1.0;640)
doctype: SalesOrder


The header "DOCTYPE" is assigne the value "SalesOrder".
21 Comments