Skip to Content
avatar image
Former Member

File /FTP adapter -> Need to pull files that are 2 or more days old

XI experts,

We have SAP XI 3.0 in our landscape and have a unique requirement in XI where the business wants to pull files from File system only those files that are 2 or more days old .

I can do this by pulling all files thru a file adapter and then calling a proxy in R/3 to check the File Timestamp .. This file time-stamp will be mapped in XI using a Java function for accessing adapter specific attributes .

BUT , can we have some selection criteria in the file adapter itself where it will pull only those files that are 2 or more days old .... Maybe something in the Adapter modules ??? Would appreciate your reply .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 20, 2007 at 08:18 PM

    Ashutosh,

    I think as suggested writing an small command level script would be easy way to check file date..

    Otherwise you need to write File Adapter -module before to validate date-time.

    Check out this blog if you are planning to write a module...

    /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter

    how-to-test-module-processor-javabean-as-a-standal

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805

    Hope this will help you.

    Nilesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Nilesh ,

      Writing after some weeks gap , BUT if you remember this discussion , i was trying to execute an OS command file from File adapter , i was going to try Guru' trick ... AND FYI -> I tried his trick of having a dummy file and then writing a Unix shell script command file to be called from File adapter which changes the name to the file name that adapter is suppose to poll....... BUT i found out that adpater executes the OS file only when it finds the file ,,, therefore the file that the adapter is polling should be present in the source directory and then it executes the OS command file .. ANYWAY , what i did is i am having a dummy.txt file which my adapter will always poll and then my OS command file will find old files on the directory that i want and change the filenames to (filename)_OLD.txt and i am calling a ABAP proxy which will then connect to the directory i want and access all files that have _OLD as suffix in the filenames.

      Well , i think i can even do this without XI by triggering my ABAP program and doing the same stuff as mentioned above , BUT bottom-line , the OS command file works and point to mention is : OS command file is executed by adapter only when the file it polls is found by the adapter. ....

      Thanks for everything and Convey my Thanks to Guru if you happen to be in touch with him ..

      Regards,

      Ashutosh

  • avatar image
    Former Member
    Aug 20, 2007 at 07:18 PM

    1) Try Using Processing Sequence (for transport protocol File System (NFS))

    If you use placeholders when specifying the file name, define the processing

    sequence of the files:

    ○ By Name: Files are processed alphabetically by file name.

    ○ By Date: Files are processed according to their time stamp in the file

    system, starting with the oldest file.

    2)Try developing a module for achieving the functionality, and deploy the same.

    3)Use the Adapter-Specific Message Attribute

    <b>Source File Timestamp</b> and ,Use the value of the same for discarding te file content of those files which are not 2 days old..

    *Reward points if helpful*

    Regards,

    Sushil.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 07:49 PM

    Hello,

    You can use the option

    "Run Operating System Command Before Message Processing".

    Check if the file is old enough or not to be processed from the Filename.

    Regards,

    Add comment
    10|10000 characters needed characters exceeded