Skip to Content
avatar image
Former Member

File adapter to pick a single file

The scenario is PI File adapter would pick files from a 3rd party FTP location. The 3rd party is placing files with file names using date time stamp.

The requirement is to process one file at a a time - I have mentioned the Processing Sequence as 'By Date' which means the adpater would pick the files sequentially. But I want the adapter to pick only one file at a time rather than picking all the available files in the system.

Is that possible to do?

Thanks.

Anuradha.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • avatar image
    Former Member
    Aug 02, 2011 at 01:14 AM

    I can only give you an idea. You could try using an OS script in the file sender channel to do `ls -l | tail -1` before a message is created.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 02, 2011 at 02:11 AM

    >Is that possible to do?

    use Parameter Processing Sequence = Date ( This is for processing order) and

    use parameter "Msecs to Wait" and set some value in the advanced tab. This way you can do processing one at a time and sequentially.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 02, 2011 at 06:44 AM

    Hi Anuradha,

    By default PI picks all the files that match the naming convention in a particulat folder. could you please explain your requirement in detail, as to why you want the file adapter to poll only file in at once?

    Regards,

    Sanjeev.

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 02, 2011 at 06:45 AM

    Hi Anuradha,

    Could you please kindly provide answers to the queries below so that forum members can have a clear picture of your requirement

    1. What is the operating system of your PI server?

    2. What is the version of PI you are working on?

    3. What exactly do you mean by statement " I want the adapter to pick only one file at a time rather than picking all the available files in the system." since adapter will actually pick up files one by one only in each polling interval. This goes in PI pipeline

    one after another in quick succession.

    4. Do you mean that you want to insert delays between successive file pick up then Baskar has already answered your question.

    5. Do you want the channel to pick up only one file in a day out of all possible file?

    6. Could you please kindly provide any sample file name you are receiving in PI ?

    regards

    Anupam

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 02, 2011 at 06:47 PM

    We are using PI 7.1

    As you said, PI File adapter picks up ALL files which have the same name (as mentioned in the file name section of the adapter). In this case we are receiving PO change information from vendor - the reason is we can receive multiple PO changes from the vendor at the same time, on the same PO. We need to process the file sequentially so that the old changes dont overwrite the new ones. That is the reason we are using file processing sequence as "By date" & the Processing mode as "Delete". But even then, if there are multiple files on the same PO, PI would pick both @ the same time and try to process (using idocs in ECC, in this case). This might lead to a locking issue of the same PO in ECC and the changes not getting updated in the system.

    Hence we want PI file adapter to pick one file @ one time.

    Thanks.

    Anuradha.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      The sequence 'By Date' is effective only in NFS mode. With FTP protocol, the files are always processed in ascending alphabetical order. So, you need to have a suitable file naming to process the files in sequence.

      Use EOIO QOS to achive sequencial processing in PI.

      if there are multiple files on the same PO, PI would pick both @ the same time .

      This is the default behaviour of file adapter with FTP protocol. You can try the approach Basker has mentioned.

      Once the files are picked,you cannot delay (wait) message processing in PI without BPM.

  • avatar image
    Former Member
    Aug 02, 2011 at 08:53 PM

    Try this approach

    1) In ECC partner profile for the inbound IDOC, select "trigger by background program" so that the IDOCs are NOT posted immediately

    2) In PI mapping, map the datetimestamp(pick this from the filename using dynamic configuration) to the SERIAL field in the IDOC control header.

    3) Your IDOC posting function module can use the function modules in this link http://help.sap.com/saphelp_nw04/helpdata/en/0b/2a66d6507d11d18ee90000e8366fc2/frameset.htm.

    You should see the IDOCs processed based on the datetimestamp in the IDOC header field. Try it and let know if it works

    Thanks

    Saravana

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 03, 2011 at 01:53 PM

    Use Serialization- BPM, which will allow you to send the files in sequence.

    refer to the link - http://help.sap.com/saphelp_nw2004s/helpdata/en/11/13283fd0ca8443e10000000a114084/frameset.htm

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 04, 2011 at 11:47 AM

    Hi Anuradha,

    The easy and the best way to process files sequentially is to have the Quality of Service as "Exactly once in order". That will process the files sequentially, and gives an alert if there is any issue with the file when alert configuration is properly done for the interface.

    Instead of going with BPM, this approach would be a better that I suggest.

    Thanks,

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 04, 2011 at 04:32 PM

    Hi Hareekumar.

    The solution you suggested seems to work very nicely. I have maintained QOS as "Exactly Once in Order" & processing Sequence as "by date".

    When the QOS is maintained as EOnce in Order - it asks for a queue name - i have specified one queue name whoch I saw was earlier being used by this message (When the QOS was maintained as Exactly Once.

    Is that OK? Is there any other way to determine which queue should be mentioned while specifying the sender file adapter?

    Thanks.

    Anuradha.

    Add comment
    10|10000 characters needed characters exceeded