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
AT SELECTION-SCREEN OUTPUT Purpose:This event is triggered before the selection screen is displayed to the user. Use Case:To modify the selection screen dynamically — for example, to hide/show fields, enable/disable them, or set default values based on conditions.
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.
Buffering in SAP refers to storing table data in application server memory to reduce repeated database access. It enhances performance by retrieving frequently accessed data from memory instead of querying the database every time. Why Buffer Tables? Speeds up data ...
Classical Reports in ABAP use a sequence of predefined events during program execution. These events let you structure your code based on data fetching, formatting, and output rendering. Event Description LOAD-OF-PROGRAM Triggered once when the program is loaded into memory (before anything else) INITIALIZATION Called before ...
Smart Forms are SAP’s graphical tool for creating and maintaining print forms. They were introduced as a replacement for SAPscript to simplify form development with a graphical, drag-and-drop interface and no need for a separate scripting language. Key Features: Built ...
Use the same destination (DEMO_EHS_DEST) Fetch a CSRF token Serialize an ABAP structure into JSON Send it as the POST body to the demo OData endpoint Handle the response cleanly CLASS /iap/cl_intelligent_matching DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. TYPES: BEGIN OF ty_rawmat_result, uuid TYPE string, material_id ...
A function module (FM) is a globally reusable procedure created in transaction SE37 or inside a Function Group. It can be called from anywhere in the system. When to use: · When you want reusable logic across different programs. · Supports exception handling ...
An IDoc (Intermediate Document) is a standard SAP data structure used for exchanging information between SAP systems or between SAP and non-SAP systems. It acts as a container for data that can be transmitted electronically, supporting both inbound (receiving data) ...
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 ...