DATA: lv_no_logon TYPE abap_bool VALUE abap_true.
DATA: lv_url TYPE swk_url VALUE 'https://google.de'.
DATA: lv_user TYPE char50.
DATA: lv_passwd TYPE char50.
DATA: lv_timeout TYPE i VALUE 60.
DATA: lv_length TYPE i.
DATA: lv_status_code TYPE char3.
DATA: lv_status_text TYPE char128.
DATA: it_head TYPE STANDARD TABLE OF docs WITH DEFAULT KEY.
DATA: it_body TYPE STANDARD TABLE OF docs WITH DEFAULT KEY.
* HTTP Get
CALL FUNCTION 'HTTP2_GET'
EXPORTING
absolute_uri = lv_url
user = lv_user
password = lv_passwd
timeout = lv_timeout
no_logon = lv_no_logon
IMPORTING
status_code = lv_status_code
status_text = lv_status_text
response_entity_body_length = lv_length
TABLES
response_entity_body = it_body
response_headers = it_head
EXCEPTIONS
connect_failed = 1
timeout = 2
internal_error = 3
tcpip_error = 4
data_error = 5
system_failure = 6
communication_failure = 7
OTHERS = 8.
IF sy-subrc = 0.
cl_demo_output=>write_data( lv_status_code ).
cl_demo_output=>write_data( lv_status_text ).
cl_demo_output=>write_data( lv_length ).
cl_demo_output=>write_data( it_head ).
cl_demo_output=>write_data( it_body ).
* HTML-Code vom Demo-Output holen
DATA(lv_html) = cl_demo_output=>get( ).
* Daten im Inline-Browser im SAP-Fenster anzeigen
cl_abap_browser=>show_html( EXPORTING title = 'HTTP2_GET'
html_string = lv_html
container = cl_gui_container=>default_screen ).
* cl_gui_container=>default_screen erzwingen
WRITE: space.
ENDIF.