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
Purpose of TMG Events Events in TMG are used to: Validate data before it’s saved. Set default values when creating entries. Restrict access to rows based on user roles. Log changes or trigger custom logic. Enforce complex business rules beyond field-level checks. Where You Configure TMG Events Transaction: ...
SAPscript is the oldest SAP form development tool, mainly used for printing business documents such as invoices, purchase orders, delivery notes, and payment advices. It provides a way to design, format, and print text-based documents directly from SAP. How it works: The ...
In SAP CDS (Core Data Services), when you create a CDS view in ABAP, two different names are involved: the CDS view name (the logical name in the ABAP layer) and the @AbapCatalog.sqlViewName (the technical name of the corresponding SQL ...
Inheritance allows one class to reuse the code from another class. In SAP ABAP, this helps in building modular, reusable, and maintainable programs. Use of Inheritance in SAP Purpose
An EntityType defines the structure of an entity in OData. It specifies the entity’s properties (like fields/columns), key fields, and relationships. Think of it like a class or schema that describes the shape of data within an EntitySet. <EntityType Name=”Product”> <Key>
Aspect Service Definition Service Binding (Implementation) Purpose Lists which entities to expose Specifies how and in what format to expose File Type .srvcds .srvsbnd Output Logical definition Concrete, runnable OData service Required For Access? Not enough alone Needed to access via browser/API/UI Draft Support Not defined here Chosen in binding options
This report is a sample program that demonstrates how a user can enter and organize different kinds of input on an SAP screen. It includes simple fields like dates, codes, and names where you can type in values. It also ...