Windows > Preferences > ABAP Formatter
Mar 24, 2026
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.lineItemannotations.
Summary Table
| Aspect | Basic View | Composite View | Consumption View |
|---|---|---|---|
| Accesses DB Tables | ✅ Yes | ❌ No | ❌ No |
| Joins other CDS views | Minimal | ✅ Yes | ✅ Yes |
| Reusability | High | High | Low (purpose-built) |
| UI/OData Annotations | Rare | Rare | ✅ Heavy |
| Aggregations | ❌ No | Rarely | ✅ 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.
DATA: BEGIN 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.
DATA: it_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
- Go to SAP Fiori Launchpad Designer (transaction
/UI2/FLPCM_CONF) - Set the Transport request number.
Go to rupper right corner and foun CLIENT ALL. Click the setting
Assign TR number - Navigate to your catalog → click "+" to add a Target Mapping
Create Catalog.
go to left lower corner - Configure Target Mapping
Click Target Mapping
Click lower menu 'Create Target Mapping' - Fill in:
- Action: e.g.
display - Semantic Object: e.g.
ZQMInspLot - Application Type:
Transaction - Transaction:
ZQM_INSP_LOT
- Action: e.g.
Step 2 – Create a Tile
- In the same catalog, add a new tileClick 'App Launcher - Statis'
- Set the Navigation Target to the semantic object + action you defined above
- Give it a title, icon, and subtitle
Step 3 – Assign to a Group/Role
- Create Group
Click the Plus sign on lower left
Name the group - Add catalog
Double click on plus sign to add catalog
Add the catalog - Assign the catalog to a Fiori role in transaction
PFCG - Don't forget to add the User ID in tab User
- Publish and transport
Step 4 – Test
- Open the Fiori Launchpad
- Find your tile and click it — it will open
ZQM_INSP_LOTwrapped in a UI5 shell
Feb 27, 2026
SAP S4 HANA EWM Important Tables
1. Stock
| /SCWM/AQUA | Available stock for warehouse task creation |
| /SCWM/QUAN | Physical stock attributes |
| /LIME/NQUAN | Physical stock |
| /SCWM/STOCK_IW01 | Normal stock |
| /SCWM/STOCK_IW02 | Batch managed stock |
| /SCWM/STOCK_IW03 | Reference stock (PDI, PDO) |
| /SCWM/STOCK_IW04 | Special stock |
2. Warehouse Task
| /SCWM/ORDIM_C | Warehouse tasks confirmed |
| /SCWM/ORDIM_CS | Serial number for confirmed warehouse task item |
| /SCWM/ORDIM_E | Exception codes for warehouse task |
| /SCWM/ORDIM_H | Warehouse task: Movements of HU items |
| /SCWM/ORDIM_HS | Serial numbers for HU item movements |
| /SCWM/ORDIM_L | Warehouse tasks log table |
| /SCWM/ORDIM_LS | Serial numbers for warehouse task log table |
| /SCWM/ORDIM_O | Warehouse tasks opened |
3. Transportation Unit
| /SCWM/TU_DLV | Assignment of Deliveries and HUs to Transportation Units |
| /SCWM/TU_DOOR | Relationship between TU activities and door activities |
| /SCWM/TUNIT | Data for the TU itself |
| /SCWM/TU_SR_ACT | Contains start date/times and end dates/times |
| /SCWM/TU_STATUS | Status of the TU activities |
| /SCWM/TU_VEH | Contains one or more vehicle activities with which a TU activity can be linked |
| /SCWM/DOOR_SRACT | S&R Activities of a Door |
4. Wave
| /SCWM/WAVEHDR | Wave header information |
| /SCWM/WAVEITM | Wave item |
5. Outbound Delivery
| /SCDL/DB_DLVH_O | Outbound Delivery Header |
| /SCDL/DB_DLVI_O | Outbound Delivery Item |
| /SCDL/DB_PROCH_O | Outbound Delivery Order Header |
| /SCDL/DB_PROCI_O | Outbound Delivery Order Item |
6. Inbound Delivery
| /SCDL/DB_PROCH_I | Inbound Delivery Header |
| /SCDL/DB_PROCI_I | Inbound Delivery Item |
7. Reference
| /SCDL/DB_REFDOC | Reference |
| /SCDL/DB_REQH | Header Inbound Delivery Notification / Outbound Delivery Request |
| /SCDL/DB_REQI | Item Inbound Delivery Notification / Outbound Delivery Request |
8. Handling Unit (HU)
| /SCWM/HUHDR | Handling unit header |
| /SCWM/GMHUIDENT | Additional HU Identifications for a Goods Movement Log |
| /SCWM/HUSSTAT | Individual status for each handling unit |
| /SCWM/HUREF | Handling unit reference |
| /SCWM/HUSTOBJ | Information about handling unit status object |
| /SCWM/GMHUSTAT | HU Status of HUs from Goods Movement Log |
| /SCWM/GMHUITM | Handling Unit Item |
| /SCWM/GMHUHDR | Goods Movement Handling Unit Header |
9. Storage Bins
| /SCWM/LAGP | Storage Bins |
| /SCWM/LAGPS | Bins for execution areas and activities |
10. Master Data
| /SAPAPO/MATKEY | Product |
| /SAPAPO/MATMAP | Mapping table for products |
| /SAPAPO/MATEXEC | Product execution data |
| /SAPAPO/MATTXT | Material Descriptions |
| /SAPAPO/MATLWHST | Location product for Location Warehouse and sub location storage type |
| /SAPAPO/MATLWH | Location 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
*"----------------------------------------------------------------------
*"*"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
*"----------------------------------------------------------------------
DATA: lt_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.