Script 1
Hi, I am Denys van Kempen from the SAP Partner Innovation Lab and the SAP HANA Academy.
In this video tutorial series, we are going to show you how you can integrate the ABAP
environment of the SAP Business Technology Platform with SAP S/4HANA Cloud.
This video was recorded in May 2021; for the latest video tutorials on the topic, please
check the playlist.
okay, what we are going to cover in this tutorial you can find documented on the SAP Help Portal,
in the BTP guide, under Development, ABAP environment, Integration and Connectivity,
For this scenario, two authentication methods are supported: username password (basic authentication)
and OAuth 2.0, which we are going to cover in this video
Here we have an illustration What we need to do is to create a communication
arrangement for the scenario, with a communication system and a communication user in our SAP
S/4HANA Cloud system, and on the Business Technology Platform side,
we need to define a destination for the reference.
Previously, we had to create a service instance of the destination service and create a destination
with communication arrangement 276 in the ABAP environment, but this is no longer required.
Now, defining the destination at the BTP subaccount level suffices, which makes this a little
easier to configure.
For our use case, we will be using one of the predefined communication scenarios, SAP_COM_0008
for business partner, customer, and supplier integration.
There are many others and you can look them up on the SAP API Business Hub for S/4HANA
Cloud Here we have the Business Partner API
The different calls GET, POST, PATCH, DELETE
the different entities all documented
and as mentioned, there are many other APIs to choose from
If you would like to read some more about how this works with communication systems,
users, scenarios, arrangements, you will find this documented in the Extend
and Integrate your SAP S/4HANA Cloud guide under Communication Management
Then, once we have set everything up, the administrator passes the baton to the developer,
who needs to create the service definition from the downloaded metadata of the business
partner API. and in the code,
reference the destination and the API
first things first, let’s set up our environment What do we need?
well, an SAP S/4HANA Cloud tenant, obviously, and a user that can create the communication
arrangements, requires the SAP_CORE_BC_COM privilege
We also need an ABAP Environment, with a user privileged to create destinations in the subaccount.
I am connected here to the business technology platform, BTP,
with the BTP cockpit, enter my subaccount,
and navigate to destinations, when we hover over the Download Trust link,
we can read that this allows us to download the subaccount-specific key to set up OAuth2SAMLBearer
principle propagation to other remote systems.
What this means, to return to our illustration,
is that when our program makes the API call to S/4HANA Cloud
it will pass an OAuth token with information about the user’s authorizations, the user
is the principle that’s being propagated, We are mixing SAML and OAuth here,
SAML comes from the identity provider, The technical details are a bit dense, there
are the usual IETF proposals where you can find out how this work exactly
Download the trust, and switch to S/4HANA Cloud
Communication Management Communication Arrangement
New Enter scenario
0008 in our case give it a name
create Next, create the communication system
give it a name create
scroll down to OAuth 2.0 identity provider Upload signing certificate
and then copy paste the common name, CN, from the signing certificate issuer, to the provider
name field.
Note that the user ID mapping mode is user name, not user UUID
Then we need to provide the URL of our ABAP environment instance,
For this, we need to return to the BTP Cockpit, instances and subscriptions
ABAP environment Service keys
view and select the hostname from the URL
copy paste
and enter a name for the logical system the name must be unique, but in this case
the actual value is not relevant, it would be required for outbound communication,
which is also included in scenario SAP COM 0008, but we are not using this in our case.
Next, we need to create a user for inbound communication,
click the plus New user
The documentation recommends to use the same name as for the communication system,
to remind ourselves that they are related, Also recommended is to use the proposed password,
a random string, make sure to copy the entry and save it to
a file, as we will be needing this when we create the destination
Create OK
Now, we also need to define a user for outbound communication,
again, we will not be using this, so just select the +
and instead of user name and password, select SSL Client Certificate, default
Create Now we can save our
communication system Then the only thing left to do is the scroll
down to the Outbound services, there are a couple, and make sure that they are all deactivated
by default, the box will have been ticked, you need to remove the selection, and do so
for all outbound services, again, as we won’t be using them
That’s it, save the communication arrangement and we are done.
Before we return to the ABAP environment, there are a couple more entries we need to
copy one is the host name of the inbound service
URL besides outbound services, scenario SAP COM
0008 also includes IDocs and SOAP definitions for inbound services,
but we are only concerned here with the OData one
Then, select OAuth 2o details and copy the values for Client ID, user name, token service
URL, and SAML 2 audience Back to BTP
Destinations New Destination,
Note that we are at the subaccount level, no need to create a destination service instance,
as mentioned, and here we going to paste them in
Name can be any value, although we will be referencing this in our code later on,
URL is the inbound service URL Authentication OAuth2SAML Bearer Assertion
In the Audience field we need to paste in the SAML 2 audience URL
Client key corresponds to the client ID, the communication system
Token service URL, the same Token service user and password, our communication
user with password Then we also need to add a property,
select nameIdFormat from the list and paste in a value which we need to grab from the
documentation.
Save To check the connection, we will need to write
some code.
As a reminder, here we have the illustration.
With the step-by-step tutorial hosted on the SAP Dev Center,
Using ABAP Development Tools, add a Service Consumption Model to your package,
Give it a name with description, Remote consumption mode is OData
Then we need to point to the service metadata file
For this, go to the SAP API Business Hub Log on,
and navigate to S/4HANA Cloud, OData, Business Partner API
Details tab, Download API specification, format EDMX
Select the file, Select the entity sets, by default all are
selected, the ABAP artifacts are listed
this takes some time, and the service consumption model is generated
next, create the HTTP service paste in the sample code from the tutorial
to provide the IF HTTP SERVICE EXTENSION HANDLE method
you might need to update the reference the tutorial assumes a shared environment
and includes a suffix to make the entry unique this may or may not apply to your environment,
save and activate the objects, if we then return to our service,
and click th URL link we will be prompted to authenticate with the
business technology platform, the identity provider in this scenario,
and a business partner will have been created in S/4HANA using OAuth
We can check the value in our S/4HANA Cloud tenant,
Note that we need to log on, there is no under-the-hood session or anything,
and then under maintain business partner, we can look up our entry,
of course, this is a very basic example, just to show how this all works.
okay, so much for integration of the SAP Business
Technology Platform ABAP environment with SAP S/4HANA Cloud.
See the description below of this video on our YouTube channel for more information
Don’t forget to subscribe Denys van Kempen, SAP HANA Academy / Partner
Innovation Lab Thanks for watching