cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic construction of temporary filename for receiver file hcannel

Former Member
0 Kudos
66

Hi,

We are using a receiver file channel and we need to populate the temporary file name dynamically , in the message mapping (similar to main file name and folder).

Please let me know as to how to achieve this in message mapping and what configuration needs to be done in the receiver file channel.

Regards

Ganesh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

A way to fetch File name Dynamically (from source File Adapter) in message mapping is through a UDF and then pass this Filename in XML payload of your message.

Then this Dyanamic File name can be put into Receiver File Adapter by configuring Advanced Tab in Receiver File Adapter as explained in this Link:

under Advanced Tab Page

http://help.sap.com/saphelp_nw70/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm

UDF is as Follows:

"

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String valueOld = conf.get(key);

return (valueOld);

".

This code fetches File Name of the files picked up by Sender File Adapter.Give a suitable file name in Sender as "*.txt" or anthing you wish.

If you find the information helpful, rewards points.

Thanks,

Anurag Garg

Former Member
0 Kudos

Refer the following blogs, they might be useful;

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1888] [original link is broken] [original link is broken] [original link is broken];

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6400] [original link is broken] [original link is broken] [original link is broken];

Award points if useful.

Regards,

Yashaswee.

Former Member
0 Kudos

Hi Ganesh,

To give the same name as the source file u need not do any mapping.

Just activate "adapter specific attributes" in source and target adapter nd select filename and directory attributes.

To change the name dynamically, in addition to the above step u have to write a small user defined which takes source filename from the container object,change it and return the changed filename.

Hope this helps.

Regards,

Sumit