Code: Alles auswählen.
CALL METHOD cl_http_client=>create_by_url
EXPORTING
proxy_service = '8080'
* ssl_id =
* sap_username =
* sap_client =
IMPORTING
client = lo_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
CALL METHOD lo_client->authenticate(
EXPORTING
proxy_authentication = 'X'
client = '200'
language = 'D'
).
CALL METHOD lo_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
OTHERS = 5.
IF sy-subrc <> 0.
RAISE connection_error.
ENDIF.
CALL METHOD lo_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 4.
Code: Alles auswählen.
" Holen der Daten in XSTRING-Format
DATA(lv_bin) = CONV xstring( lo_client->response->get_data( ) ).
DATA: lt_data2 TYPE TABLE OF x255,
lv_len TYPE i,
ls_result TYPE string,
ls_compare_string TYPE string.
* ls_id_orig TYPE string.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_bin
IMPORTING
output_length = lv_len
TABLES
binary_tab = lt_data2.
CALL FUNCTION 'SCMS_BINARY_TO_STRING'
EXPORTING
input_length = lv_len
IMPORTING
text_buffer = ls_result "here, you find the truth!
TABLES
binary_tab = lt_data2.