cancel
Showing results for 
Search instead for 
Did you mean: 

How to Send Large Amount of Records from Fiori via OData?

Former Member
0 Kudos

Dear Experts,

Could you please let me know what is the best approach while sending more than thousands or records(rows with columns to the tune of 7 to 10 columns) from an SAPUI5 application(like Exel Upload) to SAP Backend System vial an OData service?

Should we club each of the 100 records to a single OData call followed by 100-200 in second call followed by 200-300 etc?

Kindly let me know your thoughts.

Thank you,

Jakes

maheshpalavalli
Active Contributor

Can you tell more about your requirement? Like are you just uploading the data to the backend? or you read the excel data in the ui and perform some operations? If you can provide more information that would be great.

maheshpalavalli
Active Contributor
0 Kudos

Hey Jacob, I've answered to your question and one small tip, You can click on comment to reply or to provide more information as answers are dedicated to provide solutions only.

Thanks,

Mahesh

Accepted Solutions (1)

Accepted Solutions (1)

Krishnakumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Arun,

There could be performance issues if you process the file at UI layer and send the data in multiple batch calls. Instead I would suggest to send the whole file as an attachment to the back-end.

Now, if the file content is to be processed in to some transaction in backend, for huge files, the suggested method is to push contents of excel to a staging table with status (Z table) and return to UI with a message.

Contents of the staging table could be processed in background jobs updating the status. Once processing is complete you could update user with a Push Notification (Fiori Niotifications). Its better to take a reference/description from user while uploading and include this in the Fiori Notification. This way user could figure out which of his uploads has completed.

On click on notification, you could take user to a list report which shows processing status of the reference's execution.

As a rule of thump - Keep the UI simple and only for presentation

Former Member
0 Kudos

Thank you Krishnakumar, it looks excellent from the UI perspective. May be with an UploadSet or UploadCollection I could pick the file up from the user and transfer it to the Backend.

Thank you,

Jakes

Answers (1)

Answers (1)

maheshpalavalli
Active Contributor
0 Kudos

Hi Arun Jacob,

I would suggest you to use the stream operations in odata service and upload the attachment to the backend system and there you can read the attachment and the data using the excel tools. For e.g., https://github.com/ivanfemia/abap2xlsx or anyother FM if you have.

for ui5 and odata stream functionality, lots of blogs are there, one such:

https://blogs.sap.com/2018/06/22/media-handling-in-odata-in-sap-ui5/

Then in the backend, just process the data as you wish. This would increase the performance of your application by many times.

Thanks,
Mahesh

Former Member
0 Kudos

Hi Mahesh,

Thank you for your response. I am not looking at how to process Excel Data at Backend. I would like to know how we would split the OData calls from the Frontend(at SAPUI5 application processing step). Instead of passing all the data rows(for example, if the excel sheets had 500 rows), we would pass 1-100 rows in one OData call and 101-200 in second OData call etc.

Is there any better way?

Thank you,

Jakes

maheshpalavalli
Active Contributor
Arun Jacob, I thought you were looking for a way to improve the performance(as you were talking about multiple requests) So I suggested you the best way to increase the performance.As performance is not your constraint, you can go with 100 data in a request as more or less doesn't make any difference for your case.But in case if you want to look at the performance in sending multiple requests, it will be hard to judge it without checking the data and it will vary from one project to another project(depends on data), but what I would suggest is to look at the size of the request and determine the total rows that you can send. becuase if size is more, the request time will be more, which will obviously not be good. You should also try to send those requests parallely as again you don't want your user to wait for all the requests to be completed sequentially.So check if 100 or 200 makes any difference in the time taken for the request based on that derive your ideal number.Not the right answer you are looking for but hope it helps you.Thanks,Mahesh
former_member756037
Discoverer
0 Kudos

Can you please suggest me the vice versa? i.e. Sending bulk data to UI5 application in different calls, i.e 100 Records in first call, next 100 in second call and so on.