Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to load a web into table

Hi all,

I have generated HTML page to make a demand in one server. This page returns me another page which I can see perfectly in the GUI browser if I execute this code.

CALL METHOD HTML_EXPLAIN->LOAD_DATA
   IMPORTING
    ASSIGNED_URL = URL_DOC
   CHANGING
    DATA_TABLE = HTML.

  CALL METHOD HTML_EXPLAIN->SHOW_URL
   EXPORTING
    URL = URL_DOC.

My problem is I need put the information displayed in the browser in one internal table, but I don't know how to achieve this. Any help?

Thank you very much.

Tags:
Former Member
Former Member replied

Hi,

i do it in this way:

TYPES: BEGIN OF TY_,

LINE(132),

END OF TY_.

*

DATA: HEAD_RES TYPE TABLE OF TY_.

DATA: BODY_RES TYPE TABLE OF TY_.

DATA: HEAD_REQ TYPE TABLE OF TY_.

DATA: BODY_REQ TYPE TABLE OF TY_.

*

DATA: URI(128).

*

URI = 'http://www....'. -> Your www-address

*

CALL FUNCTION 'HTTP_GET'

EXPORTING

ABSOLUTE_URI = URI

RFC_DESTINATION = 'SAPHTTP' "s. THTTP PräsenServer

  • RFC_DESTINATION = 'SAPHTTPA' "s. THTTP AppliServer

BLANKSTOCRLF = 'Y'

TABLES

RESPONSE_ENTITY_BODY = BODY_RES

RESPONSE_HEADERS = HEAD_RES

REQUEST_ENTITY_BODY = BODY_REQ

REQUEST_HEADERS = HEAD_REQ

EXCEPTIONS

CONNECT_FAILED = 1

TIMEOUT = 2

INTERNAL_ERROR = 3

TCPIP_ERROR = 4

DATA_ERROR = 5

SYSTEM_FAILURE = 6

COMMUNICATION_FAILURE = 7

OTHERS = 8.

*

Regards, Dieter

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question