Skip to content

SAP-samples/teched2025-DT266

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

323 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Teched2025_DT266 - Troubleshoot and Optimize ABAP Cloud Extensions in Cloud ERP

REUSE status

Description

This repository contains the material originally created for the SAP TechEd 2025 session DT266 | Troubleshoot and optimize extensions for ABAP Cloud in cloud ERP.

Overview

^Top of page

Ensuring optimal performance and stability of your ABAP Cloud-based extensions is crucial to long-term success. Learn techniques and best practices for troubleshooting and optimizing custom code in the Cloud ERP. Use powerful tools like the ABAP Cross Trace to get deep insights into execution flows and resource consumption. This session introduces attendees how to analyze custom extensions in SAP Fiori Apps within ABAP Cloud using tools like ABAP Debugger, Feed Reader, ABAP Cross Trace, ABAP Trace, SQL Trace, Memory Analyzer, Table Comparison Tool.

Note

DISCLAIMER:
Please note that information about SAPβ€˜s strategy and possible future developments is subject to change and may be changed by SAP at any time for any reason without prior notice. Check out the SAP Road Map Explorerβ†— and the ABAP Cloud Roadmapβ†— for more details.

Presentation

^Top of page

Requirements for attending this workshop

^Top of page

Participants should have an interest in exploring topics through guided exercises and should have the following knowledge:

To complete the practical exercises in this workshop, you need the latest version of the ABAP Development Tools for Eclipse (ADT) on your laptop or PC

And in addition you need the latest version of the MS Visual Studio Code on your laptop or PC with the SQL analyzer tool for SAP HANA


Overview of the Model and ABAP Code

^Top of page

In our example we want to provide a list of Airline IDs = Carrier_Id(s) for which we get in the result list additional column fields calculated by customer extension:

  • the total of all corresponding flight prices
  • the total price of all corresponding supplements (like meal, beverage, luggage)
  • the percentages %Meals, %Beverages, %Luggage with which those supplement categories contribute to the total price of the supplements

Open ABAP Trace Requests

Note

Runtime error for specific Airlines:
If you click on Go without specification of any Airline or e.g. choose Airline ID = 'AC' you get a runtime error:
Add package
Currently it is only working without error for some specific airlines e.g. Airline ID = 'AA'. This error is analyzed and fixed in Exercise 1.

🟠 REMARK: The scenario of these exercises is based on a RAP application using the ABAP Flight Reference Scenario. For an overview of the available database tables, see ABAP Flight Reference Scenario Database Tables. The calculation for the additional fields is performed in the ABAP class ZCL_DT266_CARR_EXTENSION_### where we call in exercise 1 to 4 the method GET_PRICES_ABAP and for exercise 5 the method GET_PRICES_CDS.

🟠 REMARK: The following overviews are only provided as optional to read information. This information is not required to execute the exercises.

More details on the involved underlying Data Model:

Click here for an Overview of the tables involved

We use in the Exercises the following tables:

Table Content Number of Entries Key Fields Other Fields used in Model / Where used
/DMO/CARRIER Different Carriers, e.g. AA, AC,... 16 Airline IDs = Carrier IDs CLIENT, CARRIER_ID
ZDT266_CARR_### Copy of /DMO/CARRIER 16 Airline IDs = Carrier IDs CLIENT, CARRIER_ID
/DMO/CONNECTION Connections of the Carriers 20 rows: Combinations of Carrier & Connection CLIENT, CARRIER_ID, CONNECTION_ID
/DMO/BOOKING Booking IDs and travel IDs for each combination of carrer and connection 9161 rows CLIENT, TRAVEL_ID, BOOKING_ID CARRIER_ID, CONNECTION_ID, FLIGHT_PRICE
/DMO/BOOK_SUPPL Supplements like meal, beverage, luggage 16211 entries CLIENT, TRAVEL_ID, BOOKING_ID, BOOKING_SUPPLEMENT_ID SUPPLEMENT_ID
ZDT266_BO_SU_000 Copy of 4.000 times /DMO/BOOK_SUPPL 64,844,000 entries CLIENT, TRAVEL_ID, BOOKING_ID, BOOKING_SUPPLEMENT_ID, ID (4,000 different values) used for CDS performance
/DMO/SUPPLEMENT Different kind of Supplements and their categories and prices 48 entries CLIENT, SUPPLEMENT_ID SUPPLEMENT_CATEGORY, PRICE
ZDT266_SUP_I_### Copy of 500 times /DMO/SUPPLEMENT 24,000 entries CLIENT, SUPPLEMENT_ID, ID (500 different values) used for ABAP performance
ZDT266_SUP_L_000 Copy of 200,000 times /DMO/SUPPLEMENT 9,600,000 entries CLIENT, SUPPLEMENT_ID, ID (200,000 different values) used for CDS performance
Click here for an Overview of the ABAP Code

