Tuesday, June 16, 2026

Search SAPMV45A includes for Constants and Statics

 This report can find CONSTANTS and STATICS in SAPMV45A Z-includes. We know that Constants and Statics consume global variables so identifying them can help reduce their usage and improve GV count. 






*&---------------------------------------------------------------------*
*& Report ZGB_TEST_36
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zzcoe_sd_include_search.

TYPESBEGIN OF lty_coding_ext,
         funcname      TYPE trdir-name,
         context(40)   TYPE c,
         lfdnr(5)      TYPE n,
         lineno(5)     TYPE n,
         codeline(255TYPE c,
       END OF lty_coding_ext.

TYPESBEGIN OF lty_include,
         include TYPE repid,
       END OF lty_include.

DATAlt_include            TYPE TABLE OF lty_include.
DATAlt_statement          TYPE TABLE OF lty_coding_ext.
DATAls_statement          TYPE          lty_coding_ext.
DATAls_include            TYPE          lty_include.

DATA lt_gen_limit TYPE TABLE OF progname.

DATAlv_string TYPE string.

*PARAMETERS:
* pa_text TYPE char50 DEFAULT 'CONSTANTS'.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-b01.
  PARAMETERS:
    rb_con RADIOBUTTON GROUP rb1 DEFAULT 'X',
    rb_sta RADIOBUTTON GROUP rb1.
*    rb_ref RADIOBUTTON GROUP rb1.
SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

  IF rb_con IS NOT INITIAL.
    lv_string 'CONSTANTS'.
  ENDIF.

  IF rb_sta IS NOT INITIAL.
    lv_string 'STATICS'.
  ENDIF.

*  IF rb_ref IS NOT INITIAL.
*    lv_string = '=>'.
*  ENDIF.

*  MOVE pa_text TO lv_string.


  CALL FUNCTION 'RS_GET_ALL_INCLUDES'
    EXPORTING
      program      'SAPMV45A'
*     WITH_INACTIVE_INCLS          = ABAP_FALSE
*     WITH_RESERVED_INCLUDES       = ABAP_FALSE
*     WITH_CLASS_INCLUDES          = ABAP_TRUE
*     WITH_E_INCLUDES              = ABAP_FALSE
    TABLES
      includetab   lt_gen_limit
    EXCEPTIONS
      not_existent 1
      no_program   2
      OTHERS       3.
  IF sy-subrc <> 0.
* Implement suitable error handling here
  ENDIF.

  LOOP AT lt_gen_limit ASSIGNING FIELD-SYMBOL(<lfs_gen_limit>).

    IF <lfs_gen_limit>+0(1'Y' OR <lfs_gen_limit>+0(1'Z'.
      ls_include-include <lfs_gen_limit>.
      APPEND ls_include TO lt_include.
    ENDIF.
  ENDLOOP.

*ls_include-include = 'ZOTCE0229_POE_FOR_RETURNS'.
*
*APPEND ls_include TO lt_include.

  CALL FUNCTION 'AA_CUS_SCAN_PROG_FOR_STRING'
    EXPORTING
      id_string1 lv_string
*     ID_STRING2 = lv_string
*     ID_PROGRAM =
* IMPORTING
*     EF_FOUND   =
    TABLES
      it_program lt_include
      et_coding  lt_statement.



*LOOP AT lt_statement INTO ls_statement.
*  WRITE: / ls_statement-funcname,
*           ls_statement-context,
*           ls_statement-lfdnr,
*           ls_statement-lineno,
*           ls_statement-codeline.
*ENDLOOP.



*==============Display ALV==================*
  DATAgr_table TYPE REF TO cl_salv_table.
  TRY.
      CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table gr_table
        CHANGING
          t_table      lt_statement" Provide the table name
    CATCH cx_salv_msg.
  ENDTRY.
  TRY.
      gr_table->get_columns)->get_column'CODELINE' )->set_leading_spacesabap_true ).
    CATCH cx_salv_not_found.
  ENDTRY.

*... Display Table
  gr_table->display).

Monday, June 15, 2026

How to Implement SAP Clean Core in SAP System(e.g. HANA 2023 on-premise)

 To check for clean core related notes / latest updates check SAP Note

3627152 - SAP Note Analyzer Files for ATC Checks Related to Clean Core

https://me.sap.com/notes/3627152

Implement SAP Notes in your local/central check system using Note Analyzer by processing the following steps:

  1. Launch transaction SNOTE.
  2. In the menu bar, select "Goto > Other tools > Launch Note Analyzer".
  3. Upload the file SAP-NOTE-3627152-CENTRAL.xml available as attachment to this SAP Note. You can now process the notes using SAP Note Analyzer.



Implement all the notes. The lights should be green.

