Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Java script Response from ABAP

0 Kudos

I have a requirement to read HTML file from ABAP.

HTML file exists in customers' shared folder.

html header consisting of below codes ( Calling Jave script)

<SCRIPT type="text/javascript">

function Webpkt()


I am able to Call the HTML file from ABAP and can see the output in a browser.


Objective is to capture the above output in ABAP side and convert the whole file into a PDF file in ABAP


4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

I don't get the question.

If you get the HTML file via an URL (i.e. the HTML is the HTTP response), use CL_HTTP_CLIENT (lots of examples in the Web).

If you get the HTML file from a local file on your laptop, use CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD.

Etc.

abo
Active Contributor
0 Kudos
sandrarossi

the way I read it, the author wants to "print" a webpage to PDF from ABAP.

Sandra_Rossi
Active Contributor
0 Kudos

If you want to generate PDF from ABAP, there are two sources supported: ABAP List (WRITE), OTF (SAPScript, Smart Form). If you store them in a spool request, you might use respectively the function modules CONVERT_ABAPSPOOLJOB_2_PDF or CONVERT_OTFSPOOLJOB_2_PDF.

Juwin
Active Contributor
0 Kudos

To render an html page you need a browser first. Next, that browser should allow saving or printing what you see as a pdf.

ABAP is not a Web browser that can render web pages. Hence, this requirement can't be achieved by just using ABAP.