REDUCE is used to aggregate values like totals, counts, etc., in a clean, functional style. *&---------------------------------------------------------------------* *& Report ZREP_LCLCLASS *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zrep_lclclass. TYPES: BEGIN OF ty_order, id TYPE i, amount TYPE i, END OF ty_order. DATA: lt_orders TYPE STANDARD TABLE OF ty_order WITH EMPTY KEY, lv_total TYPE i. lt_orders = VALUE #( ( id = 1 amount = 100 ) ( id = 2 amount = 250 ) ( id = 3 amount = 150 ) ). lv_total = REDUCE i( INIT sum = 0 FOR order IN lt_orders NEXT sum = sum + order-amount ). WRITE: / 'Total Amount:', lv_total. Output: Total Amount: 500
SAP EWM Help Latest Questions
In SAP, an enhancement refers to a mechanism that allows you to add or change standard SAP behavior without modifying the original SAP code. Enhancements are essential for implementing custom business logic while keeping the SAP standard upgradeable and maintainable. Purpose ...
The SELECT statement in SAP ABAP is used to retrieve data from database tables into internal tables or variables. It’s one of the most powerful and frequently used Open SQL statements in ABAP and helps interact with the underlying SAP ...
Association An association is a declarative relationship between CDS entities (like foreign keys), defined using the association keyword. Key Characteristics: Lazy/Evaluated-on-demand: Data from the association is not fetched unless it is explicitly accessed using a path expression (like to_customer.name). Navigation-style ...
SAP R/3 is based on a 3-tier client-server architecture, which separates presentation, application, and database layers. This design provides scalability, flexibility, and better performance. Three-Tier Architecture: 1. Presentation Layer (Client Tier) Interface between the user and SAP system Usually a SAP ...
A domain defines the technical characteristics of a field, such as: Data type (e.g., CHAR, NUMC, DEC) Field length Decimal places Value ranges (fixed values or intervals) Domains help in reusing field definitions across multiple tables or structures.
In SAP, the SICF node (defined in transaction SICF) is used to activate and manage ICF (Internet Communication Framework) services, which includes OData services. For SAP OData, the SICF node: Enables access to OData services over HTTP/S. Hosts the service endpoint under the ...
1. SELECTION-SCREEN BEGIN OF SCREEN As already explained, this defines a custom screen (like a subscreen or popup), which you can call dynamically using CALL SELECTION-SCREEN. SELECTION-SCREEN BEGIN OF SCREEN <screen_number> [AS SUBSCREEN|AS WINDOW] [TITLE <text>]. ... fields ...