SD Report Custom development ALV report

Sales Order Gross Margin Report by Item

Short answer: A custom ALV report that compares the net value of every sales order item with the cost determined in pricing and shows the gross profit and margin percentage. Items below a chosen threshold are flagged, so sales teams see low-margin orders before they are billed.

Estimated effort
M · 3–5 working days
System
ECC and S/4HANA
Tables
5
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

VA05 lists orders with their net value but does not show cost or margin; the margin is visible only on the pricing screen of a single order in VA03. KE30 profitability analysis works on billed data with a configured operating concern and does not give the margin of open order items. Seeing low-margin items right after order entry needs a custom report.

Who uses it? Sales managers, pricing teams, sales controllers and finance managers.

Closest standard alternatives

  • VA05 List of Sales Orders. Lists orders with net value; shows no cost or margin.
  • KE30 Execute Profitability Report. Profitability analysis reports; need billed data and a configured CO-PA, and do not show open order items.

Tables used

The tables the report reads and their join fields. ECC and S/4HANA differences are marked separately.

TableRoleJoinSystem
VBAKSales Document HeaderOrder header, sales area, customer and pricing document number (driving table)—ECC + S/4
VBAPSales Document ItemItem net value and costVBAP-VBELN = VBAK-VBELNECC + S/4
KNA1Customer Master (General Section)Customer nameKNA1-KUNNR = VBAK-KUNNRECC + S/4
KONVConditions (Transaction Data)Cost condition check in ECCKONV-KNUMV = VBAK-KNUMV AND KONV-KPOSN = VBAP-POSNRECC only
PRCD_ELEMENTSPricing Elements (Document Conditions)Cost condition check in S/4HANAPRCD_ELEMENTS-KNUMV = VBAK-KNUMV AND PRCD_ELEMENTS-KPOSN = VBAP-POSNRS/4HANA only

S/4HANA notes

  • KONV → PRCD_ELEMENTS: In S/4HANA document conditions are stored in PRCD_ELEMENTS; custom code reading KONV must be adapted.

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_VKORGSales organizationRange / multipleVBAK-VKORGYes1000
S_VTWEGDistribution channelRange / multipleVBAK-VTWEGNo10
S_VKBURSales officeRange / multipleVBAK-VKBURNoIST1
S_AUDATOrder date rangeRange / multipleVBAK-AUDATYes01.11.2026 – 15.11.2026
S_KUNNRSold-to partyRange / multipleVBAK-KUNNRNo200100
S_MATKLMaterial groupRange / multipleVBAP-MATKLNoFG01
P_MINPCTMargin threshold (%)Single value—No15
P_NOREJExclude rejected itemsCheckbox—NoX

Output columns

#ColumnSource
1Sales orderVBAK-VBELN
2ItemVBAP-POSNR
3Order dateVBAK-AUDAT
4Sold-toVBAK-KUNNR
5Customer nameKNA1-NAME1
6MaterialVBAP-MATNR
7Item descriptionVBAP-ARKTX
8QuantityVBAP-KWMENG
9UnitVBAP-VRKME
10Net valueVBAP-NETWR
11CostVBAP-WAVWR
12Gross profitCalculated VBAP-NETWR − VBAP-WAVWR
13Margin %Calculated Gross profit ÷ VBAP-NETWR × 100
14CurrencyVBAK-WAERK
15FlagCalculated "Low margin" when the margin is below the threshold, "cost missing" when there is no cost

Sample output

Sales orderItemOrder dateSold-toCustomer nameMaterialItem descriptionQuantityUnitNet valueCostGross profitMargin %CurrencyFlag
122101011/03/2026200100Marmara GıdaFG-5001Packed product A400PC124,00086,80037,20030TRY
122102011/03/2026200100Marmara GıdaFG-5002Packed product B250PC60,00054,6005,4009TRYLow margin
122341011/06/2026200388Toros Yapı MarketFG-6100Garden set80SET96,000096,000100TRYCost missing
122511011/10/2026200245Karadeniz MarketFG-5001Packed product A150PC44,25032,55011,70026.40TRY
A view built with fictional sample data; not real system data.

How does the report work?

  1. VBAK and VBAP are read with the selection criteria; items with a reason for rejection (ABGRU) can be excluded.
  2. The item cost comes from VBAP-WAVWR; this value is taken from the cost condition in pricing (usually VPRS).
  3. When the cost is zero or empty, the pricing conditions are read from KONV in ECC and from PRCD_ELEMENTS in S/4HANA with VBAK-KNUMV and the item number, and the value (KWERT) of the cost condition is checked; if it is still missing the item is flagged as “cost missing”.
  4. Gross profit = VBAP-NETWR − VBAP-WAVWR, margin % = gross profit ÷ net value × 100. When the margin is below the threshold parameter the line is shown in red.
  5. The customer name is added from KNA1; the ALV gives subtotals per customer, material group and sales office. The total margin is calculated as total profit ÷ total net value, not as the average of item margins.

Performance notes

Keep the order date range mandatory. KONV is a very large table in ECC; read it only for items without WAVWR and with the KNUMV + KPOSN + KSCHL key.

Features

  • ALV list (sort, filter, subtotals)
  • User-specific layout variants
  • Double-click drill-down to the document Double-clicking the order opens the item pricing screen in VA03.
  • Export to Excel
  • Runs as a background job
  • Send the result by email Low-margin items can be sent to the sales manager every day.

Authorization objects

  • V_VBAK_VKOSales document authorization by sales area
  • V_VBAK_AATAuthorization by sales document type

Frequently asked questions

Where does the cost value come from?

From the cost condition in the pricing procedure (usually VPRS). At order time it takes the moving average or standard price of the material and writes it to VBAP-WAVWR.

How are orders in different currencies totalled?

Items are shown in the document currency. For totals, extra columns converted to the company code currency at the order date rate can be added.

What changes on S/4HANA?

On S/4HANA the pricing conditions are stored in PRCD_ELEMENTS instead of KONV. VBAP-WAVWR stays the same, so the main logic does not change; only the fallback table does.

Packages that include this solution

SD Package Custom

Pricing and Billing Accuracy Pack

A five-component pack that catches pricing and billing errors from loading the price list to posting the invoice: mass price condition upload from …

5 components · v1.0

Related reports

SD Report Custom ALV report

Sales Order – Delivery – Invoice Status Report

A custom ALV report that shows every sales order item on the same line as its delivery and invoice documents. You see in one list which orders have …

VBAK · VBAP · VBFA · LIKP

Let us build this report for your system

Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.

Related report: Sales Order Gross Margin Report by Item