SAP-samples/cloud-abap-rap
A RAP business object that generates other RAP business objects from a table, behaviour definitions, projections and value helps included, so a developer starts on business logic rather than boilerplate.
Implementing a RAP business object means writing the same behaviour definitions, projections and value helps before any business logic exists. This is itself a RAP business object, ZDMO_R_RAPG_ProjectTP, with a Fiori Elements UI: a developer opens the *Project* entity, points it at a table, and it generates the repository objects, proposing fields such as local_last_changed_at as the entity's etag by matching the data element. It also generates the SAP object types, node types and the C0/C1 release state an extensible RAP object needs. SAP ships a second, ADT-based generator from S/4HANA 2022 onward, but that one currently supports only a single table.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerAjinkya PatilContributes to this
In the atlas: contributes to 112@ajinkyapatil8190Andre FischerContributes to this
In the atlas: contributes to 19, wrote 5@anfiscBrian BernardContributes to this
In the atlas: contributes to 64@btbernard3 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
As a sample
- Form
- A reference application
Connections
Defining business object behaviour and who owns the transaction
Download
README
quoted from SAP-samples/cloud-abap-rap under Apache-2.0, readDescription
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
- The RAP Generator allows to generate a basic I-view layer beneath the R-view layer as being used in SAP S/4HANA
- The generation and deletion process now leverages the background processing framework (BGPF)
- You can now generate extensible RAP business objects
- The generator generates the required additional repository objects (include structure, extension include view, ...)
- The generator performs the required C0- and C1-release state
- The generator creates SAP object types and SAP object node types
Requirements
This sample code does currently work in:
- SAP BTP, ABAP environment
- SAP S/4HANA, ABAP environment
- SAP S/4HANA 2023
- SAP S/4HANA 2022
- SAP S/4HANA 2021
How to Guides
Download and Installation
How to Install the RAP Generator
SAP BTP ABAP Environment and SAP S/4HANA Cloud ABAP Environment
- Create a package 'ZDMO_RAP_GENERATOR'.
- Link this package with the URL of the RAP Generator repository
https://github.com/SAP-samples/cloud-abap-rap. - Use the branch
abap-environment. - Pull changes.
- Use mass activation to activate the objects that have been imported in step 3.
- Publish the service binding
ZDMO_UI_RAPG_PROJECT_O2.
SAP S/4HANA 2021, 2022 or 2023
- Create a package 'TEST_RAP_GENERATOR'.
- Start the report
ZABAPGIT_STANDALONE. You might have to download the source code of this open source tool. - Create an an online repository with the package and with the URL of the RAP Generator repo
https://github.com/SAP-samples/cloud-abap-rapor create an offline repository and download the source code as a ZIP file fromhttps://github.com/SAP-samples/cloud-abap-rap. Make sure that you use the appropriate branchon-prem-2022,on-prem-2021oron-prem-2023. - Pull changes.
- Use mass activation to activate the objects that have been imported in step 3.
- 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
- When using the RAP Generator in on-premise systems, you have to make sure that the latest SAPUI5 libraries are installed. If you don’t have the latest version of the SAPUI5 libraries installed you will get no dialogue when choosing the New Project button in the RAP Generator.
If the latest SAPUI5 libraries cannot be installed, you can use an implicit enhancement in method
get_sapui5core_resources_url( )of classCL_ADT_ODATAV4_FEAPas described in the following blog post.
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) 2024-2026 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file; you may not use any file of this project except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
abaplint
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-cloud-abap-rap- JSON
- /artifacts/sap-samples-cloud-abap-rap.json
- MCP
- Connecting an agent