In a similar way to Create Database Table and Generate UI Service we have created a copy of /DMO/CARRIER with the name ZDT266_CARR_###, e.g. for ZDT266_CARR_000 and generated a UI service.

Following Using Virtual Elements in CDS Projection Views we created Virtual Elements declared in the CDS projection view ZC_DT266_CARR_### (ZDT266_CARR_000) created in the previous step:

Open ABAP Trace Requests

They shall be calulated in the custom extension class ZCL_DT266_CARR_EXTENSION_000.

In this class ZCL_DT266_CARR_EXTENSION_000 two interface methods have to be created (refer to Implementing the Calculation of Virtual Elements):

  • IF_SADL_EXIT_CALC_ELEMENT_READ~GET_CALCULATION_INFO
  • IF_SADL_EXIT_CALC_ELEMENT_READ~CALCULATE Open ABAP Trace Requests

The method Calculate calls then two alternative methods where we do the calculations:

  • GET_PRICES_ABAP where the calculations are performed in ABAP code (used in Exercises 1 to 4)
  • GET_PRICES_CDS where the calculations are performed in CDS views (used in Exercise 5)

The method GET_PRICES_ABAP first determines for given AIRLINE = CARRIER_ID the corresponding connections (from table /DMO/CONNECTION) and for the connections the corresponding bookings (from table /DMO/BOOKING):
Open ABAP Trace Requests

And then the supplements for the bookings:
Open ABAP Trace Requests

and their prices and categories:
Open ABAP Trace Requests

Then we just loop over the selected data to calculate the totals and percentages:
Open ABAP Trace Requests Open ABAP Trace Requests Open ABAP Trace Requests

πŸ›  Exercises

^Top of page

Exercise Blocks --
Getting Started --
Getting Started --
Exercise Block for Functional Analysis --
Exercise 1: Analyze Errors with the Feed Reader --
Exercise 2: Usage of the Memory Inspector --
Exercise 3: Usage of the ABAP Cross Trace --
Exercise Block for Performance Analysis --
Exercise 4: Performance Analysis and Improvement using ABAP Trace and Table Comparison Tool --
Optional Exercises for Performance Analysis --
Exercise 4: Performance Analysis and Improvement using ABAP Trace and Table Comparison Tool --
Exercise 5: SQL Trace Analysis in SAP HANA SQL Analyzer --

In the Getting Started section we outline how to logon to the system and to access your package for these exercises. We shortly introduce the Fiori App to use in the exercises.

In Exercise 1 a runtime error occurs for specific input data. With the tool Feed Reader and the ABAP Debugger we examine the root cause. Here a specific case is not handled correctly in a single line of ABAP code.

In Exercise 2 after a change in the ABAP code an Out-Of-Memory error is thrown. This runtime error is usually not related to the call of a single line of code. We analyze with the Memory Inspector the memory consumption and increase.

In Exercise 3 you will then use the ABAP Cross trace for tracing and analysing ABAP Cloud applications across different runtime components. The tool is useful to track down errors or unexpected behavior even without runtime errors.

The focus of Exercise 4 is on performance analysis using the ABAP Trace. There we learn different techniques to improve the runtime in ABAP code. In addition with help of the Table Comparison Tool we analye a functional error introduced with one of our optimizations.

In Exercise 5 we perform a code push down to the HANA Database using CDS views. Here we learn to create an SQL trace and analyze the execution plan in the HANA SQL Analyzer in Visual Studio Code.

So let us start and have a look at the Getting Started section: Getting Started - Mandatory, please check.

Contributing

^Top of page

Please read the CONTRIBUTING.md to understand the contribution guidelines.

Code of Conduct

^Top of page

Please read the SAP Open Source Code of Conduct.

How to obtain support

^Top of page

Support for the content in this repository is available during the actual time of the online session for which this content has been designed. Otherwise, you may request support via the Issues tab.

License

^Top of page

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

Troubleshoot and optimize extensions for ABAP Cloud in cloud ERP

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors