Start of Content Area

Function documentation Accessing Adapter-Specific Attributes  Locate the document in its SAP Library structure

Use

Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time (see: Adapter-Specific Message Attributes in the Message Header). Java mapping programs can also change the attributes after the message has arrived (see also: Java Mapping of Adapter-Specific Attributes).

To change the adapter-specific attributes of the message header by using message mappings, you access the required classes of the mapping API by using a mapping runtime constant.

Integration

To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.

Example

The following program code for a user-defined function changes the value of the file adapter parameter FileName.

Accessing the File Adapter Adapter-Specific Attribute “FileName”

DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(
    “http://sap.com/xi/XI/System/File”,
    “FileName”);

String valueOld = conf.get(key);
if (valueOld != null) {
    String valueNew = valueOld.replaceAll(“input”,”output”);
    conf.put(key, valueNew);
}

 

 

 

 

 

 

 

End of Content Area