SAP-samples / cloud-abap-rap

This repository contains several examples how to develop with the ABAP RESTful Application Programming Model (RAP) in SAP BTP, ABAP environment.
Apache License 2.0
230 stars 62 forks source link
abap abap-environment abap-restful odata rap sample sample-code sap-btp sap-btp-abap

REUSE status

Description

The basic idea behind the RAP Generator is to ease the life of the developer since it helps you to create most of the boiler plate coding that is needed to implement a RAP business object using the ABAP RESTful Application Programming Model (RAP) so that you as a developer can start more quickly to implement the business logic.
As of SAP S/4HANA 2022 and in the ABAP environements of SAP S/4HANA Cloud and SAP BTP ABAP Environment there is also an ADT-based generator available which currently only supports one table but will be optimized in future releases.

RAP generates RAP
Technically the RAP Generator consists out of a RAP business object ZDMO_R_RAPG_ProjectTP that is used to generate other RAP business objects.
The RAP Generator works similar like the well known Key user tools in SAP S/4HANA and uses a Fiori Elements UI. The Fiori Elements UI can be started from within ADT by opening the service binding ZDMO_UI_RAPG_PROJECT_O2. There you have to double-click on the entitiy Project which starts the Fiori Elements UI without the need to install any additional tool.

The SAP Fiori elements preview based UI provides value helps for the data that has to be entered and it provides validations and determinations that provide the heavy lifting of specifying which table field is used for which purpose (for example, a field called local_last_changed_at or a field based on the data element abp_locinst_lastchange_tstmpl will be proposed by the RAP Generator to be used as the etag of an entity).

Once the repository objects are generated, the UI offers an ADT link that lets you conveniently navigate back into ADT to continue to work on your objects.

What's New

Requirements

This sample code does currently work in:

How to Guides

Download and Installation

How to Install the RAP Generator

SAP BTP ABAP Environment and SAP S/4HANA Cloud ABAP Environment

  1. Create a package 'ZDMO_RAP_GENERATOR'.
  2. Link this package with the URL of the RAP Generator repository https://github.com/SAP-samples/cloud-abap-rap.
  3. Use the branch abap-environment.
  4. Pull changes.
  5. Use mass activation to activate the objects that have been imported in step 3.
  6. Publish the service binding ZDMO_UI_RAPG_PROJECT_O2.

SAP S/4HANA 2021, 2022 or 2023

  1. Create a package 'TEST_RAP_GENERATOR'.
  2. Start the report ZABAPGIT_STANDALONE. You might have to download the source code of this open source tool.
  3. Create an an online repository with the package and with the URL of the RAP Generator repo https://github.com/SAP-samples/cloud-abap-rap or create an offline repository and download the source code as a ZIP file from https://github.com/SAP-samples/cloud-abap-rap. Make sure that you use the appropriate branch on-prem-2022, on-prem-2021 or on-prem-2023.
  4. Pull changes.
  5. Use mass activation to activate the objects that have been imported in step 3.
  6. Publish Service binding ZDMO_UI_RAPG_PROJECT_O2

Known Issues

The sample code is provided "as-is".

Known issues are listed here: Issues

SAP BTP ABAP Environment, SAP S/4HANA ABAP environment and on premise releases

...

on_premise_2021

How to Obtain Support

If you have problems or questions, you can post them in the SAP Community using either the primary tag or "ABAP RESTful Application Programming Model".

Contributing

You can add proposals for enhancements as issues.

License

Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.