Advertisement
Guest User

Untitled

a guest
Jul 30th, 2019
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 1.27 KB | None | 0 0
  1. cl_http_client=>create_by_url( exporting url                = i_url
  2.                                  importing client             = lr_client
  3.                                 exceptions internal_error     = 1
  4.                                            argument_not_found = 2
  5.                                            plugin_not_active  = 3
  6.                                            others             = 4 ).
  7.   if sy-subrc ne 0.
  8.     message 'Create client error' type 'I'.
  9.     leave to screen 0.
  10.   endif.
  11.  
  12.   lr_client->send( exceptions http_communication_failure  = 1
  13.                               http_invalid_state          = 2
  14.                               http_processing_failed      = 3
  15.                               others                      = 4 ).
  16.   if sy-subrc ne 0.
  17.     message 'Request send error' type 'I'.
  18.     leave to screen 0.
  19.   endif.
  20.  
  21.   lr_client->receive( exceptions http_communication_failure = 1
  22.                                  http_invalid_state         = 2
  23.                                  http_processing_failed     = 3
  24.                                  others                     = 4 ).
  25.   if sy-subrc ne 0.
  26.     message 'Recieve response error' type 'I'.
  27.     leave to screen 0.
  28.   endif.
  29.  
  30.   cr_response = lr_client->response.
  31.   free lr_client.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement