cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Substitution for File Name Scheme

Former Member
0 Kudos

Hi all,

Please clarify the following issue.

I have two source field

Transfer Order number - 0000000222

Tranfer Order line item - 0001

Both i map it into one target field

The target field output is - 0000000222#0001

I need a file name which starts with ABC <TranferOrderNumber>.txt.

The problem is, when i try to use payload i get output

(ABC0000000222#0001.txt). The reason is i use the target field which has concatenated.

Please give me a solution where i would get output

(ABC0000000222.txt).

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

Anandha,

use Dynamic Configuration of Adapter-Specific Message Attributes to set the file name instead of plain Variable Substitution.

You can do it in the same mapping you use to generate target message.

Check these references on dynamic configuration:

http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

Just make the mapping and then set your receiver file adapter to use the adapter specific attribute instead of the default name field.

In your specific case, the filename string should be something like:

String filename = "ABC" + order_number + ".xml"

Regards,

Henrique.

Answers (2)

Answers (2)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Use Adapter Specific Identifiers , instead of Variable Name substitution.

Sender File adapter --> Adapter Specific Attributes --> Select File Name

Reciver File Adapter -->Adapter Specific Attributes --> Select File Name

In the mapping , use this code in an UDF to change the filename to what you want,

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

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String filename="YOURFILENAME";
String rSourceFileName = conf.put(key,filename);

Regards,

Bhavesh

Former Member
0 Kudos

Hi Anandha,

To get the value correct what you need to do is that you can add up a new node in your target structure and pass the transfer order no only to that field.

In the filename schema give the value as ABC%var%.txt where %var% stands for the XML path for your new node in your target structure for transfer order number.

when you use the content conversion you can use the 'Cut' method to suppress the node which is having only the transfer order number. For this you can refer to the configuration of the sender file adapter

Cheers

JK

Former Member
0 Kudos

Hi,

Please let me know the procedure of using 'cut' method in content conversion.

Former Member
0 Kudos

Hi Anandha,

Pls do check this blog and you can get the usage of 'cut' method in the content conversion

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

Cheers

JK