It is also recommended to apply SAP Notes in checked systems (i.e., systems that will be analyzed by Analyze Custom Code app or ATC). Update your checked systems using SAP Note Analyzer by processing the following steps:

  1. Launch transaction SNOTE.
  2. In the menu bar, select "Goto > Other tools > Launch Note Analyzer".

All notes need to be implemented and lights should be green.

Tuesday, May 26, 2026

10 Analytical Questions for SAP ABAP for HANA L8: Architectural Integration & & Leadership Scenarios

 

1.

Your team is building a high-volume SAP Fiori analytical application. The backend data architecture relies on a complex network of nested Core Data Services (CDS) views. What is the most efficient, automated approach to expose these underlying CDS views as an OData service while minimizing manual mapping layer overhead?

  A.

Use the transaction SE11 to manually map every individual column field into an interface cluster structure container.

  B.

Build a custom AMDP wrapper to serialize the CDS view output into an XML string array, then expose it via an RFC destination.

  C.

Add the annotation @OData.publish: true to the top of the primary consumption CDS view, allowing the system to automatically generate the necessary gateway artifacts.

Right answer

The @OData.publish: true annotation instructs the SADL (Service Adaptation Description Language) framework to auto-generate the OData service definition, metadata, and runtime classes based directly on the CDS layout, bypassing manual SEGW mapping.

  D.

Write a classic ABAP program that runs a nightly batch process to export the view rows into flat files on an external application server directory.

 

2.

A junior developer on your team has configured a modern SAP Fiori list report to display invoice data using ALV with Integrated Data Access (ALV with IDA). They report that sorting and paging are extremely slow. Upon review, you find they fetched the entire dataset into an application internal table before feeding it to the IDA container. What leadership direction should you provide?

  A.

Instruct them to increase the application server's dialogue work process memory allocation parameter limits via transaction RZ11.

  B.

Advise them to replace the ALV with IDA framework with legacy REUSE_ALV_GRID_DISPLAY function modules to optimize layout speed.

  C.

Explain that ALV with IDA must perform sorting and paging directly at the database layer. Direct them to pass the name of the database table or CDS view directly to the IDA instantiation method instead of fetching rows into memory.

That's right!

ALV with IDA is specifically designed to push UI operations like paging, sorting, and filtering down to the database level. Fetching rows into an ABAP internal table first bypasses the IDA framework's optimization benefits entirely.

  D.

Tell them to add more secondary indexes to the underlying tables on the HANA database.

 

3.

Your team is migrating a legacy ERP system to SAP S/4HANA. During code remediation, a developer finds several custom transactions that rely on implicit sorting behavior because they omitted the ORDER BY clause in their database queries. As a Team Lead, how should you govern this remediation step?

  A.

Direct the developer to replace the database queries entirely with file system read loops.

  B.

Leave the queries unchanged, because the S/4HANA compatibility layer automatically injects primary key sorting into all legacy statements.

  C.

Enforce a mandatory rule to explicitly add the ORDER BY clause to these queries, because SAP HANA's parallel column processing engine does not guarantee any default row ordering when returning datasets.

That's right!

Traditional databases often returned rows sorted by primary key implicitly. Because SAP HANA executes queries across columns in parallel, it returns data without a default order unless an explicit ORDER BY clause is included.

  D.

Instruct them to mark the affected tables as Row Store entities to restore legacy row-by-row fetching behavior.

 

4.

You are reviewing the architecture for a new integration scenario. A developer wants to use an AMDP procedure to update master records from an external system, but they also want to trigger standard SAP business workflow events directly from within the SQLScript body. Why must you reject this design?

  A.

AMDP methods run directly within the native database container layer and cannot execute application-layer components, such as standard ABAP function modules or workflow event triggers.

That's right!

AMDP code executes purely within the database engine using SQLScript. It has no access to application-layer logic, meaning business components like workflow event triggers must be executed from the ABAP layer after the AMDP call completes.

  B.

AMDP procedures are strictly restricted to read-only queries and cannot modify database state under any circumstances.

  C.

SQLScript requires all workflow objects to be passed in as unstructured XML payloads.

  D.

The SAP Gateway hub blocks any transactional requests initiated by background database processes.

 

5.

During a sprint review, a developer suggests using a virtual table link via SAP HANA Smart Data Access (SDA) to join a massive live table on a remote non-SAP database with a local S/4HANA finance table inside a core CDS view. What risk should you highlight as a Lead Architect?

  A.

Queries may suffer from significant network latency and performance bottlenecks, because data from the remote system must be transferred across the network to be joined with the local dataset at runtime.

Right answer

While Smart Data Access (SDA) makes remote tables look like local entities, joining massive remote tables with local data requires moving data across the network boundary, which can severely impact query response times.

  B.

