cancel
Showing results for 
Search instead for 
Did you mean: 

Error while making a HTTP request from ABAP REPORT PROGRAM

rohitsharma34673
Explorer
0 Kudos
255

I am trying to make a post request to an extrnal URL to fetch the CSRF token details which are further required to make a get request. I have attached the code below. The code is working fine in the ECC system but it is giving the error in S/4 system. Is the error related to some system configuration?

Error Text:- IcmConnInitClientSSL: Proxy connection to https://internal.yamaha-dealers.com:443 via proxy:3128 failed

CODE:-

cl_http_client=>create_by_url(
    EXPORTING
      url    = 'https://internal.yamaha-dealers.com/oauth2/endpoint/YMUSProvider/token'
      proxy_host 'proxy'
      proxy_service '3128'
   IMPORTING
     client ro_client
     ).
    ro_client->refresh_request).
    ro_client->request->set_versionif_http_request=>co_protocol_version_1_1 ).
    ro_client->propertytype_logon_popup 0.

    "Set Method
    ro_client->request->set_method( 'POST').

    "Set headers
    ro_client->request->set_header_fieldsit_header_fields ).

    DATA(lo_requestcl_rest_message_builder=>create_http_message_entityro_client->request ).
    lo_request->set_content_typeiv_media_type = 'application/x-www-form-urlencoded' ).
    lo_request->set_string_data( 'grant_type=password&client_id=sap_user&client_secret=$someValue&username=U:externalService:sap_user&password=someValue' ).

    ro_client->request->set_header_fieldname  if_http_header_fields=>accept
                                          value if_rest_media_type=>gc_appl_www_form_url_encoded ).
it_header_fields:-

MuditJain_0-1728970291112.png

Please let me know if any more info is required.

@SAPSupport @DominikTylczyn @Mrak1 @fabio_perfetto @Margit_Wagner @AndreasMuno @Dsk @Enda @Christian_Ries @tamas_hoznek @Sandra_Rossi 

View Entire Topic
rohitsharma34673
Explorer
0 Kudos

Can you please tell how can we check is ssl certificate in strust? I am new to SAP.

@abo 

abo
Active Contributor
0 Kudos
Run t-code STRUST and compare the certificates. Since you may lack authorization to upload new certificates, perhaps it is better to involve your Basis team