Showing posts with label ABAP. Show all posts
Showing posts with label ABAP. Show all posts

Sunday, March 22, 2026

Troubleshooting AMDP procedures

T-code AMDP_UTILS (program RS_AMDP_UTIL) is a collection of ABAP programs related to AMDP related development. It serves a launchpad from where it is possible to run all the specific AMDP programs.



Description                                                  ABAP program

1. Debug the syntax check of an AMDP class                                    RSDBCHK_AMDP

Used to check, verify, or analyze the consistency of AMDP object.

 

2. Create, display, and delete database objects in an AMDP class           RSDBGEN_AMDP

Used for manipulating of database object belonging to AMDP object. E.g. deleting the AMDP procedures and recreate them with the most recent definition.

 

3. Find and delete obsolete AMDP database objects                               RS_AMDP_CLEANUP_TEST

Can be used for manual deletion of database artifacts belonging to AMDP object in case of an error.

 

4. Clean up inconsistent AMDP database obj (Note 2797905)                RS_AMDP_CLEANUP_INCONS_DBOBJS

Used for a cleanup for inconsistent AMDP entries on the database for a given class name.

 

5. Check the system configuration for AMDP                                        RS_AMDP_SICK

Checks several preconditions for syntax, generation and runtime for ABAP managed stored procedures are satisfied. As they are native database operations the checks depend on the database in the system.

 

6. Show the SQL environment                                                            RS_DB_ENVIRONMENT

Displays either own or other SQL properties stored in system view: sys.m_session_context

 

7. Touch for AMDP runtime                                                                 TOUCHSRC_AMDP

It is performing a so called “touch” means it is forcing the regeneration of a specific ABAP program. In this case the AMDP artefact.

 

8. Display the logical schema definitions                                              RS_DB_SCHEMA_DEF

 

9. AMDP table and scalar functions (consistency check)                        RS_AMDP_CONSISTENCY

AMDP Table Function Consistency Check

 

10. AMDP repair table functions (D010CDSTFUNCDEP)                         RS_AMDP_TFUNC_REPAIR

Repair tool for inconsistent CDS table functions (table D010CDSTFUNCDEP). Program searches for CDS table 

functions without entries in table D010CDSTFUNCDEP. If any inconsistencies are found use 'REPAIR' to repair them (by generating the corresponding AMDP classes).

 

11. AMDP debugger trace                                                                   RS_AMDP_DBG_TRACE

Control tracing of AMDP Debugger's SYS.DEBUG Calls

 

12. AMDP debugger prototype                                                           RS_AMDP_START_DEBUGGER

Control AMDP Debugger Prototype

 

13. AMDP PlanViz trace prototype                                                      RS_AMDP_PLANVIZ_TRACE

Control tracing of AMDP Calls via PlanViz

 

14. AMDP statement trace prototype                                                   RS_AMDP_STMT_TRACE

Control tracing of AMDP calls via SYS.M_ACTIVE_PROCEDURES means it controls SQL statement trace for AMDP calls, e.g. calls to HANA procedures.

 

15. AMDP plan profiler trace prototype                                                RS_AMDP_PLAN_PROFILER_TRACE

To be used as a control of SQLSCRIPT PLAN PROFILER trace for AMDP calls, e.g. calls to HANA procedures.

 

16. AMDP coverage trace prototype                                                     RS_AMDP_COVERAGE_TRACE

To be used as a control for a coverage trace for AMDP calls, e.g. calls to HANA procedures managed by the AMDP framework.

 

17. AMDP monitoring trace prototype                                                   RS_AMDP_MONITORING_TRACE

To be used as a controls for monitoring trace for AMDP calls, i.e. calls to HANA procedures managed by the AMDP framework.

 

18. AMDP/CDS call graph analysis                                                       RS_AMDP_VIEW_CALL_GRAPH

To be used to displays an AMDP/CDS call graph (condensed or uncondensed) or a unique call path.

 

19. Compare dependencies between ABAP and HANA                            RS_AMDP_DEP_CHECK

 

20. Manage system messages for consistency check                             RS_AMDP_SYSTEM_MESSAGES

To be used to display or delete messages specifically errors/warnings/informational messages related to ABAP-Managed Database Procedures (AMDP).

 

21. Consistency check for AMDP GRAPH WORKSPACES                        RS_AMDP_GRAPH_WORKSPACE_CHECK

