on 07-16-2021 1:52 PM
Dear community,
we have the following request.
We have a synchronous scenario to call a webservice from SAP ERP to an external provider.
Within the webservice response we have a field containing an URL to download a PDF.
The request is to retrieve the PDF and to convert it to BASE64 and pass the BASE64 within the response message back to ECC. Any idea how to handle this quite smoothly UDF etc ?
Thanks for all your answers - highly appreciated.
Julian
Hi Julian,
I have recently done something similar.
1. In the response mapping, execute the http call within the UDF to the URL directly or you can call a HTTP_AAE communication channel within the udf.
2. Once you have the response i.e. binary pdf document - use Base64.getEncoder().encode(byte[]) to get the base64 formatted data.
3. The Base64 encoded data can be passed back over ABAP proxy to ECC.
4. In ECC, depending on your requirement you may have to convert back from Base64 to Binary - refer to https://blogs.sap.com/2019/03/29/base64-function-modules-in-sap-abap/
Hope that helps!
Regards,
Anand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Julian,
Unfortunately, I don't have access to the system I had done that.
You may get some idea regarding how to call the external url within the UDF here - https://answers.sap.com/questions/242015/operating-communication-channel-externally-using-u.html
Hope that helps!
Regards,
Anand
User | Count |
---|---|
70 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.