Skip to Content
avatar image
Former Member

FTP and "File-in-use"

Dear all,

We have a scenario in which a file is written to the SAP application server which should be picked up by XI using the FTP adapter. The polling interval of the adapter is set to 60 seconds.

We running into a strange problem: it may occur that the program on the SAP application server is still busy writing the dataset to the server, however the file already exists (as soon as the OPEN DATASET statement is passed the file is created on the application server but with no content yet). If just at this time the interval of 60 seconds is passed the FTP-adapter picks up the empty file, does no processing because the file is empty, but still archives the file to an archive directory.

Obviously the OPEN DATASET does not put an exclusive lock to the file? Does anyone know a solution to this?

Kind regards,

John.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 23, 2008 at 04:32 PM

    Hi John,

    In your file sender communication channel there is a parameter in Additional Parameters. MSecs to Wait Before Modification Check. Put some 'x' value. So the file adapter waits for 'x' time if the file is still writing.

    Regards,

    ---Satish

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 23, 2008 at 04:55 PM

    Hi John,

    A better approach would be to create the file in a different folder than the one XI polls. Once it is completed move it to the directory that XI polls. This way XI would never get an empty file or a file which is under processing by your DB.

    VJ

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 23, 2008 at 05:54 PM

    Hi,

    use .tmp extension to the file untill it completes writing the data, then change it to original extension.

    for eg: if it is a .txt file then use .tmp untill the file is written and then change it to .txt this is not a big logic at SAP, just renaming the file after completing the write.

    Regards,

    Karan.

    Add comment
    10|10000 characters needed characters exceeded