on 12-19-2006 7:44 PM
Hi all,
Problem: I know how to set the name of the file in an Idoc to file interface if I'm using a message mapping, but not if I'm using a Java mapping.
I'm using this code inside a user-defined function of the message mapping so that I can set the name of the file dinamically:
-
public String GetFileName(String inboundParameter,String IdocNumber,Container container){
String filename;
java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
filename = "cikk_" + dateformat.format( new java.util.Date() ) "_" IdocNumber + ".txt";
DynamicConfiguration conf = (DynamicConfiguration) container
.getTransformationParameters()
.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
conf.put(key, filename);
return inboundParameter;
}
-
(See also: /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14)
But how can I do that if I'm using a Java mapping??
I don't have the class Container there. How can I retrieve the DynamicConfiguration object without that class?
Thank you very much.
Hi Jorge -
Go to the <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/pi/index.html">XI javadocs link</a> and click on "DynamicConfiguration" class on the left. There it provides you with an example using a Java mapping.
Regards,
Jin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Jin,
I knew that it had to be related with the Map object got in setParameter, but in this link:
http://help.sap.com/saphelp_nw04/helpdata/en/0f/80243b4a66ae0ce10000000a11402f/frameset.htm
you can't find the constant DYNAMIC_CONFIGURATION.
I think it's not up to date.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.