cancel
Showing results for 
Search instead for 
Did you mean: 

file adapter

Former Member
0 Kudos

I am using a file to File Scenario.

On the sender side I need to pick the files placed in a particular directory, the file names will vary everytime. so on the Sender Side i have used the "." to pick up the file name.

Now my requirement is I have to plug in the same file name on the Receiver File adapter, as what I have used in the Sender side.

How to achieve that?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

turmoll
Active Contributor
0 Kudos

Hi,

Take a look at this blog: <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a>

Regards,

Jakub

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Jenny,

As mentioned above you need to check "Adapter-Specific Message Attributes" and then select "File Name" from list. But this way you are making sure that you can read your file name.

You need to write UDF to read input file name...code is as below..

//write your code here

// Function reads the input file name base on cc paremeters and returns it.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

This function will retiurn you Input file name. Inyour receiver File adapter specify file name as %var%

where are var is variable which you need to declare in Variable substitution..

Referece to the payload file name.

Hope this will help you.

Nilesh

Former Member
0 Kudos

In the sender CC select adapter specific message attributes and file name, in the receiver do the same.

Then in the file name scheme, I think you use %FileName%

or you have to use variable substitution with FileName as your parameter for a variable name of your choice.

see this SAP reference:

http://help.sap.com/saphelp_nw04s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Former Member
0 Kudos

Jenni,

In your file sender and receiver communicaiton channel there is an option with ASMA. For this check the check box Set Adapter-Specific Message Attributes and then check the filename check box in both sender and receiver. You will get the same filename as receiver whatever you have read as sender.

Regards,

---Satish

justin_santhanam
Active Contributor
0 Kudos

Jenni,

You can use Adapter specific message attributes. You can achieve them by checking the check box option ASMA - Filename in both sender/Receiver comm.channels.

Best regards,

raj.