Skip to Content
avatar image
Former Member

Read uniquely named file. Sender File Adapter unsuitable for synchronous

Hi All,

We have a requirement to read a specific file that has a unique name based on a transaction ID. The transaction ID will be passed from the source application.

The communication is required to be synchronous. There could be multiple requests/files generated and present at the directory at any given time but each corresponding to a specific transaction ID. If the file is not yet generated for that transaction ID we return back an error to the calling system.

I think we can not use Sender File Adapter - because of the dynamic naming and also because we have to return a synchronous response back depending on the file availability. i.e. We can not have a defined pattern in the file name nor can we specify a wild card as there could be more than one files in the location.

In theory we could use the File Sender adapter to read all the files in the directory and a BPM with correlation set based on the transaction ID and let the process wait for the request. But as far as possible I want to avoid this unnecessary wait or extra demand on the system. More so because the files could get big.

If I were using a tool like SAP Business Connector or webMethods then I would I used a readFile Java service and given it a filename to return the required bytes in a synchronous read.

Is something like this possible in XI? If someone has written a synchronous Java to read file can they share the code? Or do you suggest I write a ABAP server proxy to read the file? The problem however will be how do we map the data to a XML within the code.

All suggestions welcome. There has to be a simple and effective solution to this mundane requirement !

Wishing all SDNers a bright start to this new year,

Thanks,

Charu

Message was edited by:

Charu Kulkarni

"The transaction ID will be passed from the source application so we know what file to pick"

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jan 02, 2007 at 10:41 PM

    I guess you may have to go for custom adapter or adapter modules for doing this.

    --Archana

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Vijaya,

      Thanks for the suggestion. I have just edited my message to make it clear that the transaction ID will be passed from the source application. So XI does not have to be knowledgeable about uniqueness or maintain history. Do you still think we have to use a Module Adapter?

      Regards,

      Charu

  • Jan 02, 2007 at 10:47 PM

    Hi,

    you can also consider using sync java proxy

    then you'd have to call it with the filename

    (don't know how you get this transaction ID)

    and inside the proxy use the filename if not successful

    then raise an error if not you could just copy the file

    to other folder which would take successful files (standard file adapter)

    for example

    Regards,

    michal

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Michal Krawczyk

      We are on webAs 640 and we do not have Java skills so I guess our preference will be to write a ABAP server proxy to read the file and move the file. Any problems with this approach?

  • avatar image
    Former Member
    Jan 03, 2007 at 04:25 AM

    Hi,

    You could make the scenario a little simple and avoid custom development if the logic can be put into scripts(out of XI).

    Say all the files are coming into a directory called D1.

    Here, you could use a script to arrange all these in an order (say ascending) and move the first file into another directory D2.

    The sender file adapter would poll this directory D2. The adapter can have a wild card character for the filename field now.

    Once the file is in XI, you could check this against the transactionId present(I am not sure how you get this though!), and determine whether to send a mail, or to send a file back.

    Here, I have assumed that there is somekind of order present in the files placed in the directory D1.

    Again, this is just a suggestion.. I might be wrong with all the assumptions. 😊

    Regards,

    Smitha.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2008 at 08:31 PM

    We used a ABAP Proxy

    Add comment
    10|10000 characters needed characters exceeded