Start of Content Area

Procedure documentation Defining Variable Substitution for Target Directory/File Name  Locate the document in its SAP Library structure


In the file/FTP adapter, you can use variables in the entries for the target directory and file name scheme. The variables can refer to either attributes in the message header or elements in the XML schema of the message payload.


You are defining a receiver file adapter or a receiver FTP adapter.



       1.      If you want to specify variables in the target directory and file name scheme, they must be enclosed by % characters.


An example of an entry for the target directory using variables is: c:/temp/local/%var1%

       2.      If you want to define variables for the entries for Target Directory and File Name Scheme, select Enable.

       3.      Make entries under Variable Name and Reference in the table.

       4.      Enter each variable that you reference in the entry for Target Directory and File Name Scheme without the enclosing percentage sign under Variable Name in the table.

The variables can refer to attributes of the message header or elements of the message payload.

Defining Variables for Attributes in the Message Header

       5.      If the variable refers to an attribute of the message header, add the prefix message: to the name of the variable under Reference.

You can specify the following attributes of the message header:

     sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace

     message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)

     message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)

     If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, these characters are replaced by an underscore ("_").


For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.

Defining Variables for Elements in the XML Schema of the Payload

       6.      If the variable refers to an element in the XML schema of the payload, add the prefix payload: to the variable name under Reference.

The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....

namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.

The description begins at the root of the document and ends at the respective element.


For example, to reference the element that is in bold in the XML structure below, the following expression is used: payload:root,1,e1,1,e2,2

The parser searches for the first occurrence of the root element at the first level.

It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2at the third level.

The content of the last element (“Example Value”) is set as the value for a specified variable.

<?xml version="1.0" encoding="UTF-8" ?>






        <g attr="abc">text</g>







     <g attr="abc">text</g>

     <e2 attr="fghij">Example Value</e2>



       7.      To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.

Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.



End of Content Area