This is a test message to test the length of the message box.
Login

ABAP Quick - Callstack

Sometimes you want to know where you stand or just to make sure that the program or the method was called at the right time? We help you out with this simple implementation.

Advertising

There is a simple function module in the system for reading the current callstack. With SYSTEM_CALLSTACK you get the current call for the currently running code.

 

Example

The implementation as the following example:


DATA lt_stack TYPE abap_callstack.

" Get the actual callstack
CALL FUNCTION 'SYSTEM_CALLSTACK'
  EXPORTING
    max_level = 0
  IMPORTING
    callstack = lt_stack.

 

As a result, you get a table with the most important information, such as:

  • Program/include
  • Code line
  • Blocktype/-name

 

ABAP debugger callstack

 

Parameter

As the documentation of the function modules describes, only the exporting parameter callstack should be used, since it also contains all the information and the parameter et_callstack is obsolete.

If all information is needed, the level remains at 0. If only the last x-levels are needed, for example because the position is called in a standard program or a user exit, then a small number of the last calls is sufficient.

 

Conclusion

With the simple function module you can implement many checks and features in a large application or implement security features. Your imagination knows no bounds.


Included topics:
QuickCallstack
Comments (0)
Advertising

ABAP Quick - Wait for task

Category - ABAP

Today a tip for asynchronous processing or if you want to put processing in a separate task in special situations. What happens afterwards?

03/05/2021

ABAP Quick - Performance INSERT vs VALUE

Category - ABAP

In this article we take a look at the performance of the insert operations APPEND, INSERT and VALUE with regard to tables and evaluate the performance and stability during development.

02/26/2021

ABAP - BOPF Quick Guide (Update)

Category - ABAP

A little update to our book that we published. For all people who find the paperless office boring.

10/23/2020

ABAP - BOPF Quick Guide

Category - ABAP

You need a quick introduction to the SAP Business Object Processing Framework (BOPF), we have the right guide for you here.

09/11/2020

ABAP Quick - Search in source code

Category - ABAP

Sometimes it is necessary to search through different source codes in one system. We show you how it works in the SAP GUI and in Eclipse.

04/24/2020

We use cookies for our services and functions. More informations