{"audience":"Sales managers, pricing teams, sales controllers and finance managers.","authorization_objects":[{"note":"Sales document authorization by sales area","object":"V_VBAK_VKO"},{"note":"Authorization by sales document type","object":"V_VBAK_AAT"}],"components":[],"countries":[],"effort_days_max":5,"effort_days_min":3,"effort_size":"M","faq":[{"a":"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.","q":"Where does the cost value come from?"},{"a":"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.","q":"How are orders in different currencies totalled?"},{"a":"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.","q":"What changes on S/4HANA?"}],"features":[{"code":"alv","label":"ALV list (sort, filter, subtotals)","note":""},{"code":"layout","label":"User-specific layout variants","note":""},{"code":"drilldown","label":"Double-click drill-down to the document","note":"Double-clicking the order opens the item pricing screen in VA03."},{"code":"excel","label":"Export to Excel","note":""},{"code":"background","label":"Runs as a background job","note":""},{"code":"email","label":"Send the result by email","note":"Low-margin items can be sent to the sales manager every day."}],"functions":[],"gap":"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.","id":"sd-sales-order-gross-margin","industries":[],"input_columns":[],"kind":"report","language":"en","lastmod":"2026-11-17","logic":"1. VBAK and VBAP are read with the selection criteria; items with a reason for rejection (ABGRU) can be excluded.\n2. The item cost comes from VBAP-WAVWR; this value is taken from the cost condition in pricing (usually VPRS).\n3. 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\".\n4. 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.\n5. 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.","module":"SD","object_type":"alv_report","output_columns":[{"calculated":false,"formula":"","label":"Sales order","source_field":"VBELN","source_table":"VBAK"},{"calculated":false,"formula":"","label":"Item","source_field":"POSNR","source_table":"VBAP"},{"calculated":false,"formula":"","label":"Order date","source_field":"AUDAT","source_table":"VBAK"},{"calculated":false,"formula":"","label":"Sold-to","source_field":"KUNNR","source_table":"VBAK"},{"calculated":false,"formula":"","label":"Customer name","source_field":"NAME1","source_table":"KNA1"},{"calculated":false,"formula":"","label":"Material","source_field":"MATNR","source_table":"VBAP"},{"calculated":false,"formula":"","label":"Item description","source_field":"ARKTX","source_table":"VBAP"},{"calculated":false,"formula":"","label":"Quantity","source_field":"KWMENG","source_table":"VBAP"},{"calculated":false,"formula":"","label":"Unit","source_field":"VRKME","source_table":"VBAP"},{"calculated":false,"formula":"","label":"Net value","source_field":"NETWR","source_table":"VBAP"},{"calculated":false,"formula":"","label":"Cost","source_field":"WAVWR","source_table":"VBAP"},{"calculated":true,"formula":"VBAP-NETWR − VBAP-WAVWR","label":"Gross profit","source_field":null,"source_table":null},{"calculated":true,"formula":"Gross profit ÷ VBAP-NETWR × 100","label":"Margin %","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Currency","source_field":"WAERK","source_table":"VBAK"},{"calculated":true,"formula":"\"Low margin\" when the margin is below the threshold, \"cost missing\" when there is no cost","label":"Flag","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"select_option","label":"Sales organization","name":"S_VKORG","ref_field":"VBAK-VKORG","required":true},{"example":"10","kind":"select_option","label":"Distribution channel","name":"S_VTWEG","ref_field":"VBAK-VTWEG","required":false},{"example":"IST1","kind":"select_option","label":"Sales office","name":"S_VKBUR","ref_field":"VBAK-VKBUR","required":false},{"example":"01.11.2026 – 15.11.2026","kind":"select_option","label":"Order date range","name":"S_AUDAT","ref_field":"VBAK-AUDAT","required":true},{"example":"200100","kind":"select_option","label":"Sold-to party","name":"S_KUNNR","ref_field":"VBAK-KUNNR","required":false},{"example":"FG01","kind":"select_option","label":"Material group","name":"S_MATKL","ref_field":"VBAP-MATKL","required":false},{"example":"15","kind":"parameter","label":"Margin threshold (%)","name":"P_MINPCT","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Exclude rejected items","name":"P_NOREJ","ref_field":"","required":false}],"part_of":["o2c-pricing-billing-accuracy-pack"],"performance":"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.","process":"O2C","quote_url":"https://nekuhub.com/en/request-a-quote/?report=sd-sales-order-gross-margin","related":["sd-customer-price-conditions-validity","sd-order-delivery-invoice-status"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Lists orders with net value; shows no cost or margin.","tcode":"VA05"},{"note":"Profitability analysis reports; need billed data and a configured CO-PA, and do not show open order items.","tcode":"KE30"}],"summary":"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.","tables":[{"access":"read","join_on":"","role":"Order header, sales area, customer and pricing document number (driving table)","table":"VBAK","variant":"both"},{"access":"read","join_on":"VBAP-VBELN = VBAK-VBELN","role":"Item net value and cost","table":"VBAP","variant":"both"},{"access":"read","join_on":"KNA1-KUNNR = VBAK-KUNNR","role":"Customer name","table":"KNA1","variant":"both"},{"access":"read","join_on":"KONV-KNUMV = VBAK-KNUMV AND KONV-KPOSN = VBAP-POSNR","role":"Cost condition check in ECC","table":"KONV","variant":"ecc"},{"access":"read","join_on":"PRCD_ELEMENTS-KNUMV = VBAK-KNUMV AND PRCD_ELEMENTS-KPOSN = VBAP-POSNR","role":"Cost condition check in S/4HANA","table":"PRCD_ELEMENTS","variant":"s4"}],"title":"Sales Order Gross Margin Report by Item","url":"https://nekuhub.com/en/reports/sales-order-gross-margin-by-item-report/","vendor_id":"nekudos"}