cancel
Showing results for 
Search instead for 
Did you mean: 

1. Can users push data on the screen from Excel? 2. Is it possible to use Windows API?

0 Kudos

Hello experts,

I'm making a CAP app with Fiori UI, and I have two questions.

1. Can the user push data from Excel to the screen from the web page?

I'd like to know if users can save Excel's data after uploading it to the screen like Business One.

2. Is it possible to use the Windows API in CAP app?

If any of these are possible, please give me a hint on how to make them.

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi dawonbaek,

1. Can the user push data from Excel to the screen from the web page?

Short answer is yes. SAPUI5 has different web components to handle file uploads. For instance:

- for mobile "sap.m": https://sapui5.hana.ondemand.com/#/entity/sap.m.UploadCollection

- for desktop "sap.ui": https://sapui5.hana.ondemand.com/#/entity/sap.ui.unified.FileUploader

The long answer: You would need to store this file somewhere on the sever for later processing. Therefore, the recommended way would be to store it into BTP Document Services or on BTP Cloud Storage (S3), since it is not recommended to store files inside the filesystem of the application itself because they aren't persistent. If you are integrating your front-end into an SAP ERP, then you could store this file on DMS (ABAP). Why store the document somewhere for later processing? Yes, you could process it directly in-memmory in a Java Application or NodeJS. However, you might face out-of-memory issues with very large files. Ideally, the microservice that processes this file should do it so by means of a file stream - which would make it more robust in terms of memory consumption. You could also process the file locally on the browser itself.

2. Is it possible to use the Windows API in CAP app?

Which Windows API are you talking about. CAP is able to consume any type of API (SOAP, REST or OData) inside a service's method. So, CAP would implement its own CDS service and you would make calls to any APIs inside the custom implementation handler. If the "Windows API" you are referring to the Windows API that handles Files, that is indirectly covered by the SAPUI5 library via Browser's JavaScript. When you implement the above mentioned web components, your front-end will handle files via JavaScript. Thus, any OS API calls that need to take place will be done according to the browser's JavaScript implementation.

It is also worth mentioning that you could upload data into a Hana Cloud Database directly from Excel in several ways:

https://blogs.sap.com/2021/07/28/access-sap-hana-cloud-data-via-excel/


Hope this helps.

Best regards,
Ivan

Answers (0)