cancel
Showing results for 
Search instead for 
Did you mean: 

Reading HTML Content using Web Dynpro ABAP

Former Member
0 Kudos

Hello,

I was wondering if it is possible to read the content (HTML) behind a given URL using Web Dynpro ABAP. If so, are there any functions available to parse the HTML ? I have been asked to develop an application that requires going to a URL, reading the content, and formatting a table from that content for presentaion within Web Dynpro ABAP. The HTML of the URL is nothing more than a "Table of Contents" to existing documentation ( Word Documents )

Thank you for any help / advice you can provide

Larry

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can get the HTML returned in a table using fm RSFO_HTML_REQUEST2.

Once you have that, you can convert it to a string using any number of methods. CL_RSR_WWW_RENDERER=>TABLE_TO_STRING should work fine.

One option for parsing it would be to get it converted into an iXML object, but you might have to do quite a bit of manipulation first depending on what the html looks like. You can see more info here on iXML classes: [http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm]

Otherwise I would just make use of find statements with regex patterns to sort through the html.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>You can get the HTML returned in a table using fm RSFO_HTML_REQUEST2.

Good advice all around. I imagine RSFO_HTML_REQUEST2 works for this situation, but I'm not sure the status of that function module. It doesn't sound like something reusable from the NetWeaver layer. I would instead recommend the use of the class CL_HTTP_CLIENT.

Former Member
0 Kudos

Thomas, thank you very much for your reply to Philip. I had a look in the forums to see discussion on CL_HTTP_CLIENT, and to get some perspective on its use. I will do some further investigation.

Larry

Former Member
0 Kudos

Phil, Thank you very much for your reply. I took at look at CL_HTTP_CLIENT, and some examples of its use posted in several forums, and believe this will work for me. As for the parsing, thank you for the information on class CL_RSR_WWW_RENDERER. I will further investigate.

Larry

Former Member
0 Kudos

I dont think so, as the rendering is not done in abap. I wish I could help you though.