Professional Documents
Culture Documents
cl_http_client=>create_by_destination(
EXPORTING
destination = 'ANUBHAVTRAINING' " Logical
destination (specified in function call)
IMPORTING
client = data(lo_http) " HTTP Client
Abstraction
EXCEPTIONS
argument_not_found = 1 " Connection Parameter
(Destination) Not Available
destination_not_found = 2 " Destination not found
destination_no_authority = 3 " No Authorization to Use HTTP
Destination
plugin_not_active = 4 " HTTP/HTTPS communication not
available
internal_error = 5 " Internal Error (e.g. name too
long)
others = 6
).
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
lo_http->send(
EXCEPTIONS
http_communication_failure = 1 " Communication Error
http_invalid_state = 2 " Invalid state
http_processing_failed = 3 " Error when processing method
http_invalid_timeout = 4 " Invalid Time Entry
others = 5
).
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
data(result) = lo_http->response->get_cdata( ).
cl_abap_browser=>show_html(
EXPORTING
title = 'anubhavtrainings.com' " Window Title
html_string = result " HTML String
).