cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to call BTP destination from ABAP console program

mchrista
Participant
0 Kudos

Hi all,

we are working in the ABAP cloud environment and have a customer instance. We want to connect to our on-premises SAP ECC system from an ABAP console program. Therefore, we use the method "create_by_cloud_destination". The strange thing is, that it works from the Fiori-UI, but it raises an exception, when we call it from an ABAP console program with the message "Destination service lookup failure HTTP communication error.".

Method if_oo_adt_classrun~main.
Data:
  filter_factory type ref to /iwbep/if_cp_filter_factory,
filter_node type ref to /iwbep/if_cp_filter_node, root_filter_node type ref to /iwbep/if_cp_filter_node. Data: http_client type ref to if_web_http_client, odata_client_proxy type ref to /iwbep/if_cp_client_proxy, read_list_request type ref to /iwbep/if_cp_request_read_list,
read_list_response type ref to /iwbep/if_cp_response_read_lst.
Data(http_destination) = cl_http_destination_provider=>create_by_cloud_destination( i_name = 'SAP_Gateway' ). Endmethod.

Does anybody has a solution on this? Why is it working through the Fiori UI but not in ABAP console?

mchrista
Participant
0 Kudos

andre.fischer : Do you may have any ideas on this?

Accepted Solutions (1)

Accepted Solutions (1)

Hi Michael,

the create_by_cloud_destination takes a parameter i_authn_mode, which defaults to user_propagation.

As documented in the SAP Help Portal (straight at the bottom) and in the Note on this site user propagation does not work within the ADT class runner, but only in the context of a service call (OData, HTTP..).

If you use a technical authentication mechanism in your destination (e.g. Basic Auth or OAuth Client Credential Grant), you can simply switch i_authn_mode to service_specific. This will then also work from within the ABAP console. If you actually use a principal propagation mechanism, then this will not work from within the ABAP console.

Best Regards,

Thomas

mchrista
Participant
0 Kudos

Hi Thomas,

thank you very much. That was the information, I was missing out.

Best regards
Michael

Answers (0)