cancel
Showing results for 
Search instead for 
Did you mean: 

Get Non SAP : URL file as Xstring or binary string

former_member599147
Discoverer
0 Kudos

Hi.

Has anybody an idea if there is an URL for Preview Scanned document file need to convert the preview file as Xstring or binary tab?

Idea is export a URL file

https://smartuat.gep.com/P2P/PreviewInvoiceById?dd=YnBjPTE5ODc5OCZkYz0yODE0MjU1&oloc=107

and get back an Xstring or binary tab.

Would really need your help.

Thanks in advance for all your ideas.

Alok

Sandra_Rossi
Active Contributor
0 Kudos

Difficult to understand what you say. An HTTP request returns bytes only, how can it be xstring or binary tab? The response of any HTTP request can be read, so what's the problem? Please give more details.

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor
0 Kudos

Use the class CL_HTTP_CLIENT to read the response from URL (the methods create_by_url, send, receive, and then response->get_data).

More info: SAP Library: Example Program: Executing an HTTP Request

Answers (2)

Answers (2)

Tomas_Buryanek
Active Contributor

TIP - If you read a HTML of that PreviewInvoiceById page you can find, that there is another service (GetPDF) which returns PDF file. You can ask provider for more info.... But that is not about ABAP. For ABAP part see Sandra's answer.

.../P2P/GetPDF?...
Sandra_Rossi
Active Contributor

Well seen 🙂

former_member599147
Discoverer
0 Kudos

Hi Sandra,

I need to get that PDF which is showing in URL link and pass it for GOS attachment in MIR4 as a PDF attachment not as URL.