Welcome to Part II of blog post series Embedded Steampunk – What’s under the hood?
- How to use Embedded Steampunk in S/4 HANA 2022 on premise system,
- RAP as the programming model of choice in Embedded Steampunk(current topic),
- Restricted ABAP in Embedded Steampunk with tried out examples,
- ADT tips which might be useful.
Hyperlinks to topics #3,4 will be updated here once they are published
Update: The term Embedded Steampunk is now replaced with “The SAP S/4HANA Cloud ABAP Environment”, as suggested in this blog
In part I, we have seen how to use Embedded Steampunk in SAP S/4 HANA 2022 on premise.
Now let's see how Embedded Steampunk promotes ABAP RESTful Application Programming Model (RAP) as the programming model of choice to build Fiori App and services. We would also see how to generate RAP based services in a few clicks using Generate ABAP Repository Objects.
RAP as the programming model of choice in Embedded Steampunk
Let's try to create OData services in different ways and see which way is supported in Embedded Steampunk.
1. Generate OData service using OData.publish Annotation
Exposing a CDS with ABAP Language version Standard ABAP as an OData service
Exposing CDS with language version Standard ABAP
Outcome: Exposed successfully
Exposing same CDS with ABAP Language version ABAP for Cloud Development as an OData service (Embedded Steampunk)
Exposing CDS with language version ABAP Cloud
Outcome: Exposure not allowed
Error Details:
Error details
2. Generate OData service using ABAP Programming model for SAP Fiori
Exposing a CDS with ABAP Language version Standard ABAP using BOPF programming model
Standard ABAP with ABAP Programming model for SAP Fiori
Outcome: Exposed successfully
Exposing same CDS with ABAP Language version ABAP for Cloud Development using BOPF programming model (Embedded Steampunk)
ABAP Cloud with ABAP Programming model for SAP Fiori
Outcome: Exposure not allowed
Error Details:
Error details
3. Generate OData service in SAP Gateway Service Builder(SEGW)
Generating OData service via SEGW is not possible because the standard interfaces used in generated MPC/DPC classes are not released, hence not permitted to be used in ABAP Cloud development.
SEGW based oData service
Outcome: Exposure not allowed
4. Generate OData service using ABAP RESTful Application Programming Model(RAP)
Generating an OData service via RAP is usually quick, as it allows us to focus more on implementing business logic than worrying about the technical aspects. What's even quicker is generating a RAP based OData service with a few clicks through
Generate ABAP Repository Objects
Generate ABAP Repository Objects is now available with SAP S/4 HANA 2022 On Premise as well.
Let's see how to create RAP based service in a few clicks:
Step 1:
Right click on your database table on top of which you want to build the RAP Data model, and select Generate ABAP Repository Objects to open Generator wizard and select Generator ''ABAP RESTful Application Programming Model: UI Service''
Generator wizard
Step 2:
Click next and enter data model, behavior, service definition, service binding names and select binding type
Enter data model and service binding details
Step 3:
Click next to preview generator output before generating the repository objects
Preview generator output
Step 4:
Select Transport Request and click Finish
Click Finish
Step 5:
Test generated service via service binding
Generated Business Service
Outcome: Exposed Successfully
This way we created a fully functional RAP based Business service in a matter of few clicks
🙂
Also, as you can see below, ABAP Language version for the generated objects is marked as ABAP for Cloud Development (Embedded Steampunk)
ABAP for Cloud Development
Conclusion:
- Publishing an OData service with annotation @OData.publish fails in Embedded Steampunk with error "Use of annotation OData.publish is not permitted"
- Publishing an OData service with ABAP Programming model for SAP Fiori fails in Embedded Steampunk with error "Use of annotation ObjectModel.CompositionRoot is not permitted"
- Publishing an OData service with SAP Gateway Service Builder(SEWG) is not allowed as the interfaces used in generated classes are not released.
- Publishing an OData service with ABAP RESTful Programming model (RAP) works smoothly on Embedded Steampunk.
This way, it's safe to conclude that RAP is the programming model of choice in Embedded Steampunk for OData exposures.
Hope you liked the post. Please share your thoughts in comments, or connect with me on
LinkedIn.
In the next blog post, I would highlight restricted ABAP in Embedded steampunk with tried out examples, so stay tuned
😉
Thanks,
Aman Garg