cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

File Attachments Approach in Gateway

former_member265047
Active Participant
0 Kudos
2,593

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

View Entire Topic
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