Mar 26, 2026

Running an ATC Check with Variant for a Z Program

Option 1: From SE38 (Most Direct)

  1. Open SE38, enter your Z program name
  2. Menu: Program → Check → ATC Check
  3. A dialog appears — select your Check Variant
  4. Confirm → results go to the ATC worklist

Option 2: From ATC Cockpit (Correct Flow)

  1. Go to transaction ATC
  2. Click "Schedule Run" (not "Run Check")
  3. In the next screen:
    • Define or select an Object Set containing your Z program
    • Select the Check Variant
  4. Set execution as "Immediately"
  5. Execute → view results under "Worklist"

Option 3: From SATC

  1. Go to SATC
  2. Button: "Create" a new run
  3. Specify:
    • Object Set → add your Z program (PROG / ZMYPROGRAM)
    • Check Variant
  4. Run immediately or schedule in background

Quickest Method

For a single Z program, SE38 → Program → Check → ATC Check is the fastest — it prompts for the variant inline and runs immediately without needing to define object sets.

Would you like help interpreting the results or configuring a specific check variant?

Mar 24, 2026

Function Module to Run a Simple ALV Report

Codes:

FUNCTION z_very_simple_alv.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"    REFERENCE(I_START_COLUMN) TYPE  I DEFAULT 25
*"    REFERENCE(I_START_LINE) TYPE  I DEFAULT 6
*"    REFERENCE(I_END_COLUMN) TYPE  I DEFAULT 100
*"    REFERENCE(I_END_LINE) TYPE  I DEFAULT 10
*"    REFERENCE(I_TITLE) TYPE  STRING DEFAULT 'ALV'
*"    REFERENCE(I_POPUP) TYPE  FLAG DEFAULT ' '
*"  TABLES
*"      IT_ALV TYPE  STANDARD TABLE
*"----------------------------------------------------------------------

  DATA go_alv TYPE REF TO cl_salv_table.

  TRY.
      cl_salv_table=>factory(
        IMPORTING
          r_salv_table = go_alv
        CHANGING
          t_table      = it_alv[] ).

    CATCH cx_salv_msg.
  ENDTRY.

  DATA: lr_functions TYPE REF TO cl_salv_functions_list.

  lr_functions = go_alv->get_functions( ).
  lr_functions->set_all( 'X' ).

  IF go_alv IS BOUND.
    IF i_popup = 'X'.
      go_alv->set_screen_popup(
        start_column = i_start_column
        end_column  = i_end_column
        start_line  = i_start_line
        end_line    = i_end_line ).
    ENDIF.

    go_alv->display( ).

  ENDIF.

ENDFUNCTION. 


Sample program to call the Function:

REPORT z_very_simple_alv.

DATA gt_tab TYPE STANDARD TABLE OF sflights.

SELECT * FROM sflights INTO TABLE gt_tab.

CALL FUNCTION 'Z_VERY_SIMPLE_ALV'
  TABLES
    it_alv = gt_tab.


Result





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

 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