Nov 21, 2025

What is ABAP Database Connectivity (ADBC)?

In SAP, ADBC stands for ABAP Database Connectivity. It is a class-based API that allows ABAP programs to directly execute Native SQL statements on the underlying database.

🔎 What ADBC Is

  • Definition: ABAP Database Connectivity (ADBC) is a modern interface in SAP that provides direct access from ABAP code to the database using SQL.
  • Purpose: It bridges ABAP applications with databases like SAP HANA, enabling developers to run complex queries and leverage advanced database features.
  • Type of API: Class-based, meaning it uses ABAP Objects (OO) rather than traditional procedural calls.

⚙️ Key Features

  • Direct SQL Execution: Developers can run SQL statements (SELECT, INSERT, UPDATE, DELETE) directly from ABAP without going through Open SQL.
  • Performance: Optimized for SAP HANA’s in-memory computing, allowing faster data retrieval and manipulation.
  • Flexibility: Supports database-specific features that are not available in standard Open SQL.
  • Integration: Useful when ABAP applications need to interact with external or advanced database functions.

📌 Example Usage

A typical ADBC workflow in ABAP involves:

  1. Creating a connection to the database using CL_SQL_CONNECTION.
  2. Preparing a statement with CL_SQL_STATEMENT.
  3. Executing the query and fetching results with CL_SQL_RESULT_SET.

DATA: lo_con TYPE REF TO cl_sql_connection, lo_stmt TYPE REF TO cl_sql_statement, lo_res TYPE REF TO cl_sql_result_set. lo_con = cl_sql_connection=>get_connection( ). lo_stmt = lo_con->create_statement( ). lo_res = lo_stmt->execute_query( 'SELECT * FROM my_table' ).

🚀 Why It Matters

  • For Developers: ADBC provides more control and efficiency when working with large datasets or advanced database features.
  • For Businesses: It enables real-time analytics and faster application performance, especially critical in SAP HANA environments.


Nov 13, 2025

SAP EWM Stock Tables

 

/SCWM/AQUA - Available Quantities

  • Updated at Warehouse Task creation;
  • Can be negative (it depends on your Customizing);
  • Contatins the quantity that is available for Warehouse Task creation;
  • Entry is deleted if quantity is zero.

/SCWM/QUAN - Attributes to Physical Stock

  • It has the attributes to a physical stock quantity;
  • For example: GR date, best before data, country of origin, delivery reference, etc.;
  • Entry is deleted when corresponding quantity in /LIME/NQUAN is zero.

/LIME/NQUAN - Physical Stock

  • Only needed for open Warehouse Tasks;
  • Reserve specific quantity for the Warehouse Task;
  • Entry will be set to zero when Warehouse Task is confirmed or cancelled;
  • Must NEVER be negative.

SAP EWM Function Modules

 

Function Modules
 
 


       /SCWM/TO_CREATE -> Product Warehouse Task Creation
       SCWM/TO_CREATE_MOVE_HU – HU warehouse task Creation
       /SCWM/TO_CANCEL-> To cancel PWT
       /SCWM/TO_CONFIRM -> To Confirm
       /SCWM/TO_CREA_HU_INT -> HU Warehouse Task Creation
       /SCWM/HUHDR_CREATE -> To create HU
       Class /SCWM/CL_WM_PACKING has methods to Pack, unpack and repack materials.
       /SCWM/HU_SELECT_GEN - Selecting Hus
       /SCWM/POHU_SELECT – Planned Shipping HU from database
       /SCWM/WAVE_SELECT – Selection of Wave
       /SCMB/MDL_GUID_CONVERT, /SCMB/MDL_GUID_CONVERT - Conversion GUID16 <-> GUID22
       /SAPAPO/MATLWH_READ_MULTI_2 – Read product Master Attributes
       /SCWM/TO_READ_HU – Read HU, /SCWM/HU_SELECT -             
       /SCWM/TO_INIT_NEW - Initialize WT Processing
       /SCWM/RSRC_READ_SINGLE - Get resource
       /SCWM/T346_READ_SINGLE - Queue Definition read
       /SCWM/RSRC_WHO_SELECT - Select warehouse order for resource
       /SCWM/WHO_TO_UNASSIGN - Remove Assignment of TOs to Warehouse Order
       /SCWM/WHO_TO_ASSIGN - Assign TOs to Warehouse Order
       /SCWM/WC_GET_MATID – Check Packing material
       /SCWM/TO_GET_WIP – Get Warehouse task

Aug 28, 2025

What is the Difference between Statement RETURN and EXIT in SAP ABAP?

Both RETURN and EXIT are control flow statements, but they serve different purposes and behave differently depending on the context. Here's a clear breakdown:

🔁 RETURN Statement

Purpose:
Used to exit a procedure—like a function module, method, or form—immediately and return control to the calling program.

Where it's used:

  • Function modules
  • Methods
  • Subroutines (FORM routines)

Behavior:

  • Ends the current procedure and returns to the caller.
  • No further code in the procedure is executed after RETURN.

Example:

FORM my_form. 

  IF sy-subrc <> 0. 

    RETURN. 

  ENDIF. " More code here won't run if RETURN is triggered 

ENDFORM.


🚪 EXIT Statement

Purpose:
Used to exit a loop or control structure like DO, WHILE, or LOOP.

Where it's used:

  • Inside loops (LOOP, DO, WHILE)
  • Not valid in procedures like methods or function modules (outside loops)

Behavior:

  • Immediately exits the current loop, but the rest of the surrounding code continues.
  • Does not exit the entire procedure.

Example:

LOOP AT it_table INTO wa_table. 

  IF wa_table-flag = 'X'. 

    EXIT. " Exits the LOOP, not the FORM 

  ENDIF. 

ENDLOOP.


🧠 Summary Table




Let me know if you want to see how CHECK fits into this trio—it’s another control statement that behaves a bit differently again.