Mar 24, 2026

AdT (ABAP in Eclipse), Code Formatter/PrettyPrinter/Beautify setup in Eclips

 Windows > Preferences > ABAP Formatter












CDS View Types in SAP: Basic, Composite, and Consumption Views

These three types represent a layered architecture (also called the VDM – Virtual Data Model) used in SAP S/4HANA to structure CDS views by responsibility and reuse.


1. Basic View (@VDM.viewType: #BASIC)

  • Purpose: Sits directly on top of database tables or database views. It maps raw persistence layer data into a semantically meaningful structure.
  • Characteristics:
    • Accesses only one or very few base tables (minimal joins)
    • Contains no aggregations
    • Defines primary key, associations, and field-level annotations (e.g., @Semantics)
    • Acts as the single source of truth for a business entity
  • Example use: A basic view on EKKO (Purchase Order Header) that exposes PO fields cleanly.

2. Composite View (@VDM.viewType: #COMPOSITE)

  • Purpose: Combines and joins multiple Basic Views (or other Composite Views) to build a richer, more complete business object or business context.
  • Characteristics:
    • No direct access to database tables — always consumes Basic or other Composite views
    • Can include joins, unions, and calculated fields
    • Still mostly transactional/reporting-neutral — focuses on combining entities
    • Reusable across multiple consumption scenarios
  • Example use: A composite view joining PO Header and PO Item basic views to form a complete purchase order view.

3. Consumption View (@VDM.viewType: #CONSUMPTION)

  • Purpose: Tailored for a specific consumer — an app, report, API, or UI. It is the outermost layer exposed to the end user or application.
  • Characteristics:
    • Consumes Basic or Composite views (never touches tables directly)
    • Contains use-case-specific projections, filters, and annotations
    • Heavily annotated for the target consumer: @UI, @OData, @Analytics, @Search, etc.
    • May include aggregations (for analytical consumption)
    • Often not reused by other CDS views — it's purpose-built
  • Example use: A Fiori Elements list report view for Purchase Orders, with @UI.lineItem annotations.

Summary Table

AspectBasic ViewComposite ViewConsumption View
Accesses DB Tables✅ Yes❌ No❌ No
Joins other CDS viewsMinimal✅ Yes✅ Yes
ReusabilityHighHighLow (purpose-built)
UI/OData AnnotationsRareRare✅ Heavy
Aggregations❌ NoRarely✅ Yes (analytics)
VDM Annotation#BASIC#COMPOSITE#CONSUMPTION

Key Design Principle

Changes cascade upward, not downward.

If a table structure changes, you only fix the Basic View — Composite and Consumption views remain stable. This layering promotes stability, reuse, and separation of concerns, which is central to SAP's clean core philosophy in S/4HANA.

Mar 18, 2026

How to Send Internal Tables to Spool

Codes:

*&---------------------------------------------------------------------*
*& Report ZDIR_ITAB_TO_SPOOL
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zdir_itab_to_spool.

DATABEGIN OF it_t001 OCCURS 0,
        bukrs TYPE t001-bukrs,
        butxt TYPE t001-butxt,
        ort01 TYPE t001-ort01,
        land1 TYPE t001-land1,
      END OF it_t001.

DATAit_data TYPE TABLE OF lvc_s_1022,
      wa_data LIKE LINE OF it_data.

DATA:spoolid TYPE rspoid.
DATA:file_length TYPE  int4.


START-OF-SELECTION.

  SELECT FROM t001 INTO CORRESPONDING FIELDS OF TABLE it_t001.

  LOOP AT it_t001.
    CONCATENATE it_t001-bukrs
                it_t001-butxt
                it_t001-ort01
                it_t001-land1
              INTO wa_data SEPARATED BY space.
    APPEND wa_data TO it_data.
    CLEAR  wa_data.
  ENDLOOP.

  DESCRIBE TABLE it_data.
  file_length sy-tfill * 1022.

  CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
    EXPORTING
      i_file_length file_length
    IMPORTING
      e_spoolid     spoolid
    TABLES
      it_textdata   it_data.

  IF sy-subrc EQ 0.
    WRITE spoolid.
  ENDIF.


Testing Result:










Mar 12, 2026

How to run ABAP Z Transaction from SAP Fiori

Calling ABAP Z Transaction (ZQM_INSP_LOT) from SAP Fiori

This launches the transaction inside a Web Dynpro/GUI wrapper directly from the Fiori tile.

Steps:

Step 1 – Create a Target Mapping in FLP

  1. Go to SAP Fiori Launchpad Designer (transaction /UI2/FLPCM_CONF)
  2. Set the Transport request number. 
    Go to rupper right corner and foun CLIENT ALL. Click the setting









    Assign TR number















  3. Navigate to your catalog → click "+" to add a Target Mapping
    Create Catalog.
    go to left lower corner






























  4. Configure Target Mapping
    Click Target Mapping








    Click lower menu 'Create Target Mapping'







  5. Fill in:
    • Action: e.g. display
    • Semantic Object: e.g. ZQMInspLot
    • Application Type: Transaction
    • Transaction: ZQM_INSP_LOT





















Step 2 – Create a Tile

  1. In the same catalog, add a new tile






    Click 'App Launcher - Statis'








  2. Set the Navigation Target to the semantic object + action you defined above
  3. Give it a title, icon, and subtitle





Step 3 – Assign to a Group/Role

  1. Create Group









    Click the Plus sign on lower left
    Name the group
















  2. Add catalog

    Double click on plus sign to add catalog


    Add the catalog 



















  3. Assign the catalog to a Fiori role in transaction PFCG







































  4. Don't forget to add the User ID in tab User















  5. Publish and transport

Step 4 – Test

  1. Open the Fiori Launchpad
  2. Find your tile and click it — it will open ZQM_INSP_LOT wrapped in a UI5 shell

Feb 27, 2026

SAP S4 HANA EWM Important Tables

 1. Stock

/SCWM/AQUAAvailable stock for warehouse task creation
/SCWM/QUANPhysical stock attributes
/LIME/NQUANPhysical stock
/SCWM/STOCK_IW01Normal stock
/SCWM/STOCK_IW02Batch managed stock
/SCWM/STOCK_IW03Reference stock (PDI, PDO)
/SCWM/STOCK_IW04Special stock


2. Warehouse Task

/SCWM/ORDIM_CWarehouse tasks confirmed
/SCWM/ORDIM_CSSerial number for confirmed warehouse task item
/SCWM/ORDIM_EException codes for warehouse task
/SCWM/ORDIM_HWarehouse task: Movements of HU items
/SCWM/ORDIM_HSSerial numbers for HU item movements
/SCWM/ORDIM_LWarehouse tasks log table
/SCWM/ORDIM_LSSerial numbers for warehouse task log table
/SCWM/ORDIM_OWarehouse tasks opened


3. Transportation Unit

/SCWM/TU_DLVAssignment of Deliveries and HUs to Transportation Units
/SCWM/TU_DOORRelationship between TU activities and door activities
/SCWM/TUNITData for the TU itself
/SCWM/TU_SR_ACTContains start date/times and end dates/times
/SCWM/TU_STATUSStatus of the TU activities
/SCWM/TU_VEHContains one or more vehicle activities with which a TU activity can be linked
/SCWM/DOOR_SRACTS&R Activities of a Door


4. Wave

/SCWM/WAVEHDRWave header information
/SCWM/WAVEITMWave item


5. Outbound Delivery

/SCDL/DB_DLVH_OOutbound Delivery Header
/SCDL/DB_DLVI_OOutbound Delivery Item
/SCDL/DB_PROCH_OOutbound Delivery Order Header
/SCDL/DB_PROCI_OOutbound Delivery Order Item


6. Inbound Delivery

/SCDL/DB_PROCH_IInbound Delivery Header
/SCDL/DB_PROCI_IInbound Delivery Item


7. Reference

/SCDL/DB_REFDOCReference
/SCDL/DB_REQHHeader Inbound Delivery Notification / Outbound Delivery Request
/SCDL/DB_REQIItem Inbound Delivery Notification / Outbound Delivery Request


8. Handling Unit (HU)

/SCWM/HUHDRHandling unit header
/SCWM/GMHUIDENTAdditional HU Identifications for a Goods Movement Log
/SCWM/HUSSTATIndividual status for each handling unit
/SCWM/HUREFHandling unit reference
/SCWM/HUSTOBJInformation about handling unit status object
/SCWM/GMHUSTATHU Status of HUs from Goods Movement Log
/SCWM/GMHUITMHandling Unit Item
/SCWM/GMHUHDRGoods Movement Handling Unit Header


9. Storage Bins

/SCWM/LAGPStorage Bins
/SCWM/LAGPSBins for execution areas and activities


10. Master Data

/SAPAPO/MATKEYProduct
/SAPAPO/MATMAPMapping table for products
/SAPAPO/MATEXECProduct execution data
/SAPAPO/MATTXTMaterial Descriptions
/SAPAPO/MATLWHSTLocation product for Location Warehouse and sub location storage type
/SAPAPO/MATLWHLocation product for Location Warehouse

Jan 14, 2026

Sample Program of Function Module to Cancel Warehouse Task (SAP EWM)

 Function used:

  • /SCWM/TO_READ_HU - Get Handling Unit Information
  • /SCWM/TO_INIT_NEW - Initialize WT Processing
  • /SCWM/TO_CANCEL - Cancel Warehouse Task
  • /SCWM/HUMAIN_REFRESH - Refresh

FUNCTION ZFM_EWM_WT_CANCEL .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(IV_LGNUM) TYPE  /SCWM/LGNUM
*"     REFERENCE(IV_HUIDENT) TYPE  /SCWM/HUIDENT
*"     REFERENCE(IV_TANUM) TYPE  /SCWM/TANUM
*"  CHANGING
*"     REFERENCE(CT_RETURN) TYPE  BAPIRET2_T
*"----------------------------------------------------------------------

    DATAlt_ordim_o TYPE /scwm/tt_ordim_o,
          lt_bapiret TYPE bapirettab,
          lt_cancl   TYPE /scwm/tt_cancl,
          ls_data    TYPE /scwm/ordim_l,
          ls_cancl   TYPE /scwm/cancl.

    IF iv_huident IS NOT INITIAL.
      "Get open TOs
      "This codes is for multiple TOs/WTs
      "Collect all WTs in Handling Unit
      CALL FUNCTION '/SCWM/TO_READ_HU'
        EXPORTING
          iv_lgnum       iv_lgnum
          iv_huident     iv_huident
        IMPORTING
          et_ordim_o_src lt_ordim_o
        EXCEPTIONS
          error          1
          OTHERS         2.

      IF sy-subrc IS INITIAL.
        LOOP AT lt_ordim_o INTO DATA(ls_ordim_o).
          ##ENH_OK MOVE-CORRESPONDING ls_ordim_o TO ls_data.
          MOVE ls_data-tanum TO ls_cancl-tanum.
          APPEND ls_cancl TO lt_cancl.
          CLEAR ls_cancl.
        ENDLOOP.
      ENDIF.

    ELSE.
      "This codes is for a single TO/WT
      IF iv_tanum IS NOT INITIAL.
        ls_cancl-tanum iv_tanum.
        APPEND ls_cancl TO lt_cancl.
        CLEAR ls_cancl.
      ENDIF.
    ENDIF.

    CHECK lt_cancl[] IS NOT INITIAL.

    SORT lt_cancl.
    DELETE ADJACENT DUPLICATES FROM lt_cancl COMPARING tanum.

    "Initialize WT Processing
    CALL FUNCTION '/SCWM/TO_INIT_NEW'
      EXPORTING
        iv_lgnum iv_lgnum.

    "Cancel WT/TO
    CALL FUNCTION '/SCWM/TO_CANCEL'
      EXPORTING
        iv_lgnum       iv_lgnum
*       IV_SUBST       = ' '
        iv_qname       sy-uname
        iv_update_task 'X'
        iv_commit_work abap_false
        it_cancl       lt_cancl
      IMPORTING
        et_bapiret     lt_bapiret.

    "Check for possibility of Error (E), Abort (A), or an abnormal termination (X)
    LOOP AT lt_bapiret TRANSPORTING NO FIELDS
                       WHERE type CA 'AXE'.
    ENDLOOP.

    IF sy-subrc IS INITIAL.
      "If true, roll back
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

    ELSE.
      "commit work and wait to display new data after auto-refresh
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait abap_true.
      "Refresh
      CALL METHOD /scwm/cl_tm=>cleanup).
      CALL FUNCTION '/SCWM/HUMAIN_REFRESH'.
    ENDIF.

    IF lt_bapiret IS NOT INITIAL.
      LOOP AT lt_bapiret INTO DATA(ls_ret).
        IF ls_ret-row 0.
          DELETE lt_bapiret INDEX sy-tabix.
        ENDIF.
      ENDLOOP.
    ENDIF.

    ct_return[] lt_bapiret[].

ENDFUNCTION.