Skip to content

Code samples for analytical data modeling (in ABAP-CDS) based on the Flight Reference Scenario.

License

Notifications You must be signed in to change notification settings

SAP-samples/abap-platform-analytics-data-modeling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

REUSE status

ABAP Platform Examples for Analytical Data Modeling

The ABAP Platform Examples for Analytical Data Modeling provide an analytical data model that is based on the ABAP Flight Reference Scenario. It allows to get familiar with modern, ABAP-CDS based analytical data modeling and provides examples for the most prominent features of the Embedded Analytics functionality in the ABAP Platform. You can either use the provided data model as is or build your own data model using parts of the examples.

Requirements

Make sure to fulfill the following prerequisites:

  • You have access to a recent ABAP Platform Cloud instance.
  • You have downloaded and installed the most recent version of ABAP Development Tools (ADT). See the installation page.
  • You have created an ABAP Cloud Project in ADT that allows you to access your ABAP Environment instance.
  • You have installed the abapGit plug-in for ADT from the ABAPGit update site.
  • You have used abapGit to import the ABAP Flight Reference Scenario for ABAP Platform Cloud as described in the resrective README.

Download and Configuration

Download

Use the abapGit plug-in to import the ABAP Platform Examples for Analytical Data Modeling by executing the following steps:

  1. In your ABAP cloud project, create the ABAP package /DMO/ANA_FLIGHT (using the superpackage /DMO/SAP) as the target package for the demo content to be downloaded (leave the suggested values unchanged when following the steps in the package creation wizard).
  2. To add the abapGit Repositories view to the ABAP perspective, click Window > Show View > Other... from the menu bar and choose abapGit Repositories.
  3. In the abapGit Repositories view, click the + icon to clone an abapGit repository.
  4. Enter the following URL of this repository: https://github.com/SAP-samples/abap-platform-analytics-data-modeling.git and choose Next.
  5. Enter the newly created package /DMO/ANA_FLIGHT as the target package and choose Next.
  6. Create a new transport request that you only use for this demo content installation (recommendation) and choose Finish to link the Git repository to your ABAP cloud project. The repository appears in the abapGit Repositories View with status Linked.
  7. Right-click on the new ABAP repository and choose pull to start the cloning of the repository contents. Note that this procedure may take a few minutes.
  8. Once the cloning has finished, the status is set to Pulled Successfully. (Refresh the abapGit Repositories view to see the progress of the import).
  9. Refresh the project tree.

As a result of the installation procedure above, the ABAP system creates an inactive version of all artifacts of the demo content and adds the sub package /DMO/ANA_FLIGHT_QUERY to the target package that contains additional analytical queries that demonstrate various features of embedded analytics.

NOTE: The namespace /DMO/ is reserved for the demo content. Apart from the downloaded demo content, 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.

Activation

To activate all development objects from the /DMO/ANA_FLIGHT package:

  1. Click the mass-activation icon (Activate Inactive ABAP Development Objects) in the toolbar.
  2. In the dialog that appears, select all development objects in the transport request (that you created for the demo content installation) and choose Activate. (The activation may take a few minutes.)

Data Generation

To fill the demo database tables:

  1. Expand the package structure in the Project Explorer /DMO/FLIGHT_LEGACY > Source Code Library > Classes.
  2. Open the data generator class /DMO/CL_FLIGHT_DATA_GENERATOR and go to lcl_flight_data_generator.
  3. Find the METHOD build_connection_recurrency and change the variable lv_days_between to use the constant cv_days_between_4weeks. The resulting code should now look like this: DATA(lv_days_between) = cv_days_between_4weeks. to get data that is better suited for analytical purposes.
  4. Mass-activate.
  5. Now press F9 to run the generator as Console Application.

NOTE: Even if you did run the generator before, you need to run the generator again after having installed the ABAP Platform Examples for Analytical Data Modeling to get additional analytics-specific example data e.g. for hierarchies.

NOTE: The data generator will always generate "current" data around the date it was trigered. The demo views instead may have fixed dates e.g. for parameter defaults or in filter conditions. Therefore please check and adapt these dates in case you experience issues when previewing data.

Optional: Importing Currency Conversion Rates

To be able to use the currency conversion feature, you need the currency conversion rates to be available in your system. If loading currency conversion rates is not set up in your system, you may use the following procedure for lading the rates one time (or on demand):

  1. Create a new package of your choice, e.g. ZCURR_CONV.
  2. Import the Github repo https://github.com/SAP-samples/cloud-abap-exchange-rates into the new package.
  3. Mass-activate.
  4. Check the README.md of the repo for instructions how to use.
  5. Try the XML import from the European Central Bank by running zcl_ecb_exchange_rates_xml as console application (F9).
  6. As an alternative implement class zcl_ecb_exchange_rates_xml and run it in the console. The code of the class can be found in the text file zcl_ecb_exchange_rates_xml.aba.

NOTE: Some queries do have fixed dates for the currency conversion in the demo content. You may need to update the dates in order to match the available conversion rates in your system by adapting the exchange_rate_date parameter value in the currency_conversion function of the query.

Test the ABAP Platform Examples

  1. Make sure all development objects are fully activated.
  2. Open /DMO/ANA_C_AirportCapaQry in ADT.
  3. Right-click /DMO/ANA_C_AirportCapaQry and choose Open With -> Data Preview.
  4. A browser window should open that displays a multi-dimensional dat preview of the analytical query.

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. For additional support, please ask questions in SAP Community.

License

Copyright (c) 2025 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.

About

Code samples for analytical data modeling (in ABAP-CDS) based on the Flight Reference Scenario.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published