cancel
Showing results for 
Search instead for 
Did you mean: 

File Attachments Approach in Gateway

former_member265047
Active Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

AshwinDutt
Active Contributor
0 Kudos

Hello Naveen,

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

But have a look at this :

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

kammaje_cis
Active Contributor
0 Kudos

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

former_member265047
Active Participant
0 Kudos

Hi All,

FYI, I have checked with SAP and as confirmed by them SAPUI5 offers a file upload control which cannot directly send data to Gateway using OData services. Hence we have used traditional approach using RFC function module and completed the attachment functionality. So i suggest that in case of similar requirement in your projects, then do some POC initially and take up the task as i have invested lot of time on update_stream method and finally it did't work from UI5.

I'm closing this thread and thanks for all  your support.

Regards,

Naveen Veshala

sahirn
Active Contributor
0 Kudos

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.