Skip to content

Latest commit

 

History

History
192 lines (116 loc) · 10.9 KB

README.md

File metadata and controls

192 lines (116 loc) · 10.9 KB

Home - RAP110

Exercise 1: Generate and Inspect your Exercise Package

Introduction

In this exercise, you will generate and make yourself familiar with your exercise package ZRAP110_###, where ### is your assigned suffix.

This generated package will contain an OData-V4-based UI service and all the RAP artifacts required for this workshop. The UI service is based on a managed Business Object (BO) with two entities, travel and booking, with generic transactional behavior - i.e. CRUD: Create, Read, Update, and Delete.

For your convenience, the class ZDMO_GEN_RAP110_SINGLE is provided to you to generate the package ZRAP110_### alongside with the aforementioned RAP business object after execution. You can find the steps in Exercise 1.1.

Exercises

Exercise 1.1: Generate your package Package

For ⚠ ASUG 2023 TechConnect users
Please skip step 1.1., because the packages have been pre-generated for convenience in the dedicated workshop system.

🔵 Click to expand!
  1. Right-click Favorite Objects and click Add Object.

    package
  2. Search for ZDMO_GEN_RAP110_SINGLE, select it and click OK.

    package
  3. Right-click ZDMO_GEN_RAP110_SINGLE, select Run As > ABAP Application (Console) F9.

    package
  4. Now your package is created. Check the ABAP console. ⚠Copy the suffix for later use.

    package

Exercise 1.2: Access your exercise package Package

^Top of page

Add your package to Favorite Packages

🔵 Click to expand!
  1. Open your ABAP Cloud project, right-click Favorite Packages and select Add Package.

    package
  2. Search for your package ZRAP110_### , select it and click OK.

    ### is your suffix and GroupID.

    package
  3. Now your ABAP package is added to favorite packages.

    package

Exercise 1.3: Brief Explanation of the generated ABAP Artefacts

^Top of page

Get to know the generated ABAP development objects.

Regarding ⚠ warnings about missing CDS access controls
Please ignore the warnings about missing access control that will be displayed for the CDS views entities ZRAP110_R_TravelTP_###, ZRAP110_C_TravelTP_###, ZRAP110_R_BookingTP_###, and ZRAP110_C_BookingTP_###. These is due to the view annotation @AccessControl.authorizationCheck: #CHECK specified in these entities. Due to time constraints, we will not define CDS access control in this workshop.

You can suppress these warnings by changing the annotation value to #NOT_REQUIRED.

🔵 Click to expand!
  1. Go to the Project Explorer, select your package packageZRAP110_### and check all generated ABAP repository objects

    table

    Below is a brief explanation of the generated artefacts for the different RAP layers: Base BO, BO Projection, Business Service, and addtional help classes.

    Base Business Object (BO) Layer

    Base BO Nodes Travel and Booking

    Object Name Description
    ddls iconZRAP110_R_TravelTP_### (aka Root Base BO view): This data definition defines the data model of the root entity Travel which is the only node of our business object).
    ../ddls iconZRAP110_R_BookingTP_### (aka Child Base BO view): This data definition defines the data model of the child entity Booking which is the only node of our root BO entity).
    ../bdef iconZRAP110_R_TravelTP_### (aka _Base BO behavior): This behavior definition contains the definition of the standard transactional behavior of the root base Travel BO entity and the child base Booking BO entity. It is a managed and draft-enabled implementation.
    ../tabl iconZRAP110_ATRAV### and ZRAP110_ABOOK### (aka Active tables): These database tables are used to persist the consistent data from travel and booking instances respectively at runtime. It is managed by the RAP framework.
    ../tabl iconZRAP110_DTRAV### and ZRAP110_DBOOK### (aka Draft tables): These database tables are used to temporary store the data from draft travel and booking instances at runtime. It is managed by the RAP framework.
    ../class iconZRAP110_BP_TRAVELTP_### and ZRAP110_BP_TRAVELTP_### (aka Behavior pool): These ABAP classes are used to provide the implementation of the behavior defined in the behavior definition ZRAP110_R_TravelTP_### and ZRAP110_R_BookingTP_### of the base Travel and Booking BO nodes.

    BO Node Projection Nodes Travel and Booking

    The BO projection represents the consumption specific view on the BO data model and behavior.

    Object Name Description
    ../ddls iconZRAP110_C_TravelTP_### (aka BO projection view): This data definition is used to define the projected data model of the root entity Travel relevant for the present scenario. Currently almost all fields of the underlying base BO view are exposed and the definition of metadata extension is allowed using the view annotations @Metadata.allowExtensions: true.
    ../ddls iconZRAP110_C_BookingTP_### (aka BO projection view): This data definition is used to define the projected data model of the child entity Booking relevant for the present scenario.
    ../bdef iconZRAP110_C_TravelTP_### (aka BO behavior projection): This behavior definition exposes the subset of the underlying base Travel and Booking BO entities which is relevant for the present scenario using the keyword use.
    ../ddlx iconZRAP110_C_TravelTP_### and ZRAP110_C_BookingTP_### These metadata extension are used to annotate the views ZRAP100_C_TravelTP_### and ZRAP100_C_BookingTP_###respectively and their elements with UI semantics via CDS annotations.

    Business Service

    Object Name Description
    srvd iconZRAP110_UI_TRAVELTP_### A service definition is used to define the relevant entity sets for our service and also to provide local aliases if needed. Only the Travel entity set is exposed in the present scenario.
    srvb iconZRAP110_UI_TRAVELTP_O4_### This service binding is used to expose the generated service definition as OData V4 based UI service. Other binding types (protocols and scenarios) are supported in the service binding wizard.

    Additional generated ABAP Classes

    Object Name Description
    srvd iconZRAP110_CALC_TRAV_ELEM_### These ABAP classes are used to provide the implementation of the travel virtual elements calculation.
    srvb iconZRAP110_CALC_BOOK_ELEM_### These ABAP classes are used to provide the implementation of the booking virtual elements calculation.

Exercise 1.4: Test the Travel App

^Top of page

Now, check the local service endpoint of your service binding ZRAP110_UI_TRAVEL_O4_###, and use the preview to test the Travel app by creating, updating an deleting travel instances and booking instances.

🔵 Click to expand!
  1. Now start the Fiori elements App Preview for the Travel entity set.

    For that, either select the entity set Travel in the Entity Set and Associations section and press the Preview button or simply doubleclicking on it.

    The Travel app will be started in your browser.

    table
  2. Create, update and delete travel and booking entries.

    table

    Only the generic CRUD - i.e. create, read, update, and delete - logic is available for now. You will enhance the BO behavior in the next exercises.

Summary

^Top of page

Now that you've...

  • inspected the generated Travel BO with its two entities travel and booking,
  • previewed the UI service, and
  • played around with the Fiori elements Travel app,

you can continue with the next exercise – Exercise 2: Enhance the Data Model of the Base and Projected BO