Skip to Content

File/SFTP adapter - Read a file .dat only when .job file exists

Hi Experts,

I need help in designing an interface with File adapter or SFTP adapter only in SAP PO 7.4. Requirement is to read a file called ".dat" in a third party system only when ".job" file exists, the filenames will be the same but the extensions are different. Based on the filename of .job the corresponding .dat file alone should be read and also content conversion needed for the ".dat" file. I am using SAP PO 7.4.

Please suggest me a best approach to do this.

Thanks & Regards,

RV

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 09 at 10:07 AM

    Hi RV!

    Isn't "Additional files" option of sender file channel what you're looking for?

    https://help.sap.com/saphelp_nw73/helpdata/en/44/682bcd7f2a6d12e10000000a1553f6/frameset.htm

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 09 at 06:42 AM

    Hi RV,

    I guess, you should have to go with OS command to achieve the above requirement.

    Regards,

    Manoj Kumar

    Add comment
    10|10000 characters needed characters exceeded

    • Manoj,

      Yes this is one option I had in my mind. But want to know whether the

      1. OS command works in the third party system?

      2. I want to read only the .dat file when .job file exist. How you will have this condition with OS command? Because I want to read the .dat and do content conversion and I am doing nothing with .job file.

      Thanks & Regards,

      RV

  • Feb 22 at 09:03 AM

    Hi RV,

    Another option could be to do the poll only to the .job file, then at mapping level do a file lookup to the .dat file (https://blogs.sap.com/2016/04/30/file-lookup-in-sap-pi-using-udf/).

    If you don't need to do a map or to use SFTP, that option can be weird. Then, i would do a little trick if you have an SAP ERP involved. You do the pool for the .job file and to call an ERP RFC/proxy and this start a second scenario to poll the .dat file: https://blogs.sap.com/2011/05/24/startstop-a-communication-channel-from-an-abap-program-using-the-external-control-switch/

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Inaki,

      I have created 2 ico - 1 for executing with *.job with OS command to move the *.dat to different folder if *.job exists. 2nd interface will directly pull the *.dat and do the content conversion. I am not sure whether its a best design but it is working now.

      Thanks for showing me an another option "File Lookup" I will explore that option too whether its feasible to use in my interface.