Skip to Content

With the multi lingual support of SAP XI we can achieve the desired result through either JAVA or ABAP. It depends on the development team to choose the technology.

I will demonstrate the same by highlighting the problems in FTP adapter on the J2EE stack and how my custom FTP ABAP Sender adapter did overcome it. We followed a generic design approach in our project in which we did not prefer to design one communication channel per interface. We used a generic communication channel, which can read any file structure using a single outbound interface. It works fantastic when we give a wild card pattern *.* in the filename but the problem comes when I want to select files with regular path expression. I posted the same on SDN forums where people gave a solution to either enhance the module processor to filter the files or using some templates for enhancing the features of XI. I ruled out the first option, as I don’t want to get the files, which are not required for my interfaces and the second option is also ruled out as there are no pre-defined procedures for the same. I have created my own ABAP program, which connects to the FTP server through the parameters specified in the report interface and downloads the files to the XI temporary folder and moves into a folder where XI FTP adapters are polling for the files. We can monitor it centrally by creating a report tree and giving link to SXMB_MONI and ZXISNDFTPADAPTER.I tested this approach and it works fine.

Schematic Representation:
Logical Flow

Let me briefly explain the scenario. I configured 3 communication channels for metering, purchasing, supply point streams. I cant give a *.* in the filename field because all the files of 3 streams are in the same folder on the FTP server. Communication channel configured for metering has to fetch only metering files and this can be done only using regular path expressions. FTP java adapter does not support it.
So I have written my own Sender ABAP Adapter, which has a similar interface like Sender Java Adapter.

Source Code Snippet:

Demonstration:
1.Cut and Paste the code in the se38 editor.
2.Include the text elements as shown below by using the menu option GoTo->Text Elements and press F8.After pressing F8 an initial screen will appear which has UI similar to Sender Java FTP Adapter where user can specify the parameters which is explained in the step-3.
Text Elements
3.Specify FTP Connection parameters as shown below.
Connection Paramters
4.Choose Processing Mode, File Type, Transfer Mode as shown below.
Processing Mode

Transfer Mode
5.Executing operating system commands from XI server.
Input OS Commands
6.Error log is created if there are errors and the same is listed on the screen once F8 is executed after specifying the required parameters.
Sample Screen Shots:

I want to select all the SC9 and MRI files from specified directory on the FTP server.I have given sample screen shots for achieving the desired functionality.
FTP server:
MRI and SC9 files are present in the /local/data/interface/dx5/ixfiles/inbound folder on the FTP server.
Files on FTP Server
XI ABAP FTP Sender Adapter:
The parameters have to be appropriately fed into the report program as shown below.XI directories specified here should be present in AL11 transaction and the basis administrator should provide the required authorization for you to perform the FTP.
Sample FTP parameters
Files downloaded on the XI server:
After executing the report program we can see the files in the directory specified above using transaction code AL11.
Configuration in ID
Configurations in the Integration Directory:
I configured sender file communication channel to poll into the shared folder metering and do the necessary transformation routing specific to the metering stream.
FTP Communication Channel

I scheduled the report program in sm37 to poll for every 10 minutes, which will download all metering files into the metering folder and post them as Idocs into SAP ISU. I can also achieve multitasking by scheduling the report with different variants.Ex:I can schedule the same report for purchasing stream with the parameters related to that. Well, this is just a skeletal adapter and it can be enhanced with rich functionality as desired by the developers. We can also code SFTP adapters from ABAP. It is very simple to do it in ABAP with the help of API’s provided by SAP. It is very very easy to develop reciever adapter after cracking the ABAP Code and I leave that to the readers.:)

Note: I have not performed any stress or load testing on this code. I could use it in the project, as the volumetric is not too heavy. We can tune the performance if it is useful.

To report this post you need to login first.

21 Comments

