Skip to content

Latest commit

 

History

History
115 lines (83 loc) · 10.7 KB

README.md

File metadata and controls

115 lines (83 loc) · 10.7 KB

REUSE status

ABAP Flight Reference Scenario for the ABAP RESTful Application Programming Model on ABAP Platform

The ABAP RESTful Application Programming Model (RAP) defines the architecture for efficient end-to-end development of intrinsically SAP HANA-optimized Fiori apps on the Application Server ABAP. It supports the development of all types of Fiori applications as well as Web APIs. It is based on technologies and frameworks such as Core Data Services (CDS) for defining semantically rich data models and a service model infrastructure for creating OData services with bindings to an OData protocol and ABAP-based application services for custom logic and SAPUI5-based user interfaces.

The ABAP Flight Reference Scenario provides sample data and services as well as legacy business logic to get familiar with RAP. You can check out the end-to-end scenarios or build your own app based on the sample data.

For more information, see Downloading the ABAP Flight Reference Scenario.

Note: The branches of this repository were renamed recently. If you have already linked an ABAP Package to a branch with an outdated name, unlink the repository first and then pull the link to the branch with the new name, as described in step 3 of the Download section.

Prerequisites

Make sure to fulfill the following requirements:

  • You are working on Application Server ABAP 7.54 or higher.
  • You have downloaded and installed ABAP Development Tools (ADT). Make sure to use the most recent version as indicated on the installation page.
  • You have created an ABAP Project in ADT that allows you to access your Application Server as mentioned above. Your log-on language is English.
  • You have downloaded and installed the zabapgit_standalone report. Make sure to use the most recent version as indicated on the installation page.
  • You have installed the certificate files for github.com, see abapGit Documentation.

Set Up Namespace

SAP uses a reserved namespace for the demo objects.

To enable the namespace in your customer system, follow the steps described in Setting Up a Namespace for Development. For step 8, enter the following values:

  • Namespace: /DMO/
  • Namespace Role : C
  • Repair license: 32869948212895959389
  • Short Text: Enter a suitable description for the namespace , for example SAP Demo Scenarios.
  • Owner: SAP

Choose save and write the changes to a transport.

To be able to import /DMO/ objects into your system, set the system change option. Proceed as follows:

  1. Go to Transport Organizer Tools (transaction SE03)
  2. Go to Administration and start the program Set System Change Option.
  3. In the table Namespace/Name Range table search for the /DMO/ namespace.
  4. In the column Modifiable change the entry to Modifiable.
  5. Save the settings.

For more information, see Setting the System Change Option.

Download

Use the zabapgit_standalone to install the ABAP Flight Reference Scenario by executing the following steps:

  1. In your ABAP project, create the package /DMO/FLIGHT as target package for the demo content. Use HOME as software component. Assign it to a new transport request that you only use for the demo content import.
  2. In your ABAP project, run the program zabapgit_standalone.
  3. Choose New Online and enter the following URL of this repository https://github.com/SAP/abap-platform-refscen-flight.git.
  4. In the package field, enter the newly created package /DMO/FLIGHT.
  5. Leave the other fields unchanged and choose OK. You will see the available artifacts to import into your ABAP system.
  6. To select the on-premise branch, choose Branch > Switch and select ABAP-platform-2019.
  7. Choose Pull and confirm every subpackage on your transport request.
  8. Select the package /DMO/FLIGHT to be overwritten with the demo content. In some cases, the shown ZABAPGIT dialogue offers you to delete the /DMO/ namespace locally. Do not delete the /DMO/ namespace locally because the pull operation will fail if no suiting namespace exists in your package.
  9. You will get an information screen telling you to only make repairs when they are urgent, which you can confirm. You can also confirm the dialogue telling you that objects can only be created in the package of the namespace /DMO/.
  10. In the following screen, select all inactive objects and confirm the activation.
  11. Once the cloning has finished, refresh your project tree.

As a result of the installation procedure above, the ABAP system creates an inactive version of all artifacts from the demo content and adds the following sub packages to the target package:

NOTE: The demo packages do not include behavior definitions, service definitions or service bindings. They must be created to complete the service (see configuration section). Then you can run, for example, the UI services with the Fiori Elements preview in the service binding.

NOTE: If you pull the repository again after a successfull import, make sure that you do not delete the local objects G4BA, SUSH and NSPC.

Configuration

To fill the demo database tables for the read-only and the unmanaged scenario with sample business data:

  1. Expand the package structure in the Project Explorer /DMO/FLIGHT_LEGACY > Source Code Library > Classes.
  2. Select the data generator class /DMO/CL_FLIGHT_DATA_GENERATOR and press F9 (Run as Console Application).

To create the missing development objects (service definition and service binding) for the read-only list reporting app (package /DMO/FLIGHT_READONLY):

Service Definition
  1. Right-click the CDS entity /DMO/I_CONNECTION_R and choose New Service Definition (see here for additional information). Use the name /DMO/FLIGHT_R.
  2. Include the CDS views that are relevant for the read-only scenario to be exposed in the service definition (see here for additional information). You can also directly copy the source code from Service Definition Read-Only /DMO/FLIGHT_R
  3. Activate the service definition.
Service Binding
  1. Right-click the newly created service definition /DMO/FLIGHT_R and choose New Service Binding (see here for additional information).
  2. Specify your own package and your own namespace when following the steps in the creation wizard. A service binding cannot be created in the namespace /DMO/.
  3. Choose the Activate button in the service binding editor.

To create the missing development objects (behavior definition, service definition and service binding ) for the transactional app with implementation type unmanaged (package /DMO/FLIGHT_UNMANAGED):

Behavior Definition
  1. Right-click the CDS root entity /DMO/I_TRAVEL_U and choose New Behavior Definition. In the creation wizard, choose implementation type unmanaged. (see here for additional information).
  2. Copy the source code for the behavior definition from Behavior Definition Unmanaged /DMO/I_TRAVEL_U.
  3. Activate the behavior definition.
Service Definition
  1. Right-click the CDS root entity /DMO/I_TRAVEL_U and choose New Service Definition (see here for additional information). Use the name /DMO/TRAVEL_U.
  2. Include the CDS views that are relevant for the unmanaged scenario to be exposed in the service definition. You can also directly copy the source code from Service Definition Unmanaged /DMO/TRAVEL_U.
  3. Activate the service definition.
Service Binding
  1. Right-click the service definition /DMO/TRAVEL_U and choose New Service Binding (see here.
  2. Specify your own package and your own namespace when following the steps in the creation wizard. A service binding cannot be created in the namespace /DMO/.
  3. Choose the Activate button in the service binding editor.
    NOTE: In case the activation via the button in the service binding is not possible, you can use Gateway tools /IWFND/MAINT_SERVICE to activate the service.

NOTE: The namespace /DMO/ is reserved for the demo content. Apart from the downloaded demo content and the development objects that need to be created to complete the scenario, do not use the namespace /DMO/ and do not create any development objects in the downloaded packages. You can access the development objects in /DMO/ from your own namespace.

How to obtain support

This project is provided "as-is": there is no guarantee that raised issues will be answered or addressed in future releases.

License

Copyright (c) 2018-2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the SAP Sample Code License except as noted otherwise in the LICENSE file.