cancel
Showing results for 
Search instead for 
Did you mean: 

How to use PI to ftp a file from source to destination with the same name

Former Member
0 Kudos

Hi, all.

I need to create an interface to transfer a text file. The file is located in a source directory in a known pattern. PI will parse the file and do very minor manipulation. Then we need to keep the exact same file name when we SFTP to the destination server. How can I do that in PI?

The requirement sounds simple but I cannot think of an easy way to achieve it in PI. Is there a way to pass the file name from the sender file adapter to the receiver sftp adapter? Actually using unix shell could have been a very easy task.

Thanks,

Jonathan.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use Dynamic configuration with ASMA (Adapter Specific Message Attributes), check the File Name.

Refer below links.

http://scn.sap.com/thread/2155045

Thanks & Regards,

A.Neelima.

Former Member
0 Kudos

Thanks, I will give the second thread a try.

engswee
Active Contributor
0 Kudos

Hi Jonathan

The requirement sounds simple but I cannot think of an easy way to achieve it in PI. Is there a way to pass the file name from the sender file adapter to the receiver sftp adapter?

Transferring file name from sender adapter to receiver adapter is very common in PI scenarios and can be easily achieved with the combination of ASMA and Dynamic Configuration. Is there a particular reason why you cannot think of an easy way to achieve it?

Basically in your sender file chanel, you set ASMA for the filename. In runtime, it will be stored in Dynamic Configuration attribute FileName under namespace http://sap.com/xi/XI/System/File

Then on your receiver SFTP side, you need to set ASMA to use the filename from the above attribute.

Just to add on to the links above, you can also see an example of ASMA setting in receiver SFTP channel below

Rgds

Eng Swee

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi, guys

Thank you for your input. Sorry that I am not familiar with ASMA. But how do you reference the filename attribute. I did try to find doc in help.sap.com and come up empty. Here is what I have tried:

What did I do wrong as it creates a file %FileName% in the sftp server?

Thanks,

Jonathan.

javier_alcubilla
Contributor
0 Kudos

Hi Jonathan

The namespace for FileName in ASMA is http://sap.com/xi/XI/System/File

You have set http://sap.com/xi/XI/System/System

Regards

Former Member
0 Kudos

Thanks, that fixed it. The http://sap.com/xi/XI/System/System comes in as the default and wasn't checking properly. I guess nothing is easy when you do something the first time in PI.

iaki_vila
Active Contributor
0 Kudos

Hi Jonathan,

What is that little manipulation?, if you need to tranform to XML your file to do the transformation you would need to use MessageTransformBean, there isn't  FCC in SFTP. Check the Grabiel's blog

Regards.

Former Member
0 Kudos

Hi, Irikaki

The minor manipulation is just to get rid of lines that don't belong to a certain starting pattern and also replace certain fixed patterns in each line from one to another. I have decided to use a unix shell script to do so as it is rather easy instead of mapping. I don't think I want to create a bean as I haven't done this before

Thanks,

Jonathan.