on 06-29-2007 3:22 PM
Hi Guys,
i'd like to post a file on a ftp with following structure:
yyyyddmmhhmmssMatNr
Well the TimeStamp is a given function from XI. Reading the payload for getting the matNr is also given with variable Substitution.
But getting both together didn't work for me. When i chose "Add Tme Stamp" and the variable Substitution in Receiver Adapter the output-file looks like:
MatNryyyyddmmhhmmss
9111111220070629-153110-012
which is not the way i wanted it :). So does somebody have an idea on this?!
And for the timestamp: is it possible to get rid of "-"?!
br Jens
Hi;
Refer these for more help
Dynamic File Name Part 1
/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
Dynamic File Name Part 2
/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
Mudit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jens,
As Michal suggested , the best way is ASMA.
Please write the below code in UDF with <b>two i/p parameters</b>
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String inputdate = <b>yourInputdate</b>;
String fname = <b>MATNR</b>;
String finalname = inputdate""fname;
conf.put(key,finalname);
return "";
The logic is
Take two input -
>UDF------->Root Node[target]
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try using;
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
Date now1 = new Date();
SimpleDateFormat formatter = new SimpleDateFormat ("yyyyddmmhhmmss");
String dateString1 = formatter.format(now1);
String final = a + dateString1;
conf.put(key,final);
return (final);
Ok, i took yout code - after customizing it it works fine so far.
But i still have to use the Variable Substitution (VS) - or don't I?
Therefore its not working. In my mapping i map to the very root node of my target MT. In VS i made the Varibale name "var1" with the Reference to the MT "payload:MT_XYZ,1".
What is wrong?
br Jens
>>But i still have to use the Variable Substitution (VS) - or don't I?
You dont need to use Variable substitution. Just use the UDF shown by Shabz and populate what ever value you want to the file Name. Just ensure, you have selected ASMA in receiver File adapter. In the File Name column in adapter, just fill any dummy name(this will be replaced by the value you fill in mapping).
Regards,
Jai Shankar
Hi Jens,
I cannot imagine an easier way
then shown in this blog:
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
it's a standard, no need to use this never working variable Substitution
and it's exactly what you need
so just go and do it
<b>this solution works like a charm - trust me</b>
Regards,
michal
-
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
well i already tried this appoach, even ur former blog to dynamic configuaration - but it didn't work out for me.
Just to make it clear. Again i have an IDoc2File Scenario with integrated FCC. Because of chosing the Adapter-Specific Message Attributes there are no Header Fields offered in the FTP-Receiver. (i am using NW04s, PI 7.0)
But the variable substitution really works for me - i only have to change the structure of the output-name.....
I'd recomment that when you are doign the message mapping, make a UDF that does all this and writes it to the payload, then use variable substitution, you can make the time stamp in your UDF using the java engine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.