FTPS or SFTP for file scenario. Suggstions

Hi,
I have searched blog in sdn but do not get good blogs/links.
For File scenario which to use FTPS or SFTP.
How to do the configuration in XI and Visual admin.
Full points will be awarded.

Hi,
1) SFTP (Secure File Transfer Protocol)
"SSH File Transfer Protocol" or SFTP is a network protocol that provides file transfer and manipulation functionality over any reliable data stream. It is typically used with the SSH-2 protocol to provide secure file transfer. SFTP encrypts the session, preventing the casual detection of username, password or anything that is being transmitted. One key benefit to SFTP is its ability to handle multiple secure file transfers over a single encrypted pipe. By using a single encrypted pipe, there are fewer holes in the corporate firewall.
SFTP:
As per the latest SAP PI/XI support pack, it does not support SFTP via File Adapter.
So alternative approach to cater this requirement from XI is to make use of Unix Script at OS level to transfer the files from/to third-party systems.
Inbound Interface - i.e. third-party system ->XI->SAP: 
File is transferred to a folder in SAP XI landscape from the third-party legacy system using UNIX Script with secured protocol. Once the file is ready in the XI landscape, File Adapter will poll this directory and file is picked up by NFS protocol.
Outbound Interface – i.e. SAP->XI->third-party system: 
XI is responsible for writing a file into a folder in the XI landscape. These files are transferred to the third-party system by executing UNIX scripts with secured protocol i.e. via sFTP.
Pre-Requisites: 
Public key should be exchanged between external systems and the PI system.
UNIX shell script has to be developed and scheduled.
Advantages: 
Highly Secured.
Ability to handle multiple secure file transfers over a single encrypted pipe .By using a single encrypted pipe, there are fewer holes in the corporate firewall.
Disadvantages:
Two-Step process i.e. XI>Temporary folder>External System and vice-versa
Files have to be temporarily stored in XI server.
Multiple failure points i.e. XI and Unix script execution
Maintenance of an external UNIX script.
Difficulty in monitoring the execution of the shell script as it cannot be monitored thru XI.
Need to generate keys and install it in the SFTP site as a pre-requisite i.e. SFTP clients must install keys on the server.
SFTP uses keys rather than certificates. This means that it can't take advantage of the "chains of trust" paradigm facilitated through Certificate Authorities.
Files from the XI server should be deleted/archived in a periodic manner to increase the disc space so that it will increase the performance.
Note: UNIX shell Script can be executed as a background job ‘or' can be triggered from SAP XI through OS command at File adapter level.
Secure FTP (SSH) with the FTP Adapter
Secured File Transfer using SAP XI
Secure FTP in SAP XI
SFTP (FTP over SSH) in XI
/people/krishna.moorthyp/blog/2007/07/31/sftp-vs-ftps-in-sap-pi
encryption adapters or how to secure data
/people/krishna.moorthyp/blog/2007/07/31/sftp-vs-ftps-in-sap-pi
Regards,
Phani
Reward points if Helpful