The CDS framework will raise a critical syntax compilation dump because it is completely forbidden to access SDA objects.

  C.

Remote queries bypass the target system's security rules, causing an immediate database connection drop.

  D.

SDA links automatically encrypt and lock the entire local database instance until the query completes.

 

6.

Your project requires exposing an existing complex custom business algorithm to a third-party non-SAP cloud service via a RESTful API. The algorithm requires complex procedural loops and accesses multiple tables. Which integration approach aligns best with L8 architectural best practices?

  A.

Create a simple CDS view that maps to the tables, and instruct the external system to poll it using repeated raw SQL injections.

  B.

Write a custom file listener utility script that runs on the presentation layer to parse raw data streams.

  C.

Grant the external cloud service direct read/write administrative access to the underlying HANA database catalog tables via native JDBC.

  D.

Encapsulate the procedural processing logic inside an AMDP method, expose that method via an ABAP class, and wrap it within a standard SAP Gateway OData service endpoint.

That's right!

This approach leverages the strengths of each layer: the AMDP handles high-performance data operations on the database, the ABAP class manages business logic encapsulation, and SAP Gateway provides a secure, standardized REST/OData interface for external consumers.

 

7.

A business stakeholder requests a live dashboard that updates every 5 seconds, pulling data from a massive transactional log table via an advanced CDS view structure. As a technical lead, how should you respond to balance business needs with system stability?

  A.

Approve the request immediately, because SAP HANA's in-memory computing power can process any number of heavy queries with zero impact on system resources.

  B.

Instruct the developer to add a hardcoded infinite delay loop inside the CDS view source definition to throttle query processing.

  C.

Recommend migrating the entire transactional database to a standalone flat-file storage drive to handle the high request volume.

  D.

Advise that a 5-second live refresh rate on massive transactional tables can cause high CPU usage and fill up delta memory storage. Negotiate a realistic refresh interval or propose an event-driven notification strategy instead.

That's right!

Frequent, short-interval queries against massive live tables increase system load and can impact performance. Suggesting an event-driven pattern or a longer refresh rate balances stakeholder visibility with system stability.

 

8.

Your development team is creating multiple CDS views that require access to sensitive human resources data. What governance step must you enforce to ensure data security complies with standard corporate auditing requirements?

  A.

Instruct developers to create a separate copy of the database table for each individual employee profile.

  B.

Rely entirely on frontend Fiori UI element masking to hide data fields from unauthorized users.

  C.

Annotate the views with @Security.bypassAllChecks: true to simplify compliance logging.

  D.

Require each CDS view to be paired with an explicit Data Control Language (DCL) artifact using the DEFINE ROLE statement to enforce row-level security boundaries at the database layer.

That's right!

DCL artifacts allow you to define granular, role-based access rules for CDS views, ensuring that row-level security checks are pushed down and executed directly by the database engine.

 

9.

A developer wants to create a new CDS view that incorporates a complex mathematical formula. They are unsure whether to define it as an Virtual Element via ABAP exit mapping or as a native calculated field expression in the DDL view source code. What guidance should an L8 lead provide?

  A.

Instruct them to implement the formula using an external javascript file loaded into the gateway hub.

  B.

Recommend using a native DDL calculated field expression to ensure the math operation is pushed down to the database layer, rather than calculating it line-by-line via an application-layer exit.

That's right!

Defining calculations directly in the DDL source code pushes the mathematical operations down to the database engine. Virtual Elements rely on application-layer exits that process data after it is fetched, which can impact performance.

  C.

Direct them to use Virtual Elements because application-layer calculations are significantly faster than in-memory database processing.

  D.

Explain that native DDL view expressions completely break compatibility with SAP Fiori frontend cards.

 

10.

During a code quality audit, you find a critical custom module that fetches thousands of records from an S/4HANA table inside an unthrottled RFC method loop to send data to an external procurement system. What alternative architecture should you propose as a Team Lead?

  A.

Redesign the scenario to use a delta-enabled OData service or leverage SAP Enterprise Messaging / Event Mesh to send data changes incrementally based on transactional events.

That's right!

Moving away from heavy, loop-based polling to an event-driven pattern (like Event Mesh) or delta-based services improves efficiency, reduces system load, and ensures timely data updates.

  B.

Increase the timeout parameters of the remote RFC connection to allow the loop to run indefinitely without error.

  C.

Propose converting the RFC method into a series of manual file download steps handled by the business users.

  D.

Instruct the developer to add an explicit database lock to the entire table during the RFC loop execution path.

 

Search SAPMV45A includes for Constants and Statics

 This report can find CONSTANTS and STATICS in SAPMV45A Z-includes. We know that Constants and Statics consume global variables so identifyi...