How to use the RAP Generator in SAP S/4HANA on premise?
- 04.07.2021 – Since also the on premise version of the RAP Generator now comes with a Fiori Elements UI the use of the RAP Generator is basically the same on all three supported platforms (2020, 2021 and cloud).
In this blog I would like to provide a short click-trough so that you know how to generate a RAP BO using the RAP Generator in an SAP S/4HANA on premise system.
With the latest version the use of the RAP Generator in an on premise release is not much different from the use in SAP BTP ABAP Environment.
To avoid confusion I have deleted the old how to guide and I am refering you (for the time being to this how to guide instead).
What is different on premise is the installation part, since on premise you have to use the report ZABAPGIT to upload the source to your SAP S/4HANA 2020 or SAP S/4HANA 2021 system.
In an on premise system it is also possible to use packages that support either the language version “standard” or “ABAP for Cloud Development” .
The boundary conditions for using the ABAP language version “ABAP for Cloud Development” have been discussed in detail by my colleague Thomas Schneider in his blog post Restricted ABAP and SAP S/4HANA On-Premise | SAP Blogs.
Make sure your system runs at least on top of SAP S/4HANA 2020 FSP1
The RAP Generator requires features and functions of the XCO libraries that have been delivered with on premise systems only as of SAP S/4HANA 2020 FSP1.
It uses in addition the generation of OData V4 services which are alos only supported as of SAP S/4HANA 2020 FSP1.
Steps after generation (2020)
After you have run the generator in an SAP S/4HANA 2020 system you have to perform some manual steps because the XCO libraties in 2020 do not support the generation of all artifacts and source code snippets that are supported in 2021 or in the cloud.
- Behavior definitionIn the behavior definition you have to change the the statement lock master and and add total etag LastChangedAt to it.
- Generate the behavior implementation classSince the RAP Generator cannot generate the behavior implementation class you have to perform this manual step yourself. You can however used code completion (Press Ctrl+1) to do this.
- Now you have to add the statement “use draft;” to the behavior projection
- Create and activate the Service BindingSince the RAP Generator cannot generate the Service Binding in SAP S/4 HANA 2020 you have to perform this step manually.Just right click on the Service Definition and select the option to generate the Service Binding from the context menu.
As you can see, the RAP Generator has generated a RAP Business Object as it does it in SAP BTP ABAP Environment.