This blog post will explain how to expose a CDS view as an API using developer extensibility in SAP S/4HANA Cloud Public Edition to be consumed in the SAP Business Technology Platform
Extending our solutions allows you to differentiate yourself from the competition, simplify processes, and adapt the software according to the specific needs of your business.
In the case of SAP S/4HANA Cloud Public Edition, we have three types of extensibilities:
You can find further information about all extension offerings here
Typically, details can be found regarding instances where the SAP S/4HANA Cloud Public Edition is extended using a single kind of extension. Here, we're dealing with developer extensibility, which, given the right configuration, can be revealed through an Identity and Access Management (IAM) application. This can then be linked to the SAP Business Application Studio as a side-by-side extension.
This blog will cover both Developer extensibility and side-by-side extensibility
After installing Eclipse, go to Help -> install new Software.
For installing the latest tools, please enter the URL https://tools.hana.ondemand.com/latest
Select ABAP Development Tools and after clicking on Next and confirming the Licenses agreements finish the installation.
More information can be found here
Go to Eclipse and create a new ABAP Project. After this, you can establish a service instance connection by entering the ABAP service instance URL, for example https://my12345.s4hana.ondemand.com (without ui) and selecting Next.
Now you will need to log on the system, please use the default browser by selecting Open Logon Page in Browser or Copy Logon URL to Clipboard to use another browser.
After correct Login, create the project by selecting Next. Then, specify the logon language and the ADT Project name and choose Finish.
After correct logon, the following message will appear on the browser. Now you can go back to Eclipse.
To review the available APIs, go to the SAP Business Acceleration Hub visiting https://api.sap.com and choose the one you need.
After entering the page, choose the product to explore, in this case SAP S/4HANA Cloud Public Edition, then go to developer extensibility, Business Object Interface, and choose the Business Partner object. In the general information of the Business Object Interface, you will find the object ID. Copy it.
CDS or Core Data Service, refers to virtual data models of SAP HANA, used to define and consume semantic data models on the central database of the application server AS ABAP. A CDS Entity is basically source code in the CDS data definition, DDL or Data definition language, and DCL or Data control Language, are the base of this data models. Further information can be found here
Click on the package you want to use, and go to file > New > Other
Search for the ABAP Data Definition and press Next.
After Naming the projection View and referencing the searched object: I_BUSINESSPARTNERTP_3 the projection code will be automatically generated.
There are various types of CDS projection views, with their own feature set and own syntax. For defining the type of view, use the syntax statement PROVIDER CONTRACT for more information please refer to the SAP Help portal.
After defining provider contract transactional_query , save and activate the changes.
@EndUserText.label: 'Business Partner Projection View'
@AccessControl.authorizationCheck: #NOT_REQUIRED
define root view entity ZXXXXXXXXXXXXX provider contract
transactional_query asprojection on I_BusinessPartnerTP_3
{
key BusinessPartner,
BusinessPartnerUUID,
FullName,
BusinessPartnerForEdit,
BusinessPartnerGrouping,
BusinessPartnerCategory,
CreatedByUser,
CreationDate,
CreationTime,
LastChangedByUser,
LastChangeDate,
LastChangeTime,
FormOfAddress,
FormOfAddressPerson,
FirstName,
LastName
}
A service definition refers to which CDS entities of a data model must be exposed so that a specific business service can be enable.
For creating a new service definition, go to New > Other repository objects, and search for Service Definition. Choose the package, name the new service, add a description, and choose Definition as source type. Finally, reference the object I_BUSINESSPARTNERTP_3 . The system will automatically create the service with the CDS entity. For more information, please refer to the ABAP - Keyword Documentation on help.sap.com
Now save and activate the service definition.
The service binding or business service binding is an ABAP repository object that connects a service definition to a client-server communication protocol.
In Eclipse, go to New > other repository object and search for Service Binding. To correctly create the binding, choose the package, add a name and description. In Binding Type, choose one of the options and link the service definition you just created by clicking on browse and searching for the correct one.
After a correct creation of the service binding, save and activate the changes, and to finish, publish it locally.
One of the needs of this example is that the service created is available for a specific type of business role, therefore, it is necessary to add this service to an IAM app, which is assigned to a business catalog. This becomes more relevant since it is only related for Identity and Access Management (IAM). You have two options: You can either assign the service to an already created IAM, or create the new IAM to add the service to it.
To make the complete process, please follow the next SAP help link, remember to link the service you created, save, activate the changes, and publish the application.
Side-by-side extensions are software applications that run externally to the main core application.
These kinds of extensions provide freedom of development, including the ability to code in different programming languages such as ABAP or Java. They can also be integrated at different levels such as UI level, application logic level, or data level. The interaction of these extensions with SAP S/4HANA Cloud Public Edition is given through the standard SAP APIs.
Side-by-side extensions can potentially run on any runtime application platform. However, the use of SAP's own platform, SAP Business Technology Platform, is recommended.
For further information visit: the SAP Extensibility Explorer for SAP S/4HANA Cloud
The SAP S/4HANA Cloud Public Edition system can be configured with three types of connections: SAML Assertion Authentication, Basic Authentication and Client Certificate Authentication. In our example, we will use SAML Assertion Authentication.
SAP S/4HANA Cloud Public Edition has the following functionalities that must be correctly configured:
Don’t hesitate to leave a comment and check out our new community page to ask your questions and engage with the experts. Follow the PSCC_Enablement tag to stay up to date with our latest blog posts.
More Information on SAP S/4HANA Cloud Public Edition:
Follow us on @SAP and #S4HANA, and myself on LinkedIn .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
29 | |
13 | |
11 | |
11 | |
10 | |
10 | |
9 | |
9 | |
8 | |
6 |