on 03-24-2006 2:15 PM
Hi i want to change the file name directly from Java Mapping in the file adapter
for this i have written this code
DynamicConfiguration dynamicConfiguration = (DynamicConfiguration)map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey keyFile = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey keyDir = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
dynamicConfiguration.put(keyFile,fileName);
dynamicConfiguration.put(keyDir,outputpath);
but it gives a null pointer exception at dynamicConfiguration.put(keyFile,fileName);
please suggest.
regards
Nilesh Taunk.
Hi Nilesh,
If your requirement is to create , the file name dynamically for your receiver file adapter, you can do so using your <b>FILE ADAPTER CONFIGURATION</b> itself, and need not go for any JAVA Mappping / Java Code at all.
The dynamic filename generation concept is as follows.
In your filename field in the receiver file adapter, just give a variable with <b>%</b> symbols. (eg: %file% ).
Now, under the option <b>Variable Name Substitution</b>, you can give how the value has to be created.
<b>It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.</b>
For the former, your give
<b>message:interface_name</b> ,etc
and for the payload part you give,
<b>Payload: "your element root which u wanna acecss"</b>
Just check this link out,
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
And read the contents under variable substitution and it will help you understand the concepts better.
Also, in your FILE Adapter under the option FILE CREATION MODE, you have options like,
1.Add Counter,
2. Append
3. Create
4. Add Time Stamp
If you have any clarifications on this approach, do get back.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
>>>>Is it that i cannot create an object of dynamicConfiguration in my Java mapping like this
you can use it with java mapping;
http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/content.htm
Regards,
michal
hi,
>>>>dynamicConfiguration.put(keyFile,fileName);
dynamicConfiguration.put(keyDir,outputpath);
are you sure fileName has any value ?
maybe check if it's not null
Regards,
michal
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.