sap-tutorials / abap-core-development

Tutorials to support various abap products and functions.
Creative Commons Attribution 4.0 International
16 stars 18 forks source link

Learn the basic concepts required for the integration of SAP BTP, ABAP environment and SAP S/4HANA Cloud, public edition #1743

Closed gregorwolf closed 8 months ago

gregorwolf commented 8 months ago

Tutorials: https://developers.sap.com/tutorials/abap-environment-business-partner-scenario.html

As not everyone has an S/4HANA Cloud system at hand I would suggest to also show an option to use the Sandbox at https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER. I was able to use it by defining this destination in my subaccount:

URL=https\://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER
Name=s4businesspartner
ProxyType=Internet
Type=HTTP
Authentication=NoAuthentication

Unfortunately the additional property URL.headers.apiKey isn't taken into account by the BTP ABAP Environment. So I solved this by adding the following code to the ABAP console test class:

        ASSERT lo_http_client IS BOUND.
        DATA(lo_web_http_request) = lo_http_client->get_http_request( ).
        lo_web_http_request->set_header_fields( VALUE #(
            ( name = 'APIKey' value = 'Your api.sap.com APIKey' )
            )
        ).
AriannaMussoBarcucci commented 8 months ago

Hi Gregor, thank you for the feedback!

I discussed it internally in my team and we decided that this is not in scope for this tutorial group, as ultimately we want to show how to utilize OAuth SAML Bearer Assertion. We plan to adjust the tutorial in the future in such a way that it could be executed in one system.

Cheers, Arianna