Similar Messages

  • FTP List search for file in XI JavaMapping

    I wonder if anyone has ever done a JavaMap in XI with a FTP List search for e.g. filename*.xml
    With the standard FTP URLstring there is no ‘*’ possible within the filename.
    I have not found any documentation on this, how to do a FTP search for filename*.xml within a JavaMap.
    This JavaMap works fine for picking up a file with the exact filename:
    Do you know how to change the code to do this FTP list?
    Thanks for any hints,
    Phil
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class XIftpClient  implements StreamTransformation {
                private Map myParam;
                public void setParameter(Map param) {
                      myParam = param;
                public void execute(InputStream in, OutputStream out) throws StreamTransformationException {
                      URL url = null;
                      URLConnection urlc = null;
                      InputStream ftpInputStream = null;
                      // read xml into String
                      int b = 0;
                      String xml = "";
                      while (b!=-1) {
                            try {
                                  b = in.read();
                                  if (b!=-1) {
                                        xml = xml + new
    Character((char)b).toString();
                            } catch (IOException e) {
                                  throw new
    StreamTransformationException("Exception during Java Mapping." , e);
                      // read properties from xml
                      String user;
                      String password;
                      String host;
                      String filename;
                      String path;
                      String urlString;
                      user = getValueByTagName(xml,"username");
                      password = getValueByTagName(xml,"password");
                      host = getValueByTagName(xml,"host");
                      path = getValueByTagName(xml,"path");
                      filename = getValueByTagName(xml,"filename");
                      urlString =
    "ftp://"user":"password"@"hostpathfilename";type=i";
                      // get file from FTP
                      try {
                            url = new URL(urlString);
                      } catch (MalformedURLException e) {
                            throw new
    StreamTransformationException("Exception formatting URL." , e);
                      try {
                            urlc = url.openConnection();
                            ftpInputStream = urlc.getInputStream(); // To download
                      } catch (IOException e) {
                            throw new StreamTransformationException(
    "Exception reading file from FTP.\n"+e.toString(),e);      
                      // read file into String
                      b = 0;
                      StringBuffer file = new StringBuffer();

    well, i think the best solution would be make a recursive search through the directory tree. I don't know if you are familiar to this, but the functions that searches for the file would look like this:
    public String searchFile(String name) {
      File[] roots = File.listRoots();   // List all file roots (in windows the different units, c:, d:, etc.)
      for (int i = 0 ; i < roots.length() ; i++) {
        String aux = recursiveSearch(roots, name);
    if (aux != null) {   // If the "recursiveSearch" returns something different than null is that the file is founded, so we return the path.
    return aux;
    return null; // If we get there nothing has been found
    private String recursiveSearch(File f, String name) {   // f is the directory to search for the file with name "name"
    File[] childs = f.listFiles();
    for (int i = 0 ;i < childs.length ; i++) {
    if (childs[i].isDirectory()) {  // If that is a directory we search inside
    String aux = recursiveSearch(childs[i], name);
    if (aux != null) {   // We have found it inside this directory
    return aux;
    } else {  // Is a regular file
    if (name.compareTo(childs[i].getName()) == 0) {   // If the file is what we want we return his path
    return childs[i].getCanonicalPath();
    // If we get here is because the file is not inside the directory or any subdirectory on it
    return null;
    You should just call the function searchFile(name) with the name of the file you want to search. If it finds one with this name it will return his absolute path, and if he doesn't the desired file he will return null.
    If you don't understand anything just ask.
    (Note: i have not tested this code, so can be some mistakes, but it think it is almost correct. mmmhh don't now why, but [ & ] appear in my code as < & >. Just replace them.).
    Hope that helps.
    Zerjio

  • Webservice for File Scenario

    HI Everyone,
         Can i develop a webservice using .net platform for a file to file scenario using XI. How do i proceed.
    I know how to configure file to file scenario using XI, but how shd i replicate the same scenario as webservice.
    Any valueable inputs would be appreciated.
    Regards,
    Varun.

    Hi,
    I hope the below blog's scenario is similar to your requirement.
    and here the RFC should be replaced by the Webservice for your requirement.
    RFC Scenario using BPM --Starter Kit
    These 3 documents should explain it all,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/befdeb90-0201-0010-059b-f222711d10c0
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f3ee9d7-0901-0010-1096-f5b548ac1555
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024f79
    And also
    Testing XI exposed Web-Services
    Testing XI exposed Web-Services
    Invoke Webservices using SAPXI
    Invoke Webservices using SAPXI
    Regards,
    Suryanarayana

  • SFTP to File Scenario using multiple files

    Hi All,
    I have a scenario wherein 2 separate CSV files ex a.csv and b.csv has to be picked up from the SFTP folder and the same has to be mapped and send to one single file ex c.csv.
    Say a.csv contains fields Name,Address and b.csv contains Phone,Mobile and I need to map them as per FSD into c.csv which will then have Name,Address,Phone,Mobile
    I am bit confused on how to do it.
    Shall I use Additional File name option in SFTP sender channel configuration? In that case how will I use the FCC as we have 2 separate csv files and both the files are CSV files and needs to be converted to XML.
    Any related threads will help.
    Regards,
    Shaibayan

    Hi Inaki,
    Thanks for your reply.
    BPM is not an option in our case as we are told not to use BPM.
    However as per the thread from Michael
    "pick both files in one run (one as file, the other one as attachment - so one communication channel )
    inside the mapping you can get the values from the attachment and do the mapping"
    This part is fine and we can do the mapping by creating N:1 mapping but since our files are .csv files so a content conversion is required for both the a.csv and b.csv. How to go through with this.
    The structure will be something like below in the message mapping after we add both the source structures in Signature Tab:
    Message
         Message1
              MT_FILE_A
                   RecordSet1
                        Name
                        Address
                        Field3
         Message2
              MT_FILE_B
                   RecordSet2
                        Phone
                        Mobile
    Can I use the below values for Content Conversion?
    Document Name:MT_FILE_A,MT_FILE_B
    Recordset Structure:RecordSet1,*,RecordSet2,* or we have to use MT_FILE_A.RecordSet1,*,MT_FILE_B.RecordSet2.*
    And in the Name Value for Name do we need to use dot for each Document Name i.e.
    MY_FILE_A.RecordSet1.fieldSeparator?
    Regards,
    Shaibayan

  • Mapping error for file scenario.

    Hi ,
    I am working with the help of this scenario to pick only selected files.
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    I am getting error in mapping . Everything i have checked its correct . Mapping is correct . but still its giving error . how can i solve it .
    Error : RuntimeException in Message-Mapping transformatio~
    Thanks ,
    Syed.

    Dear Syed Kumar
    Based on the blog you are executing the scenario I guess. The scenario is clearly focusing on the picking up the files using the mask attribute in File Access Parameters.
    As you mentioned clearly, that you are getting mapping error plz concentrate on how to rectify the mapping errors.
    will guide to do so.
    1. Go to SXMB_MONI and in the integration server and check for the message you are trying send.( I hope you did this)
    2. As it is giving you mapping error, Double click onthe message Flag showing red.
    3.Plz check the Payload XML content copy that content and paste in the message mapping Test section of IR.
    4. Execute the Test. If you get the message at the receiver side there shouldn't be any error.
    If you still get the error let me know.
    Best of Luck
    Reward Points If found use ful.
    Edited by: Praveen Kurni on Jun 13, 2008 7:43 AM
    Do the Interface mapping test as well if you are successful in message mapping.

  • IDoc - SFTP (Flat File) file name

    Dear Experts,
           Thanks for helping me so far, please find below my new request :
           We have IDoc - SFTP (flat file) scenario in which I have did ESR by pass scenario and used standard module to convert IDoc xml to flat file.
           But now user is asking to have the naming convention of the receiver flat file as SHPMNT05_<IDoc number>_<Reference number>.idoc.
           Could you please let me know how this can be approachable. Many thanks in advance for your valuable inputs. Awaiting your replies.
    Thanks
    Ravi..

    Thank you very much Botha,
    In the thread Idoc to file problem with DynamicConfiguration please find below my doubts.
    1. I am using receiver SFTP adapter and IDoc to flat file module configuration as key 1, so how it will works.
    2. What are the Parameter name and Paremeter value for the module mentioned in the blog :
    Module Configurations:
    1  key.0      write http://sap.com/xi/XI/System/File FileName
    1  value.0   message.interface
    Which is the parameter and which is the value in the above blog.
    Waiting for your response.
    Thanks
    Ravi

  • File to file scenario from r/3 to xi

    hi
    could any one send me the file to file scenario from r/3 to xi
    wat could be the source file path in this scenario

    please llok at the docs for file scenario
    /people/sravya.talanki2/blog/2006/12/25/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-i
    source file path will be your file directory path it dependent on your file folder it is not common for every one.
    Regards
    Sreeram.G.Reddy
    Message was edited by:
            Sreeram Reddy

  • Ftp for file to file scenario

    Hi Experts,
    I have a simple file to file scenario where file has to be sent to ip address 10.1.2.3 (receiver machine).
    So first I tried using NFS , sharing a folde ron 10.1.2.3 , but the sender channel in XI showed error and was unable to find the path.
    So I installed Guild ftp pro on 10.1.2.3 .....the scenario was nw working fine...
    all was well untill I discoverd
    when i had to send a file from 10.1.2.3 wher the file name was fixed with the time stamp
    that when I use filename*.txt in the sender channel , the sender channel shows error in the communication channel monittoring..
    further posts on sdn concluded that wild character * cannot be used in guild ftp...
    ne idea on how I can proceeed further??
    are there other softwares like guild ftp?
    help appriciated..
    Regards,
    Teja
    Edited by: Ravindra Teja on Jan 10, 2012 3:14 PM

    I had good experiences with WSFTP and Filezilla. You may try them.
    >>further posts on sdn concluded that wild character * cannot be used in guild ftp
    This is strange limitation of an FTP server.
    Regards,
    Prateek Raj Srivastava

  • How to configure FTP/VAN Adapter for SFTP connection?

    Hi,
    I am new to the use of Seeburger's FTP/VAN adapter. I read SDN threads where the FTP/VAN adapter can be used for SFTP connections. Could anyone assist me in the steps to configure the communication channels for SFTP connections?
    Scenarios:
    1. R/3 -> XI -> File (SFTP server)
    2. File (SFTP server) -> XI -> IDoc
    There is no VAN connection involved. I am just trying to utilize the adapters my PI system currently have for my interface requirement.
    Is the configuration as simple as configuring the communication channel or there are scripts involved? If there are scripting involved, is there a benefit to use scripting in the FTP/VAN adapter, rather than XI's own File adapter?
    Please assist. Thank you.

    Hi Andrew,
    Standard PI Adapter will not support to conenct SFTP server, we have to use third party adapters?? do you have any third party adapters??
    many compniaes providing SFTP adapters and SAP PI Supports to.
    if you dont have third party adapter we do have other alternative , refer below blog
    /people/daniel.graversen/blog/2008/12/11/sftp-with-pi-the-openssh-way
    Regards,
    Raj

  • Datatypes for File to File Scenario

    Dear all,
    i have a question concerning a file to file to file scenario in XI.
    I simply just want so send a RTF-file to XI via FTP adapter and store it on a different FTP server according to the file name. I do not need any information for the content of the file. So I do not want to perform a File Content Conversion.
    I know that it is it possible to implement this scenario without using the integration engine. But for monitoring purposes I'd like to do it anyway.
    My question ist, what kind of message types I will have to choose. From my understanding, the file adapter should just store the content of the file in the payload as a binary data. So does it matter what kind of data type for the message interfaces i choose in integration builder. Of course, a message mapping is not required,
    Best regards
    Florian

    HI,
    In File-XI-File scnearios, you need to have Sender File Communication Channel to pick the file and Receiver File Communication Channel to send the file.
    You can create a Data Type something like this
    <DataTypeFile>
    <Row> ...</Row>
    </DataTypeFile>
    Also look into this Blog-
    XI in the role of a FTP
    FTP  receiver adapter does not transfer (STORE) file
    Thanks
    swarup

  • Port needed for File to File scenario

    Hi,
    I am new to XI, just got trained and I want to practice file to file scenario. I am able to access ID and IR.
    I would like to know whether any port have to be enabled for this scenario????
    I got list of ports from the basis people to enable the ports. could you tell me for which scenarios these ports have to be enabled:
    Http Port            50000
    ABAP Port         8000
    Msg server port 3901
    SDM Port            50018
    File Sharing Port  445
    P4 port               50004
    Enqueue server port    3201
    Dispatcher port        3200
    Sql server Port         1433
    Anymaterial to regarding port details would also be helpful.
    Thanks in advance.
    Regards,
    Kiruthiga

    Hi Kiruthiga ,
    I am new to XI, just got trained and I want to practice file to file scenario. I am able to access ID and IR.
    I would like to know whether any port have to be enabled for this scenario????
    --> Not required ..but you ask for FTP site if want to do file to file scenario using FTP . Default FTP port is 21 though ..
    using  got list of ports from the basis people to enable the ports.
    ---> tell them stop sending information which is not required..This is not the way of "Delivering. High Performance. "
    could you tell me for which scenarios these ports have to be enabled:
    Http Port 50000
    ABAP Port 8000
    Msg server port 3901
    SDM Port 50018
    File Sharing Port 445
    P4 port 50004
    Enqueue server port 3201
    Dispatcher port 3200
    Sql server Port 1433
    Any material to regarding port details would also be helpful.
    --> Friend not required...at this point. Though having knowledge is not a harm .
    Regards,

  • File selection sequence in the FTP connection for File Sender Adapter

    Hi,
    I have a file to Proxy scenario using FTP connection parameters.
    If there are multiple files in the sender folder, XI picks up the files randomly with no processing sequence.
    I want XI to pick up the files based on the date time stamp meaning the  oldest file created in the folder should be processes first and rest all in sequence there after.
    I know processing sequence can be set for NFS connection but not for FTP .
    Please suggest if there's any way to make this work.
    Thanks in advance.
    Thanks and Regards,
    Amit Bhagwat.
    Edited by: Amit Bhagwat on Nov 4, 2009 5:17 AM

    Hi
    For the Transport Protocol "File Transfer Protocol (FTP)" files are always processed in ascending alphabetical order
    If you want the file to be processed in sequence then you can use Quality of Service EOIO in the sender adapter.
    The files are processed in the sequence they are picked up.
    otherwise use BPM for File Sequencing..
    Refer the following Threads
    FTP Sender Adapter - Processing Sequence
    Processing Sequence issue of FTP protocol
    Regards
    Abhijit
    Edited by: Abhijit Bolakhe on Nov 4, 2009 10:32 AM

  • Advantco SFTP for retaining source file name

    We are using Advantco SFTP adapter in a File to File scenario on both sender and receiver side. We have 2 files to be picked from Source (both with different name) and need to place them on receiver directory with the name that we picked from source directory without conversion. Can anyone suggest how we can do this using Advantco SFTP adapter without using JAVA mapping ?
    Thanks,
    Pankaj Kumar Singh

    Hi Pankaj,
    use the ASMA parameter "File Name" in sender channel and ASMA parameter "File Name" in receiver channel.
    this is worked for my scenario.
    Regards,
    Harish

  • Questions to a Mapping for IDOC-to-File Scenario

    Hi all,
    I want do develop a Message-Mapping for an IDOC-to-File Scenario. A SAP System sends an IDOC to the XI-System and the XI-System should make a mapping an send a XML-File to a FTP-Server. The Strukture of the target message is very easy:
    <xdoc>
       <Invoice>
          @purno
          <HeaderInfo>
             <invno/>
             <shipdate/>
             <extvalue/>
          </HeaderInfo>
          <DetailInfo>
             <LineItem>
                @lineno
                <vpartno/>
                <descrip/>
                <qtyord/>
                <cost/>
                <vendmemo/>
             </LineItem>
          </DetailInfo>
       </Invoice>
    </xdoc>
    The source message is an IDOC. This IDOC can contain one or more positions (E1EDP01). Those different positions should be mapped into different LineItem's (see target structure) -> so in the target file one or more LineItems can appear.
    Is it possible to implement this process with a common message-mapping or have I to implement a business process?
    Thanks
    with best regards
    Christopher

    Hi Christopher,
    <i>Is it possible to implement this process with a common message-mapping or have I to implement a business process?</i> - This thing is possible with common message mapping......you dont need business proces for it.......in msg mapping after taking the source IDOC and target xml struc, map the E1EDP01 field to LineItem field.......just check the occurance of these nodes.....it should be 0..unbounded.........so as many E1EDP01 nodes will be there in idoc, that many LineItem nodes in target will be created.......
    Thanks,
    Rajeev Gupta

  • Acknowledgement for Idoc To File Scenario

    Hi Experts,
    My scenario is idoc to file and if the file is successfully delivered at destination then i need an acknowledgement saying that the file was received successfully.
    How to achieve this. Can any body send me the scenario with screen shots.
    Your help will be greatly appreciated.
    Thanks & Regards,
    Venkat

    Dear All,
    For file to idoc scenario is there any possibility to get line items details or xml details i.e the segments and its related field details using reference id, transaction id or interface name or message id in SAP PI 7.0. I know we need to click each and every message in sxi_monitor and look for details.
    For SAP(R3 System) I can create a report and set the job for specific time period so automatically it throws the details(like reference no, document date, invoice no from) in ftp path as .csv file. The same ftp path is maintained in program.
    I wanted to check FTP--->PI postings and I have set the job at r3 system it is working fine and Im monitoring it too.
    Now the end to end scenario is FTP--->PI--->ECC(R3 system). Please help.Many Thanks.

Maybe you are looking for