Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 15, 2014 at 09:24 PM

    Hi,

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

    Refer below links.

    SAP SFTP Adapter: A Quick Walkthrough

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

    Thanks & Regards,

    A.Neelima.

    Add comment
    10|10000 characters needed characters exceeded

    • 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

      SFTP Adapter in PI 7.3x

      Rgds

      Eng Swee

  • Oct 15, 2014 at 10:17 PM

    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 Standard Adapter Framework modules [AF_Modules] in PI 7.1 –Part 2

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Oct 16, 2014 at 03:33 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded