2025 Apr 18 8:29 PM - edited 2025 Apr 18 8:33 PM
Hey there. ABAP developer here that is slowly learning Fiori/RAP. I am building a RAP application in Eclipse using SAP Fiori Elements, that is based on a older SAP program we have using one underlying database table. I am trying to mimic some print to PDF functionality and my main question is how we can send a base64 file/file type from the ABAP backend to the fiori elements front end?
In our current SAP program, clicking this particular print button will prompt the user to select a document to print for the selected table row data. Backend ABAP logic will then generate a JSON request -> REST call -> and in the JSON response we have some document binary data that is converted to Base64. We then use SAP "cl_gui_frontend_services" to download the file, usually in PDF format. Document then opens up on users screen. This is what I want to mimic in RAP. I currently have a OdataV4 service exposing my database table through CDS entities. I created a action event in my behavior definition that generates a "Print" button on the front-end.
So far my Print action event in my RAP app, I have the code in place to retrieve the binary data from the response of the REST call which is working correctly. Now I'am trying to work through sending the base64/file type of this RAP action event to the front-end so that the user can see the document. I'm currently doing some research on this, and have found some other articles on this particular subject, but most of them are for uploading files/attachements. I believe its the same functionality that I am looking for, but I wanted to ask if anybody has had any similar requirements?
__PRESENT
__PRESENT
__PRESENT
__PRESENT
__PRESENT
Request clarification before answering.
I have implemented an Excel upload & download functionality using RAP and Fiori elements before. The backend returns Base64 encoded binary and the frontend parses the data and downloads the file.
The steps are described in the post below (in Japanese).
https://qiita.com/tami/items/e030ad2ce87d26dd3b75
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello jctx15,
I think you can extend Fiori elements by using the custom button, then implement the logic with JavaScript. In the background, you can develop an OData service that implements generating the PDF file (binary). The JS can call the OData service and print it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
22 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.