cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic configuration

Former Member
0 Kudos

Hi all,

what is the difference between dynamic configuration and variable substitution?

Regards,

somu

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Dynamic Configuration

-


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 Adapter-Specific Attribute “FileName” of the File Adapter

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

}

Variable Substitution

-


Specify the File Name Scheme that the system is to use to save the first incoming document.

You can enter variables for the file name scheme. The variables must be enclosed by % characters.

See also Variable Substitution below

Variable Substitution (Target Directory/File Name Scheme)

If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.

● Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.

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

○ If the variables are to refer 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)

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.

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

&#9675; If the variable refers to an element in XML schema, add the prefix payload: to the information 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.

To reference the element that is in bold in the example, 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 e2 at 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" ?>

<root>

<dummy>

<e1>

<e2>Data_1</e2>

<f/>

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

<e2>Data_2</e2>

</e1>

</dummy>

<e1>

<e2>illegal/value</e2>

<f/>

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

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

</e1>

</root>

&#9679; 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 “..“.

Adapter-Specific Message Attributes

A configured variable substitution (see above) is performed after the attributes are transferred from the message header.

&#9679; To evaluate adapter attributes in the message header of the XI message, select Use Adapter-Specific Message Attributes.

&#9679; If you want missing message attributes to trigger error messages, select Fail If Adapter-Specific Message Attributes Missing.

If the indicator is set and the header for adapter-specific message attributes or one of the set attributes is missing from the message, this leads, in asynchronous cases, to a delivery exception in the audit log of the message. In synchronous cases, the sender of the message is notified.

If you do not set the indicator, and message attributes are missing, the adapter accesses information from the adapter configuration.

Former Member
0 Kudos

Hi,

Dynamic configuration means at runtime we are changing the values.

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

For variable substitution watch this threads

/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

/people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi

Edited by: Ramesh on May 14, 2008 1:35 AM

Former Member
0 Kudos

hi,

  • Dynamic Configuration 😘

The message header of an XI message contains a header for adapter-specific message attributes that

the sender adapter can use to write additional information to the message header. Like message ID,

sender party, and sender service attributes are imported from the XI message header to the adapter-

specific message header.Using the Dynamic Configuration we can able to access the message ID,

sender party, and sender service attributes which are imported from the XI message header.Dynamic

Configuration at mapping leavel we can able to collect ( like message Id) and pass the value to any

field.

Variable Substitution :

Variable Substitution also same as Dynamic Configuration.we can able to collect the sender_party,

sender_service, receiver_party, receiver_service, interface_name, interface_namespace in a variable.

But the variables are used to change the name of the File . If we collected message id then we can

able to add the message id in our output file name.

[http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm]

*Reward Points If Its Useful*

Regards,

Prakasu

Former Member
0 Kudos

hi

we can obtain file name using Dynamic configuration of file adapter

Also check this blog

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

You need to select the Adapter Specific Identifiers --> FileName in both your sender and receiver file adapter.

Variable substitution allows you to name your target file dynamically with some value in the msg payload.

/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

Although u have another of option of trying Adapter specific message attributes (ASMA)

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

pls reward points if solution found helpfull

regards

chandra.k

Former Member
0 Kudos

Hi,

For variable substitution u can check the below link

/people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi

for dynamic configuration

/people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further

Thanks,

Madhu

former_member556603
Active Contributor
0 Kudos

Hi Somu,

what is the difference between dynamic configuration and variable substitution?

Go through this Example with Screen Shots.

http://sapnetweavernotes.blogspot.com/2007/12/dynamic-configuration-of-some.html

variable substitution

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Thanks,

Satya Kumar

Edited by: SATYA KUMAR AKKARABOYANA on May 13, 2008 1:39 PM

Former Member
0 Kudos

Hi,

refer the intro para for the same:

/people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean

chirag