on 12-02-2015 1:47 PM
Hi all,
Am facing an issue with the multiple mapping in the which i have created 3 different data type ,Message type , Service Interface and to which i have created one message mapping and also operation mapping , for the Idoc to File scenario
for that i have created 3 different communication channel as there are 3 different file name and 1 single ICO.
And to the which the file extension is .CSV so , my question is how to add time stamp for these 3 different files ,i have gone up with the variable substitution and facing issue .
Can any one suggest
regards,
Vijender
Hello Sandhya,
your scenario is Idoc to 3 files right?
Go with Dyanmic Config UDF,instead of VS.
SAPTechnical.COM - Dynamic File name using ASMA (Adapter Specific Message Attributes) in XI / PI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You cannot use dynamic configuration with multimapping directly.
If it is always 3 files, you can use the following approach
If the number of target messages is dynamic, following is another approach.
And since target is CSV, variable substitution also is not possible because it can only be used for XML payloads.
Hi Raghu ,
please find the UDF ....
//Generate File Name
try
{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
//Update the ASMA File Adapter attribute
conf.put(key,fileName);
}
catch (Exception e)
{
//raise an exception if the update fails
String exception = e.toString();
return exception;
}
//return the status
return dummy;
Regards,
Sandhya,
use the below code and enable ASMA parameters for both filename and timestamp.
try {
String filename = "";
String timestamp = "";
DynamicConfiguration conf1 = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");
filename = conf1.get(key1);
timestamp = conf1.get(key2);
filename = filename.replaceAll( ".txt" ,"_" );
filename = filename+timestamp+".xml";
conf1.put(key1,filename);
return filename;
}
catch(Exception e)
{
String exception = e.toString();
return exception;
}
Hi sandhya ,
why cant you go with Add Time stamp through ID ??
Regards,
Vijender
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.