KIIT University | School of Computer Engineering | SAP ERP Training Program 2026
Topic: Real ABAP Development Scenario — Custom ALV Report (Topic vi) Program ID: ZZ_SALES_PERF_ALV | Module: ABAP Workbench — SD Integration
| Field | Details |
|---|---|
| Name | AADI RATN |
| Roll Number | 23051560 |
| Batch | B.Tech CSE [2023–2027] |
| SAP Module | ABAP Workbench — SD |
| Transaction | ZZ_SP (Custom Transaction) |
In a standard SAP SD environment, sales managers rely on default transactions like VA05 (List of Sales Orders) to monitor order activity. However, these standard reports fall short in several critical areas:
- They do not combine data from multiple tables (VBAK, VBAP, KNA1, VBUK) in a single view.
- High-value orders cannot be identified at a glance — there are no colour indicators.
- Order completion status is not visible without drilling into each order individually.
- Results cannot be grouped by Sales Representative with automatic subtotals.
- No direct navigation from the list to VA03 (Display Sales Order) on double-click.
- Export and email options are limited and not customisable.
This project addresses all of the above limitations by building a fully custom ABAP ALV Grid report.
The report ZZ_SALES_PERF_ALV is a custom ABAP executable program that fetches, processes, and displays sales order data in an interactive ALV Grid with the following features:
| Feature | Implementation |
|---|---|
| Multi-table SQL JOIN | VBAK + VBAP + KNA1 + LEFT OUTER JOIN VBUK in one SELECT |
| Two-block Selection Screen | Block 1: business filters; Block 2: technical parameters |
| Row-level Colour Coding | INFO_FNAME = 'ROWCOLOR' — 4 tiers based on net order value |
| Traffic Light Status Icons | EXCP_FNAME = 'LIGHT' — Red/Yellow/Green from GBSTK field |
| Subtotals by Sales Rep | LVC_T_SORT with SUBTOT = X on ERNAM field |
| Custom Toolbar Buttons | Email, Export XLS, Summary Popup via on_toolbar event |
| Double-click → VA03 Navigation | SET PARAMETER ID 'AUN' + CALL TRANSACTION 'VA03' |
| Display Variant Save/Restore | DISVARIANT with /DEFAULT key per user |
| OOP Event Handler Class | Local class lcl_event_handler — modern ABAP OOP approach |
| Component | Technology / Tool | Role |
|---|---|---|
| Platform | SAP ECC 6.0 (Basis 7.50) | Hosts the ABAP runtime |
| Language | ABAP | Core programming language |
| ALV Framework | CL_GUI_ALV_GRID |
OOP ALV grid with event support |
| Container | CL_GUI_CUSTOM_CONTAINER |
Hosts grid inside Screen 100 |
| ABAP Editor | SE38 | Writing and testing the program |
| Data Dictionary | SE11 — Structure ZZ_SALES_PERF |
Output structure for field catalogue |
| Screen Painter | SE51 — Screen 100 | Custom GUI screen with container |
| Menu Painter | SE41 — GUI Status MAIN_STATUS |
PF-key toolbar and menu entries |
| Source Tables | VBAK, VBAP, KNA1, VBUK | Order data, customer, status |
| Email API | SO_NEW_DOCUMENT_ATT_SEND_API1 |
SAP Business Workplace email |
| Transaction | ZZ_SP (custom), SA38 | Execution entry points |
-
Multi-table JOIN with LEFT OUTER — The LEFT OUTER JOIN on VBUK ensures orders without a delivery or billing document are still included in the report, which is a real business requirement often missed in basic examples.
-
Dual Visual System — Row colour coding (
INFO_FNAME) and traffic light icons (EXCP_FNAME) are used simultaneously. Most standard tutorials demonstrate only one of these, not both together. -
OOP Local Class Event Handler — Uses
CLASS lcl_event_handler DEFINITIONwithSET HANDLERinstead of the older form-based event registration, following modern ABAP best practices. -
Parameterised Two-Block Selection Screen — Business filters (date, org, customer, rep) are cleanly separated from technical parameters (max records, currency) using two
SELECTION-SCREEN BEGIN OF BLOCKsections — consistent with SAP UI design guidelines. -
Hotspot Navigation without Dialog Modules — VA03 navigation on double-click uses
CALL TRANSACTIONwithAND SKIP FIRST SCREEN, which is simpler and more maintainable than writing separate dialog modules. -
Display Variant Persistence —
DISVARIANTwith/DEFAULTallows each user to save and restore their preferred column arrangement across sessions.
| Net Order Value | Row Colour | ABAP Code |
|---|---|---|
| > 1,00,000 | Dark Green | C710 |
| > 50,000 | Light Green | C610 |
| > 10,000 | Yellow | C310 |
| ≤ 10,000 | White/Default | C110 |
| Table | Description | Key Fields |
|---|---|---|
| VBAK | Sales Order Header | VBELN, AUDAT, VKORG, KUNNR, WAERK, ERNAM, GBSTK |
| VBAP | Sales Order Item | VBELN, MATNR, ARKTX, KWMENG, MEINS, NETPR, NETWR |
| KNA1 | Customer Master | KUNNR, NAME1 |
| VBUK | Sales Order Status | VBELN, GBSTK, LFSTK, FKSTK |
SAP_Project_ZZ_SALES_PERF_ALV/
│
├── src/
│ ├── ZZ_SALES_PERF_ALV.abap ← Main ABAP program (fully commented, 491 lines)
│ ├── ZZ_SALES_PERF_ALV_TOP.abap ← TOP include: all global constants & data declarations
│ ├── ZZ_SALES_PERF_ALV_SCR.abap ← SCR include: screen and selection screen reference
│ └── ZZ_SALES_PERF_DDIC.txt ← DDIC structure ZZ_SALES_PERF — field list for SE11
│
├── docs/
│ └── SAP_Project_Report_Final.pdf ← Project report (A4, 4-5 pages)
│
└── README.md ← This file
A working SAP ECC 6.0 or SAP IDES system with developer access (S_DEVELOP auth object).
- Open transaction SE11
- Select Data type → type
ZZ_SALES_PERF→ click Create - Choose Structure
- Add each field as listed in
src/ZZ_SALES_PERF_DDIC.txt- Use the exact Data Elements listed (e.g.,
VBELN_VA,NETWR_AP,ERNAM) - Add two custom fields at the end:
LIGHT— typeCHAR, length1(traffic light value)ROWCOLOR— typeCHAR, length4(ALV row colour code)
- Use the exact Data Elements listed (e.g.,
- Save → set Enhancement Category: Can be enhanced (char-type)
- Activate (Ctrl+F3)
- Open transaction SE51
- Enter Program =
ZZ_SALES_PERF_ALV, Screen =100→ Create - In the Layout editor, draw a Custom Control that fills the entire screen
- Name it exactly:
MAIN_CONTAINER - In Flow Logic, enter:
PROCESS BEFORE OUTPUT. MODULE status_0100. PROCESS AFTER INPUT. MODULE user_command_0100.
- Save and Activate
-
Open transaction SE41
-
Program =
ZZ_SALES_PERF_ALV, Status =MAIN_STATUS→ Create -
Add these entries under Function Keys:
Key Function Code Text F3 BACK Back F6 REFRESH Refresh F12 CANCEL Cancel -
Save and Activate
- Open transaction SE38
- Program =
ZZ_SALES_PERF_ALV→ Create- Title:
Custom ALV Sales Performance Report - Type:
Executable Program - Package:
ZLOCAL(or your development package)
- Title:
- Copy and paste the full content of
src/ZZ_SALES_PERF_ALV.abapinto the editor - Create the two include programs:
- SE38 →
ZZ_SALES_PERF_ALV_TOP→ Create → paste fromsrc/ZZ_SALES_PERF_ALV_TOP.abap - SE38 →
ZZ_SALES_PERF_ALV_SCR→ Create → paste fromsrc/ZZ_SALES_PERF_ALV_SCR.abap
- SE38 →
- Run Syntax Check (Ctrl+F2) — should show 0 errors
- Activate all programs (Ctrl+F3)
- Open SE93 → Transaction Code:
ZZ_SP - Short text:
Sales Performance ALV Report - Program:
ZZ_SALES_PERF_ALV| Screen:1000 - Save
SA38 → ZZ_SALES_PERF_ALV → F8
or
ZZ_SP → Enter → F8
Suggested inputs on Selection Screen:
- Order Date:
01.01.2024to31.12.2024 - Sales Org / Customer / Sales Rep: leave blank (fetch all)
- Max Records:
1000| Currency:USD - Checkboxes: ☑ Open Orders ☑ Completed Orders
Click Execute (F8) — the ALV Grid will open in a new screen with colour-coded rows, traffic light icons, subtotals per sales rep, and a grand total row.
For reviewers looking at the ABAP source code, the application logic follows a strict, modular procedural flow:
- Initialization (
INITIALIZATION): Text symbols for the selection screen are loaded. - Selection Screen (
AT SELECTION-SCREEN): User inputs date ranges, organizational filters, and display toggles (Open vs. Completed). - Data Fetching (
PERFORM fetch_data): A single optimizedSELECTstatement joins VBAK, VBAP, KNA1, and VBUK into an internal table (gt_sales). - Data Processing (
PERFORM process_data): Loops through the fetched records to assign traffic light statuses (1/2/3) and determine ALV row colour codes (C710/C610/C310/C110) based on the net value. Subtotals are accumulated. - ALV Preparation (
PERFORM display_alv):- The Field Catalogue (
gt_fcat) is built. - Layout parameters (
gs_layout) are set (Zebra, Auto-width, Exception fields). - Sort criteria are defined to inherently group by Sales Representative.
- The Field Catalogue (
- Screen Rendering (
CALL SCREEN 100): The Custom Container is instantiated, the OOPCL_GUI_ALV_GRIDis bound to it, and custom GUI Status events (Toolbar, Double-Click to VA03, Email) are registered via thelcl_event_handlerclass.
| # | Enhancement | Description |
|---|---|---|
| 1 | Currency Conversion | Convert all values to a single currency using CONVERT_TO_LOCAL_CURRENCY |
| 2 | Profit Margin Column | Derive margin % from VBAP-WAVWR (cost) vs VBAP-NETWR (value) |
| 3 | S/4HANA Migration | Re-implement using Fiori Elements + OData service (SEGW) |
| 4 | Scheduled Background Job | SM36 job to auto-email PDF every Monday morning |
| 5 | CL_SALV_TABLE Migration | Move to newer SAP ALV class for pivot support |
| 6 | Real-time Threshold Alerts | SAP Alert Management when order value exceeds a set limit |
| 7 | OData / REST API Exposure | Expose data for Fiori or Power BI dashboard consumption |
The screenshots included in docs/SAP_Project_Report_Final.pdf are AI-generated visual
representations of what the ABAP program would display in a real SAP ECC 6.0 / IDES system.
Direct access to an SAP IDES system was not available during preparation. The ABAP source code
in src/ is complete and fully functional — ready to deploy on any SAP ECC 6.0 system.
KIIT University | SAP ERP Training Program 2026 | Individual Project — No Plagiarism