Program checks consistency of GRAPH WORKSPACE definition with respect to uniqueness of key column values, occurrence of NULL values and occurrence of "dangling edges". Such inconsistencies will result in runtime errors when such a GRAPH WORKSPACE is used by an application.

 

22. Display AMDP metadata database tables                                        RS_AMDP_SHOW_DB_METADATA

To be used to display specific AMDP DB metadata tables like sys.procedures, sys.functions, sys.graph_workspaces, sys.synonyms, sys.views, sys.tables. See ABAP class CL_AMDP_SHOW_DB_METADATA for more info.

23. Display CDS synonyms (table and scalar functions)                         RSDBGEN_CDS

Create, display and delete an DB object of AMDP class.


More information:

BW Transformations: HANA runtime

2384315 - AMDP Debugger could not be started due to error message DEBUGGER_NO_MORE_DBG_WP

3247302 - How to collect a PlanViz trace for a HANA execution DTP


Wednesday, December 31, 2025

ABAP CL_RSAR_FUNCTION class in BW4/HANA

I wrote about the ABAP class CL_RSAR_FUNCTION a long time ago here. In a nutshell it provides a collection of static utility methods for common data transformations and calculations, particularly focused on date and string operations. The methods can be called directly without instantiating the class.

Now in a BW4/HANA based BW system there are few more methods added into the class.

ALPHA                                       ALPHA conversion

FISCPER_FISCPER3                       Date -> Fiscal Period 3

GET_LOGICAL_SYSTEM                 Get Logical System

GET_SOURCE_SYSTEM_ID             Get Source System ID

L_TRIM                                      Left Trim (string)

QUARTER_QUARTER1                    Month -> Quarter1

RTRIM                                        Right Trim (string, string)

SECONDS_BETWEEN_TIMESTAMPS Difference between 2 timestamps in seconds

SECONDS_TO_DAYS                     Convert seconds to days

SECONDS_TO_HOURS                   Convert seconds to hours

SECONDS_TO_MINUTES                Convert seconds to minutes

SET_REQUEST                             Set request

SET_REQUEST_CLOUD                  Set request for cloud based BW4

UTC_LONG_TO_LOCAL_DATE         UTC Timestamp -> Local Date

UTC_LONG_TO_LOCAL_TIME          UTC Timestamp -> Local Time

UTC_SHORT_TO_LOCAL_DATE        UTC Timestamp -> Local Date

UTC_SHORT_TO_LOCAL_TIME        UTC Timestamp -> Local Time


Saturday, April 19, 2025

ABAP Support Tools for Cloud - t-code SABAPAR

T-code code SABAPAR (program ABAP_TSM) is used as ABAP Support Tools for Cloud tasks SAP NetWeaver or ABAP Platform based systems. It helps with troubleshooting and maintaining ABAP programs, ensuring consistency and performance in cloud environments or in on-premise system e.g. for cloud readiness related tasks.

From this umbrella t-code it is possible to launch many different ABAP tools. Below is a list of the particular tools as well as how they are organized within several categories:


INDX-Like Data

RSINDX00                          Analyze ABAP Cluster Table and Update Data

RSINDX00_STREAMREADER Analyze Local Binary File in INDX Format

RSINDX00_LOCATOR           Find EXPORT TO INDX

RSINDXCHECK                    Find Broken Data Records in INDX Tables

 

DDIC Inconsistencies

RSNTABCONSISTENCY         Recursive Consistency Check for DDIC Runtime

RS_TYPE_WIZARD               Analyze Type Declarations

RSDDQV                             Quick Display with Time Stamps

RSNTVSABAP                     Compare Nametab with RTTC

SABP_DD_CATALOG_SUPPORT_VIEWER Nametab Object Viewer

 

PXA Objects

RSPXA000                       Consistency of Time Stamps, PXA <-> Database

RSPXA001                       Compare DDNM Time Stamp with Current Nametab

