This blog intends to share our experience and understanding of SAP S/4HANA Cloud ABAP Environment (Embedded Steampunk) with the ABAP developer community. As an illustration, we have included three examples to highlight the capabilities of Embedded Steampunk.
Overview of SAP S/4HANA Cloud ABAP Environment
Rich and Flexible Cloud Extensibility
Every ERP requires extensibility options. Business requirements around the globe are so diverse, complex, and unique that the standard scope of any ERP cannot hope to cover them all. It is for this reason that SAP S/4HANA Cloud, public edition, offers powerful, rich, and flexible extensibility options that allow to:
- Add scope to the standard solution by covering specific customer business requirements, as well as creating additional checks and additional process steps,
- Optimize existing processes according to specific business scenarios, harnessing the full power of SAP S/4HANA Cloud, public edition,
- Increase and bring new innovations with a multitude of diverse extensibility tools and available integration services to strengthen your business process,
- Increase the user base as a result of all these activities.
Extensibility Options for S/4HANA Cloud, public edition
SAP S/4HANA Cloud, public edition, supports multiple extensibility options, including Key User Extensibility, on-stack Developer Extensibility, and Side-by-Side Extensibility.
Key User Extensibility
Key User Extensibility (formerly also called In-App Extensibility) enables the creation of SAP S/4HANA Cloud, public edition, extensions. It allows key users to create fields, business logic, custom business objects (CBO), and more.
Key features supported by Key User Extensibility –
- Low-code/ no-code adaptions and extensions of SAP S/4HANA Cloud, public edition
- Adapt UIs, add custom fields, custom forms, and templates
- Custom analytics via CDS Views
- Custom Business Objects
- Custom business logic using Cloud BADIs
- Fully managed and integrated with SAP S/4 HANA Cloud, public edition
- No or only very basic development skills required
Developer Extensibility
On-stack developer extensibility allows you to create development projects directly on the SAP S/4HANA Cloud technology stack. It gives you the opportunity to develop cloud-ready and upgrade-stable custom ABAP applications and services inside the SAP S/4HANA Cloud, public edition system.
Key features supported by Developer Extensibility –
- Tightly coupled more complex extensions and applications
- Custom application development
- Extensions of SAP S/4 HANA Cloud business objects and partner extensions
- Local APIs for the S/4HANA Cloud business objects avoiding remote access and data replication like in side-by-side scenarios on SAP BTP
- Use and extend released SAP S/4HANA Cloud objects
Side-by-side Extensibility
Side-by-side Extensibility is enabled by a subscription to the SAP Business Technology Platform (SAP BTP) which offers a service to develop applications that benefit from BTP services such as database and data management, analytics, integration, etc., including hundreds of pre-built integrations for SAP and third-party applications.
Note that Side-by-Side Extensibility is technically supported by platforms other than BTP through the use of exposed services and Public APIs. While the Public APIs provided by S/4HANA Cloud do not restrict your side-by-side extensibility to SAP BTP, SAP BTP is the preferred and encouraged platform and will provide better extensibility options as SAP continues to deliver new services to help extend your SAP Systems. SAP BTP provides the ability to create decoupled extensions (side-by-side) of the core system using lifecycle compliant methods (using only allowed APIs which ensure an upgrade safe method).
Key features supported by Side-by-side Extensibility –
- Loosely-coupled extensions and applications, such as partner SaaS solutions
- Custom and multitenant applications
- ABAP and non-ABAP (Java, Node.js.) development
- Applications for separate target groups
- Decoupled extensions independent of SAP S/4HANA cloud operation and lifecycle management
To get a full overview including some examples on SAP S/4HANA Cloud, public edition extensibility options I invite you to read the following blog: Drive competitive advantage through differentiation in SAP S/4HANA Cloud, public edition – my experiences choosing the proper cloud extensibility technique to achieve business outcomes
Key facts of SAP S/4HANA Cloud ABAP Environment
The SAP S/4HANA Cloud ABAP Environment enables ABAP based custom development directly on the SAP S/4HANA Cloud stack. It supports following modern ABAP development features.
- ABAP RESTFUL application programming model (RAP)
- Cloud optimized ABAP Language
- Released objects, APIs and BADIs
- Eclipse-based ABAP development tools
- Development of SAP HANA optimized applications and services
- Clear separation between SAP solutions and extensions
- Only stable and reliable public interfaces and released objects from both the underlying ABAP platform and SAP S/4HANA Cloud applications can be used
- No modifications to SAP objects allowed
Capabilities of S/4HANA Cloud ABAP Environment
The SAP S/4HANA Cloud ABAP Environment can be used to extend application functions by developers. Here are some primary capabilities for reference –
- Create custom tables with the list of fields that can be exposed using CDS Views.
- Create custom CDS views and add a Behavior Definition. Behavior definition will include transactional behavior of CDS views (Create/Update/Delete Functionalities).
- CDS Views can be exposed as a Service to be consumed in Fiori Applications.
- Create custom application job templates to support a custom business process. Business logic can be associated with the template.
- Schedule application jobs using a custom template
- Create a Connectivity for a HTTP Service using the Handler Class (to facilitate user dialog)
- Standard SAP CDS views can be used in custom developments to read business data to perform required operations
- EML (Entity Manipulation Language) can be used to consume behaviors for RAP business objects. For example, you can implement an action that first triggers a CREATE and then an UPDATE operation by using EML.
- Enhancement options are available and constantly improved in the ABAP development environment. Enhancement spots for BADIs are released to extend standard functionalities.
Developing Custom Extensions Using SAP S/4HANA Cloud ABAP Environment
In this section, we are sharing three custom extensions in the SAP S/4HANA Cloud, public edition system which was developed as Proof of Concept. The coding and technical details were provided by Ravindra who is a Senior ABAP Developer.
Example 1 – Creating a Material Document using Inspection Data
Business Scenario: Workers do material inspections on the shop floor. All the inspected materials are recorded. Due to quality reasons, the materials not meeting the business criteria are reclassified as a different material requiring transfer posting.
Solution Approach:
- Create a custom table and a CDS view on top of the table for saving material inspection details, define behavior definitions, and use EML to implement behaviors (inserting inspected material entries into the custom table via the CDS view).
- Create a class to call an external API for creating a material document using the data in the custom CDS View.
- Create an Application Job template using the Custom Development object. This development object facilitates the business logic (defined in the above class) within the template.
- Use the above template to schedule a regularly running job to create a material document that can be viewed in CDS view I_MATERIALDOCUMENTITEM_2.
- The use of released objects is always preferred and recommended. When this POC was developed, no released object was available and therefore a released API (available in the API hub) was used.
Solution Details:
- Create a custom table called ZTMM_QLTY_INSP to record inspected materials. There are nine fields defined, including the “client” field.
- Create a CDS view ZI_QLTY_INSP with reference to the created custom table ZTMM_QLTY_INSP. Except for the “client” field, all other eight fields are used in the CDS view.
- Add behavior definitions to the CDS view. Behavior definitions include transactional behaviors of the CDS view ZI_QLTY_INSP, i.e., create, update, and delete.
- Implement behavior definitions using EML. Here is an example of implementing CREATE behavior which is defined for the custom CDS View ZI_QLTY_INSP. A Method if_oo_adt_classrun~main in the class zcl_update_cds implements CREATE behavior. Note: Within ADT, the CDS View is listed under Core Data Services Group, while the class implementation is listed under the Source Code Library Group.
- As a requirement, a material document needs to be generated periodically. To achieve this, we need to run a job at a set time schedule. This job is defined in the application job template. Considering the S/4HANA Cloud system doesn’t allow a standard application job template to be associated with a custom business process, we need to create an application job template as a custom development object. This development object facilitates the business logic within the template. In this step, a custom application job template ZTEMP_UPDATE_INSP is created to update the inspection details into custom CDS view ZI_QLTY_INSP. This template would be used to schedule a job using the standard Fiori app Application Jobs.Create a custom class ZCL_TEST_TRANSFER_POSTING. This class accomplishes two objectives: 1) to read data from the CDS view ZI_QLTY_INSP, and 2) to call an external API API_MATERIAL_DOCUMENT_SRV to create a material document. Reading data from the custom CDS view: SELECT * FROM zi_qlty_insp WHERE materiala = ‘RM15’ INTO TABLE @DATA(LT_QLTY_INSP) URL for calling a released API is as follows: DATA(lo_dest) = cl_http_destination_provider => create_by_url(i_url = ‘https://myxxxxxx-api.s4hana.ondemand.com/sap/opu/odata/sap/ API_MATERIAL_DOCUMENT_SRV/A_MaterialDocumentHeader ‘).Note: The use of released Local objects is always preferred and recommended. When this POC was developed, no released Local object was available and therefore a released Remote API was used.
- After a material document is generated, we need to post it in the system. This requires a 2nd template ZTEMP_TRANSFER_POSTING. This template facilitates “transfer posting” business logic. A job is scheduled using this template.
- Schedule a Job using the Fiori App Application Jobs by selecting a template for “Transfer Posting”. This job will trigger the associated business logic to create a material document. On the 2nd line of this status screen, you can see a Transfer Posting job is finished successfully.
- A Material Document is created after running the above job. It is based on the inspection data in the custom CDS view ZI_QLTY_INSP, and data can be viewed in the standard CDS view I_MATERIALDOCUMENTITEM_2. Below is the output from this CDS view.
Example 2 – Creating a Service Entry Sheet
Business Scenario: When the customer uses a 3rd party contractor to perform jobs, it issues purchase orders. Corresponding to each purchase order, a relevant Service Entry Sheet is created to record time. In addition, there is an authorization requirement to create a Service Entry Sheet (to be discussed in Example 3); not any user can create it.
Solution Approach:
- Upload a CSV file containing purchase orders into an internal table
- Create a Service Entry Sheet using an Internal API (the behavior definition I_ServiceEntrySheetTP_2)
Solution Details:
- Create a custom development object to allow users to select a file, read file data to an internal table and consume a released behavior definition I_ServiceEntrySheetTP_2 using EML to create a Service entry sheet.
- Instead of creating a Fiori App, we created a web screen using HTML codes that allow users to browse a file and perform an upload action once a file is selected. Here is the list of codes and web browser screenshot.
- Read the file data into an internal table by using the service handler method IF_HTTP_SERVICE_EXTENSION~HANDLE_REQUEST.
- Consume a standard behavior definition I_SERVICEENTRYSHEETTP_2 using Entity Manipulation Language in the class ZCL_FILE_UPLOAD_SES, to create a Service Entry Sheet.The authorization concept is built-in for standard behavior definitions. If a user is not authorized to perform an action (Create /Update/Delete), the behavior definition gives an error message.
- Create a HTTP Service ZABAP_SERVICESHEET_CREATE using the class ZCL_FILE_UPLOAD_SES (Handler Class). A URL is generated in the process. Users can use the URL for uploading a file to create a Service Entry Sheet.The authorizations associated with this HTTP Service can be configured by clicking on the hyperlink “Configure authorization default values” as shown in the above figure.
- Use the URL from Step 2 on a web browser. A user selects a file by clicking the Browse… button and uploads a file by clicking the Upload After uploading a file, a Service Entry Sheet is created based on the behavior definition I_SERVICEENTRYSHEETTP_2 within the handler class ZCL_FILE_UPLOAD_SES, as described in Step 1.
- One can then view the Service Entry Sheet using the standard Fiori App. Here is the screenshot of the Service Entry Sheet 43 / 0001 which was generated for Purchase Order 4500000028/00010.
Example 3 – Implementing Authorizations to a Custom Extension Development
Business Scenario: Create a new business role for users who can generate a Service Entry Sheet as discussed in Example 2.
Solution Approach:
In the SAP S/4HANA Cloud, public edition, the authorization is implemented through a business role. This business role is assigned to the user to give him/her the right authorization. We follow the below approach to create a business role.
- Create an IAM app in ADT using Cloud Identity and Access Management
- Create a business catalog, assign the IAM app to this business catalog, and publish it to be visible in S/4HANA standard Fiori app Business Catalog
- Insert a HTTP Service URL created in Example 2, in the IAM App Service tab
- Go to the IAM app and select the Authorization tab and insert authorization objects
- Create a business role and assign a business catalog created above to it
Solution Details:
- Create an IAM App ZABAP_SERVICESHEET_ABAP_IAM_EXT to control authorizations for a HTTP Service.Note: the screenshot shows a different IAM App after I removed the original APP. But the concept is the same.
- Create an IAM business catalog Z_SES_BUSINESS_CATALOG. This business catalog can be assigned to an IAM App; It is also published to be visible in the Fiori App Business Catalog in the S/4HANA Cloud system.
- Assign IAM app ZABAP_SERVICESHEET_ABAP_IAM_EXT to Business Catalog Z_SES_BUSINESS_CATALOG_0001.
- Go to IAM App ZABAP_SERVICESHEET_ABAP_IAM_EXT and select the Service tab and insert the HTTP Service ZABAP_SERVICESHEET_CREATE created in example 2.
- The IAM App grants access to the HTTP service, which in turn consumes the behavior definition via EML. If that EML call is protected by authority checks, then the user needs to be assigned the authorization objects which correspond to those checks. This can be achieved by adding the authorization objects to the IAM App or they may already be contained in one of the standard roles delivered by SAP.
- In the front end of the SAP S/4HANA Cloud system, the created business catalog Z_SES_BUSINESS_CATALOG can be viewed in Fiori App Business Catalogs. This business catalog can be assigned to an existing business role, and subsequently assign the business role to a user. If needed, we can create a new business role and assign this business catalog and User ID to the role to provide access to our developed application, i.e., uploading a PO file and creating a service entry sheet.
Findings in SAP S/4HANA Cloud ABAP Environment
Here is the summary of the findings from using Developer Extensibility in SAP S/4HANA Cloud, public edition. The mentioned features and capabilities contained in this blog are still valid. In the meantime, of course, a lot of new capabilities have been added. Please check the release note, documentation, and roll-out information of the latest releases.
- It was not allowed to change values in the debugging mode. With the current release, this has been delivered in the meantime. Please check the link https://help.sap.com/docs/btp/sap-abap-development-user-guide/change-functionality?version=Cloud.
- The development system will always have two clients, 080 and 100. ABAP Development is only possible in client 080 (with a Developer role), client 100 does not allow development. Business role BR_APPL_SUP_ENG_DEV_SUP allows the user to connect to client 100 for troubleshooting/debugging purposes (but no development object can be modified).
- Authorization objects associated with the behavior definition need to be in Released status, to use in the IAM app Authorization. Not all authorization objects mentioned in the behavior definition are released.
- Only released objects can be consumed in custom developments.
- Embedded Steampunk allows consuming both released objects and released APIs.
- SAP has released Enhancement Spots to support enhancements using BADIs.
- In the S/4HANA Cloud ABAP environment, SAPGUI is not supported neither for development nor for online users.
- In SAP S/4HANA Cloud, public edition the standard tables are not released or visible to the customers. One should check if the relevant tables are exposed via the released CDS views.
- Development objects can be saved into the GitHub repository and pull back to copy to the other development system.
Conclusion
In the SAP S/4HANA Cloud, public edition -3 System Landscape, the availability of S/4HANA Cloud ABAP Environment opens the door for custom Developer Extensions in addition to Key User and Side by Side Extensions in prior releases. We could successfully implement Extensions to meet the customer requirements using public APIs and Released Objects. Over time, we expect more development options and additional Released Objects and APIs will become available in subsequent releases.
Finally, I would like to thank the following colleagues for reviewing the blog and providing content & feedback based on their own experiences and knowledge: Ravindra Babu Abburi, Mario Dietrich Collada, Jens Weiler, Karl Kessler, Marco Valencia, Sampath Ramanujam, George Yu, Barbara Bitterle, and Jerry Lowery
Additional Information
Prerequisites for Developers
The prerequisite for using the S/4HANA Cloud ABAP Environment is to install the ABAP Development Tools. Here are the ADT installation steps:
Step 1: Get Eclipse IDE for Java Developers from https://www.eclipse.org/downloads/packages/
Step 2: Download & install ADT as described on https://tools.hana.ondemand.com/latest
Step 3: Install the ABAPGit plugins from the update site https://eclipse.abapgit.org/updatesite
Additional Resources
- SAP S/4HANA Cloud, public edition, release info
- Best practices for SAP S/4HANA Cloud, public edition
- SAP S/4HANA Cloud, public edition, Community
- Feature Scope Description
- What’s New
- Help Portal Product Page
- SAP S/4HANA Cloud ABAP Environment Community
- The new ABAP extensibility guide
- How to use Embedded Steampunk in SAP S/4HANA Cloud, private edition and in on-premise – The new ABAP extensibility guide | SAP Blogs
- Embedded Steampunk – Some more details for ABAP developers | SAP Blogs
- SAP documentation
- Developer Discussion: ABAP Cloud
- Drive competitive advantage through differentiation in SAP S/4HANA Cloud, public edition – my experiences choosing the proper cloud extensibility technique to achieve business outcomes
- SAP S/4HANA Cloud, public edition, ABAP environment case introduction