cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PO - 7.5 SOAP Response URL PDF file to BASE64

julian_baldner2
Explorer
0 Kudos

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

View Entire Topic
former_member189420
Active Participant
0 Kudos

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

julian_baldner2
Explorer
0 Kudos

Hi Anand,

do you have some sample coding for this ?

Thanks and best regards,

Julian

former_member189420
Active Participant
0 Kudos

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