Skip to Content
author's profile photo Former Member
Former Member

File Attachments Approach in Gateway

Hi All,

We have got one requirement in Gateway. We are builiding some FI document creation application using GW and HTML UI 5 as a frontend. User has to upload the files into SAP while creating FI document. So we have to get the binary data from the frontend ( which is any format file like .xls, pdf, .txt etc) and archive that into content server. I have done some POC and got few questions & thought of discussing with all of you for better design & solution.

1. As of now, i have implemented the create_deep_insert method to get the header and line item details & this method is working fine and implemented update_stream to get the binary data from the front end.

Question :Would it be possible to take the normal data & binary data in the single service call. That means, when user enters the Finance document header data, line item data and upload file at front end, then would it possible to send all these in the single service call.

Because, as per the business process, user has to attach the document and then create the FI document. But in our normal SAP process, i have to create the FI document first in SAP and then archive the file by linking the fi document which was created.

So issue here is, Front end application has to wait till i return the create_deep_insert response back to them & then they have to call the attachement collection to update the file. So is there any way to club normal data and binary data in the same entity.

2. After implementation of the Update_stream ( im using this as i have to take some key fields, which is not happening in create_stream method ) , i have tested from the /iwfnd/gw_client by clicking on ADD FILE button. It is working as expected and file got archieved. But how to get the payload xml file to pass this binary stream.

If i give xml file like attached .txt, it is taking that whole XML as a stream rather than value tab data.

 

3. Would it be possible to upload more than 1 file in the single service call from the front end application?

I really appreciate your thoughts, solutions, messages on this topic & i have searched the SCN before posing this message for same kind of messages.

Thanks and Regards,

Naveen Veshala

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 11, 2013 at 02:43 PM

    Hi Naveen,

    Its raining questions.. 😊

    I will pickup third one for now.

    As per OData, you can only update one file at a time.

    Thanks

    Krishna

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Naveen Veshala,

      Thanks for sharing your experience on this POC.

      I am working on a similar wherein I need to send across a PDF attachment from R3 onto a UI5 approval application for display.

      Can you please elaborate the approach in a little more detail?

      Especially I am not able to make out which update_stream method you are talking about.

      Appreciate your response.

      With regards,

      Sahir.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 25, 2014 at 04:34 PM

    Hello Naveen,

    1. U cannot fire Create_Deep_Entity and Create_Stream in one call.

    But have a look at this :

    Uploading Files to SAP GW, Downloading Files from SAP GW - New Techniques

    Generally i feel standard would to first fire Deep entity service and then fire the attachment service to upload media content.

    2. Keys fields can be sent from UI to GW via SLUG parameter during Firing Create_Stream method 😊.

    In GW level Only thing needed is to attachment the file and send appropriate headers to fire the Create_Stream method.

    No explicit conversion to binary and thing like that is needed. GW itself will take care of everything.

    3. Only one attachment in one call.

    Regards,

    Ashwin

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.