Skip to Content
avatar image
Former Member

how to pick file by file from a same directory in regular intervals

HI EXPERTS,

My scenario is to pick file by file from a same directory.

For example, suppose they r 'n' files in source directory with the same .xml extension i have to send 1 by 1 with regular intervals to the target directory with a time gap of 1min each.

i am using windows xp and using sap netweaver 7.1

Thanks&Regards

Rajesh.A

SAP PI CONSULTANT

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Jan 12, 2012 at 08:37 AM

    schedule adapter if doesnt work then implement logic in mapping level . write simple UDF and add sleep menthod(threads concept).

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Raja,

      you cannot do that, because when there are several files in the source folder, there are pickup all together with the 1st run of this adapter, and then treated one by one in parallel: one XML message per file, and so your UdF will be useless as mapping which run in parallel... except if you use a EOIO process... but is it acceptable for his business?

      Mickael

  • avatar image
    Former Member
    Jan 12, 2012 at 08:55 AM

    Hi Rajesh,

    The requirement you have explained is how the Adapter normally works. If you have multiple XML files which have to be processed, the adapter will read one file at a time and then send the XML for processing.

    Or is your requirement such that , only when the scenario for first file is executed sucessfully end to end , then the second file should be processed?

    Regards,

    Sushil.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sushil,

      Actually my scenario is to process the file by file in a folder for every 30 seconds.

      if there are 3 files in a folder with same extension the 1st file should be processed for the first time in 30sec and second file should be processed after another 30sec and third file should be processed after another 30 sec.Totally within 90 sec all 3 files have to be processed and there is no requirement to check whether the previous files are successfully processed or not.

      Thanks & Regards,

      Rajesh.Adiraju,

      SAP PI Consultant,

      Edited by: rajeshadiraju on Jan 13, 2012 8:23 AM

  • avatar image
    Former Member
    Jan 13, 2012 at 08:57 AM

    Hi Rajesh,

    Write a simple UDF and have interval like below using the Thread.sleep():

    {

    try

    {

    Thread.sleep (40000);

    }

    catch (InterruptedException ie){}

    return a;

    }

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2012 at 09:29 AM

    Hello,

    For example, suppose they r 'n' files in source directory with the same .xml extension i have to send 1 by 1 with regular intervals to the target directory with a time gap of 1min each.

    I knew that I read it here in an SDN blog that this is possible 😊 See this blog by Mickael find solution N*1

    XI/PI: how to exclude files in a sender File adapter?

    The key is to use advanced selection for source files. If you use a fileMask of *.xml, it will send it according to polling interval just as was mentioned on the blog.

    Hope this helps,

    Mark

    Edited by: Mark Dihiansan on Jan 13, 2012 10:31 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 13, 2012 at 10:28 AM

    Hi,

    If I am not wrong, this can be only possible with NFS.

    How to process files one by one using sender file adapter

    Regards,

    Krishna Chauhan

    Edited by: Krishna Chauhan on Jan 13, 2012 11:30 AM

    Add comment
    10|10000 characters needed characters exceeded