RSPXA002                       Invalidate Single Objects in PXA Buffer (Tou

 

ABAP Compiler

SYNT                                 Syntax Trace

SAPMSCOMPTEST               Compiler Tests

RS_ABAP_SYN_TYPES         Display Types from Syntax Check

RS_ABAP_ERROR_ANALYZE Syntax Error Analysis

RSLIN_SHOW_SCAN           Test ABAP Scanner

BADI_RSANALYZE               Analysis Report for New BAdIs

SENH                                 Display Enhancement Information

RS_SHOW_VIRT_KWS         Display Virtual Keywords

 

ABAP Load

RSDEPEND                       Get Dependent ABAP Sources for ABAP Load

RSDEP000                       Find ABAP Loads with Inconsistent Time Stamp (Touch

RSLOAD00                       Show Parts of ABAP Load

TOUCHSRC                       Reset Time Stamp for ABAP Source

TOUCHINC                       Reset Time Stamp for Consumers of ABAP Source

TOUCHTAB                       Reset Time Stamp for Consumers of DDIC Type

RSKMETH                        List of Registered Kernel Methods

RS_ABAP_BEHV_LOAD              BDEF Implementation

RS_CHECK_LOAD_VERSION_MISMATCH Find Version Inconsistencies in ABAP Load

RS_LOAD_FORMAT_ADM             Load Format Information of System

 

Trace Tools

RS_DYNPRO_TRACE           Dynpro Trace

RSSYNT00                          Syntax Trace with Navigation Tree

 

Simple Transformations (XML)

ST_TESTER                         Test ST Programs

RS_ST_DEPENDENCIES       Dependencies Between ST Programs

SXSLT_SC                          Display ST/XSLT Loads

S_ABAP_TOOLS_XML_LOAD_DISPLAY  Display ST/XSLT Loads (New)

 

ABAP Unit

RSAUNIT_SETUP_OVERVIEW                    Setup and Customizing

SAUNIT_ANALYSE_TEST_SRC_CODE         Compiler View of Test Classes

 

ABAP Keyword Documentation

ABAP_DOCU_SERVICES             Services and Administration

 

Miscellaneous Tools

RSTIME00                       Time Settings

RSCORE00                      Transfer Short Dumps from File to Da

RSNAPREAD                    Alternative and Lightweight Short Du

RSTRC000                       Change Trace

RSPARAM                        Display SAP Profile Parameters

ABAP_DOCU_SERVICES       Services for ABAP Online Documentation

RSABAP_DB_ACCESS          Display for Various ABAP Tables

SAMT                                 Program Sets

SCI                                         Code Inspector

RS_ABAP_BDEF_SHOW             BDEF Display

RS_ABAP_CLEAN_ANALYSIS      Delete COMP-PROCS Caches

RS_COCO_INFO_TOOL              Demonstration for Code Completion


Friday, March 28, 2025

Replacement of obsolete FM WWW_GET_MIME_OBJECT

Recently I noticed that FM WWW_GET_MIME_OBJECT was marked as obsolete.


Thus, Code Inspector reports it in case it is used in custom ABAP coding.

Function module WWW_GET_MIME_OBJECT is flagged as obsolete. Send any queries to the developer of the ==> Function module WWW_GET_MIME_OBJECT.


I was looking for a replacement function. I found FM WWWDATA_IMPORT. This FM has even interface similar to the WWW_GET_MIME_OBJECT. Below I introduce a call of both the FMs.

 

WWW_GET_MIME_OBJECT call:

DATA:  picture TYPE TABLE OF w3mime,

       w3_queries TYPE TABLE OF w3query,

       w3_htmls TYPE TABLE OF w3html,

      return_code TYPE w3param-ret_code,

      content_type TYPE w3param-cont_type,

      content_length TYPE w3param-cont_len.

 

    INSERT VALUE #( name  = `_OBJECT_ID`

                    value = `Z_SMW0_ENTRY`) INTO TABLE w3_queries.

    CALL FUNCTION 'WWW_GET_MIME_OBJECT'

      TABLES

        query_string        = w3_queries

        html                = w3_htmls

        mime                = picture

      CHANGING

        return_code         = return_code

        content_type        = content_type

        content_length      = content_length

      EXCEPTIONS

        object_not_found    = 1

        parameter_not_found = 2

        OTHERS              = 3.

 

WWWDATA_IMPORT call:

  DATA mime TYPE w3mimetabtype.

 

  DATA(key) = VALUE wwwdatatab( relid = `MI`

                                objid = `Z_SMW0_ENTRY` ).

  CALL FUNCTION 'WWWDATA_IMPORT'

    EXPORTING

      key                    = key

   TABLES

     mime                    = mime

   EXCEPTIONS

     wrong_object_type       = 1

     import_error            = 2

     OTHERS                  = 3.


Other option would be to replicate the function that the FMs are doing. In nutshell what both the FM are doing is to read the table WWWDATA via IMPORT ABAP command. Something like this:

  DATA key TYPE w3mimetabtype.
  key-objid = `Z_SMW0_ENTRY`.

  IMPORT mime FROM DATABASE wwwdata(mi) ID key.

 

Sunday, January 12, 2025

What is ABAP Cloud?

In 2023, ABAP – SAP’s proprietary programming language celebrated 40 years anniversary.  Nowadays there it is its latest evolution – ABAP Cloud. But what exactly it is?

The ABAP Cloud is the latest evolution of the ABAP programming language. It is modernized version of traditional language designed for cloud-native development in SAP Business Technology Platform (BTP) and as well as for hybrid setups where both on-premises (e.g. SAP S/4HANA editions) and cloud SAP systems coexist (side by side or extensions). It is the SAP's effort to bring their classic ABAP programming language and development tools into the cloud era.

It is not a new product but an evolution of the ABAP development model, enabling cloud-based solutions and extensions while adhering to modern development principles.

 

Features of the ABAP Cloud

·        Clean Core Principle: It enforces strict development guidelines that prevent modifications to standard SAP code, encouraging the use of extension points and APIs instead. This makes upgrades and maintenance easier.

·        Cloud-Optimized/Native support: It provides built-in support for cloud services, RESTful APIs, and modern web technologies while maintaining compatibility with traditional ABAP syntax. Focuses on principles of cloud computing, such as scalability, security, and high availability.

·        Restricted ABAP: Operates within a "restricted ABAP environment," which ensures that development aligns with cloud principles by enforcing the use of modern and safe ABAP practices. It prevents the use of older, system-dependent, or unsafe techniques. See ABAP Strict and ABAP language versions blog posts.

·        Development Model: It supports both on-stack (in the core system) and side-by-side (on SAP BPT) scenarios, allowing developers to create cloud-ready extensions and applications.

·        Core Elements:

·        ABAP Cloud incorporates essential components like:

o   Core Data Services (CDS) for data modeling and embedded analytics.

o   ABAP RESTful Application Programming (RAP) Model for business logic and service development. Programming model specifically designed for building modern, cloud-native business applications.

o   SAP Fiori and OData Integration: It is optimized for building SAP Fiori applications and RESTful services using OData. This aligns with SAP's UX strategy and the shift toward API-first development.

o   Cloud-optimized ABAP language syntax and tools.

·        Tools: Developers use ABAP Development Tools (ADT) in Eclipse as the integrated development environment (IDE).

·        Extensibility: Enables building of side-by-side extensions for SAP applications, such as SAP S/4HANA Cloud, without modifying the core application. This approach ensures that updates and upgrades to core systems are seamless.

 

Use cases of the ABAP Cloud

·        Modernizing legacy ABAP Code: Transitioning older ABAP developments to a cloud-ready format while adhering to best practices and SAP's guidelines.

·        Custom apps: Building entirely new applications to meet specific business needs, leveraging SAP BTP services.

·        Extensions: Extending the capabilities of SAP S/4HANA Cloud or on-premise systems without modifying the standard SAP codebase.

Steampunk vs. ABAP Cloud

It’s essential not to confuse ABAP Cloud with Steampunk (or Steampunk Embedded). The ABAP Cloud was initially introduced in steampunk or back then called “SAP Cloud Platform ABAP Environment” (approx. in 2018). Then the steampunk is internal name for the ABAP environment in SAP BTP, which offers a subset of classic ABAP functionality optimized for cloud development. Since then, the ABAP Cloud became also available in all SAP S/4HANA editions means it is present on the SAP S/4HANA stack.

Umbrella term 'ABAP Cloud' doesn’t mean development in the SAP BTP ABAP Environment. Rather it is more about cloud-ready development standards which also apply to on-premise or on-stack extensions to keep the core clean.

What to add? In a nutshell it is new cloud-ready ABAP development model. The ABAP Cloud is an SAP’s next step on a journey from classic ABAP to ABAP Cloud and perhaps, eventually to ABAP AI perhaps?

 

More information:

ABAP Cloud FAQ

ABAP Cloud what does it comprise

ABAP Cloud Technical use cases and recommended technologies


Saturday, December 16, 2023

"Results table" feature in SAP Code Inspector

SAP Code Inspector (t-code SCI) is a tool for analyzing and inspecting ABAP code. The tool is to help ABAP developers to ensure that ABAP code complies with certain coding standards, performance guidelines, and best practices. It performs static code checks, which means it analyzes the source code without actually executing it. The tool identifies potential issues, vulnerabilities, and areas for improvement in the code, facilitating the development of more robust and efficient applications.

Here I want to mention one feature of the SCI that is most likely not very known. It is called a "Results table". It is a button on SCI’s toolbar:

View of "Results table" provides comprehensive view where checks from the SCI and ABAP Extended Program Check (t-code SLIN) are combined.

In a picture below – issue marked in red are reported by the SCI. Issue marked in green are reported by the SLIN.


The "Results table" button is a new function that is added into SAP NetWeaver system as of SAP_BASIS 702.


Thursday, June 22, 2023

Upport Downport Overview (UDO) tool

SAP as any other software vendor needs to support its software thru its whole lifecycle. This involves also providing code changes introduced in higher-level releases to lower ones. Process like that is so called downporting. There can be a e.g. legal reasons for that.

Downporting is the process of porting an application or software component from a higher version of a platform to a lower version of the same platform. Similarly, there is an opposite process called upporting. It involves porting of software from lower to higher version.

In a world of SAP software, downporting and upporting is done using the UDO tool which simplifies the process of by generating a report which will be saved in the system in the normal deliverable package and be shipped in a SAP note.

The UDO tool is continuation of other tools like Correction Workbench (t-code SCWB), ABAP Split Screen Editor (t-code SE39), Version Management (dev pack SVRS), Note Assistant (t-code SNOTE) etc. It compares active version of the ABAP object in remote system (system that has the feature implemented) with version in the local SAP system (system where the feature is to be implemented aka downported). Then it collects DDIC changes, documentation changes and it prepares a new ABAP program. The ABAP program is usually called UDO_NOTE_X or in BW area RS_UDO_NOTE_X, where X stands for SAP Note number e.g. RS_UDO_NOTE_2367512. The report is called UDO report. The UDO report is published in specific SAP Note on SAP ONE Support portal and it can be downloaded from there. When the UDO report is executed (e.g. in customer system) it takes care of the DDICs and documentation and creates and activates them in the target system.

If there would not be the UDO tool in place all of these activities would need to take place manually. Of course, no one wants to do this job. On one hand, responsible developer may forget to write down all the steps needed. On the other hand, person who is implementing those steps manually may forgot to perform few of them. Therefore, a need to automate such activities is it is obvious.

Technically the UDO tool is implemented by ABAP program called SAP_LOCAL_DOWNPORT_ASSISTANT associated with t-code UDO and it is a part of SAP Software Logistics Toolset.

Wednesday, March 8, 2023

What are types of ABAP development packages?

Development package serves for purposes of structuring ABAP development objects into logical units.  In addition to organizing of the ABAP objects while the development packages can be organized in other packages it enables SAP software logistics to function.

Organizing of packages within other packages is enabled by the type of the development package. There are following three types (as per domain MAINPACK):

'S' - Structure packages

'X' - Main packages

'' - Development packages

 

A purpose of the structure packages is to act as top level container in the package hierarchy that defines architecture of the objects within the subordinate packages. This type of the package does not contain any development objects itself. Instead, they can contain package interfaces and subpackages.

A purpose of the main packages can be seen as group of semantically similar objects. As well as the structure packages the main one do not contain any development objects itself as well.

Development package groups development objects itself as per their types (e.g. domains, data elements, programs, includes, classes, etc.)

Main packages, with the exception of your own package interfaces and subpackages, cannot contain other repository objects. Subpackages, in turn, can be other main packages and the standard development packages.

Package are being created in t-code SE21 Package Builder. All the packages are stored in table TDEVC.

 

What development packages can be seen in the SAP NetWeaver/ABAP Platform based systems?

$TMP – Local or temporary objects, most visible one. All objects that are not needed to be transported into other system go in here.

Z* or Y* – custom development packages. All objects created by customer are stored in those packages.

$HV – Generated Help View Program

$MC – Generated Matchcode Programs/Functions

$ENQ – Generated ENQUEUE Function Modules

$GEN – Other generated objects

$SWF_RUN_CNT – Workflow Container: Generated Data Types

$EQ_GEN – Stores BW Easy Query generated objects. The package is created automatically upon first easy query generation. It includes all generated BW Easy Query objects such as the function modules.

 

More information:

ABAP Packages

SAP glossary