You must be Logged on to comment or reply to a post.

  1. Roberto Viana
    Hi there,

    Thanks fot this weblog, I found it very interesting. However, I have some doubts regarding the use of the RFC destination in this program. Could you explain what is the role of the SAPFTPA rfc dest? And if possible explain how to configure it in SM59? Thanks,

    Roberto

    (0) 
    1. Sravya Talanki Post author
      Thanks Robert.RSFTP005 report is used to check if itz  already existent.Basis should help you.
      If not create tcp/ip connection sapftpa with activation type “Start on Application Server” and program sapftp. please contact me at sravya.talanki@wipro.com for further clarifications.
      (0) 
      1. Carme Alentorn
        It’s a great blog and this is a useful information. I have a similar problem because I need to pick up files from a great number of different directories.
        However, my doubt is … How do you control locked files?
        It’s possible you pick some files when it isn’t complete?

        Thanks,

        (0) 
          1. Sravya Talanki Post author
            BTW the recent versions of SAP PI does have inbuilt ability. This blog is written longtime back when we are using SP11 stack.

            The regular path expression are supported now.

            (0) 
            1. Rosie Sasidharan
              Hi Sravya,

              As you said, could you please let me know from which SAP PI versions regular path expressions are being supported.

              Thanks in advance,
              Rosie Sasidharan.

              (0) 
  2. Roberto Viana
    Hi there,

    Thanks fot this weblog, I found it very interesting. However, I have some doubts regarding the use of the RFC destination in this program. Could you explain what is the role of the SAPFTPA rfc dest? And if possible explain how to configure it in SM59? Thanks,

    Roberto

    (0) 
    1. Sravya Talanki Post author
      Thanks Robert.RSFTP005 report is used to check if itz  already existent.Basis should help you.
      If not create tcp/ip connection sapftpa with activation type “Start on Application Server” and program sapftp. please contact me at sravya.talanki@wipro.com for further clarifications.
      (0) 
      1. Carme Alentorn
        It’s a great blog and this is a useful information. I have a similar problem because I need to pick up files from a great number of different directories.
        However, my doubt is … How do you control locked files?
        It’s possible you pick some files when it isn’t complete?

        Thanks,

        (0) 
          1. Sravya Talanki Post author
            BTW the recent versions of SAP PI does have inbuilt ability. This blog is written longtime back when we are using SP11 stack.

            The regular path expression are supported now.

            (0) 
            1. Rosie Sasidharan
              Hi Sravya,

              As you said, could you please let me know from which SAP PI versions regular path expressions are being supported.

              Thanks in advance,
              Rosie Sasidharan.

              (0) 
  3. Roberto Viana
    Hi there,

    Thanks fot this weblog, I found it very interesting. However, I have some doubts regarding the use of the RFC destination in this program. Could you explain what is the role of the SAPFTPA rfc dest? And if possible explain how to configure it in SM59? Thanks,

    Roberto

    (0) 
    1. Sravya Talanki Post author
      Thanks Robert.RSFTP005 report is used to check if itz  already existent.Basis should help you.
      If not create tcp/ip connection sapftpa with activation type “Start on Application Server” and program sapftp. please contact me at sravya.talanki@wipro.com for further clarifications.
      (0) 
      1. Carme Alentorn
        It’s a great blog and this is a useful information. I have a similar problem because I need to pick up files from a great number of different directories.
        However, my doubt is … How do you control locked files?
        It’s possible you pick some files when it isn’t complete?

        Thanks,

        (0) 
          1. Sravya Talanki Post author
            BTW the recent versions of SAP PI does have inbuilt ability. This blog is written longtime back when we are using SP11 stack.

            The regular path expression are supported now.

            (0) 
            1. Rosie Sasidharan
              Hi Sravya,

              As you said, could you please let me know from which SAP PI versions regular path expressions are being supported.

              Thanks in advance,
              Rosie Sasidharan.

              (0) 
  4. Mayank Dixit
    Hello Sravya,
               It is a nice blog.
    I just wanted to know if there is a way to have an FTPS connection through ABAP file adapter.
    I saw OSS note for SFTP connection but nothing for FTPS.

    Regards,
    Mayank

    (0) 
  5. Mayank Dixit
    Hello Sravya,
               It is a nice blog.
    I just wanted to know if there is a way to have an FTPS connection through ABAP file adapter.
    I saw OSS note for SFTP connection but nothing for FTPS.

    Regards,
    Mayank

    (0) 
  6. Mayank Dixit
    Hello Sravya,
               It is a nice blog.
    I just wanted to know if there is a way to have an FTPS connection through ABAP file adapter.
    I saw OSS note for SFTP connection but nothing for FTPS.

    Regards,
    Mayank

    (0) 

Leave a Reply