# Dealer Campaign, Promotion and Payment Plan Calculation Enhancement

> A custom enhancement that automatically applies the discount, free goods and campaign-linked payment terms of dealer-group campaigns to the sales order. Basket conditions (minimum quantity or value, product group mix) and the campaign budget are checked, and a usage report shows how much each dealer has benefited from a campaign.

- Type: Program, Custom development, Enhancement
- Module: SD
- Estimated effort: L (12–18 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/dealer-campaign-promotion-and-payment-plan-calculation/


## Why is the standard not enough?

In the standard, discounts are kept as condition records (VK11), free goods with VBN1 and sales deals with VB21; each works on its own. Tiered campaigns based on the basket total, campaign-specific payment terms and instalment plans, a campaign budget per dealer and a warning when the budget is exceeded do not exist together in the standard. Order entry therefore applies campaigns manually, and errors are noticed only after invoicing.

### Closest standard alternatives

- VB21: Maintains sales deals and linked condition records; no basket condition, campaign payment terms or budget check.
- VBN1: Maintains free goods rules; does not work together with discount and payment terms as one campaign.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| KONH | Header of campaign condition records and linked sales deal | Read | - | ECC + S/4 |
| KONP | Campaign discount rates and amounts | Read | KONP-KNUMH = KONH-KNUMH | ECC + S/4 |
| KNVV | Dealer's customer group and sales area | Read | KNVV-KUNNR = VBAK-KUNNR | ECC + S/4 |
| VBAK | Sales order header: dealer, date, order type | Read | - | ECC + S/4 |
| VBAP | Order items: material, quantity, free-of-charge item | Write | VBAP-VBELN = VBAK-VBELN | ECC + S/4 |
| VBKD | Campaign payment terms and fixed value date | Write | VBKD-VBELN = VBAK-VBELN | ECC + S/4 |
| KONV | Campaign condition lines added to the order; budget consumption (ECC) | Read / write | KONV-KNUMV = VBAK-KNUMV | ECC only |
| PRCD_ELEMENTS | Campaign condition lines added to the order; budget consumption (S/4HANA) | Read / write | PRCD_ELEMENTS-KNUMV = VBAK-KNUMV | S/4HANA only |
| T052 | Campaign payment terms and instalment definition | Read | T052-ZTERM = VBKD-ZTERM | ECC + S/4 |
| KNA1 | Dealer name | Read | KNA1-KUNNR = VBAK-KUNNR | ECC + S/4 |

## BAPIs and functions used

- BAPI_SALESORDER_SIMULATE: Calculates the campaign price in the portal and quotation screen without creating an order
- PRICING: Runs standard pricing after the campaign condition is added

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_KNUMA | Campaign (sales deal) | Range / multiple | KONH-KNUMA_AG | No |
| S_VKORG | Sales organization | Range / multiple | VBAK-VKORG | Yes |
| S_KDGRP | Dealer group (customer group) | Range / multiple | KNVV-KDGRP | No |
| S_KUNNR | Dealer | Range / multiple | VBAK-KUNNR | No |
| S_AUDAT | Order date | Range / multiple | VBAK-AUDAT | Yes |
| P_BLOCK | Save the order with a delivery block when the budget is exceeded | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Campaign | KONH-KNUMA_AG |
| Dealer | VBAK-KUNNR |
| Dealer name | KNA1-NAME1 |
| Orders | Calculated: Number of orders carrying the campaign condition |
| Campaign order value | Calculated: Σ VBAP-NETWR (campaign items) |
| Discount granted | Calculated: Σ campaign condition line KWERT |
| Free quantity | Calculated: Σ quantity of free-of-charge items |
| Payment terms | VBKD-ZTERM |
| Remaining budget | Calculated: Campaign budget − Σ discount granted |
| Currency | VBAK-WAERK |

## How does the program work?

1. The campaign is created as a standard sales deal (VB21); the campaign condition records are linked to the deal (KONH-KNUMA_AG). Extra rules such as dealer group, validity, basket conditions, free goods rule, payment terms and budget are kept per campaign number in a rule table created during installation.
2. During order entry (VA01 or the portal) the sales order user exits (MV45AFZZ) and a pricing requirement routine run: valid campaigns are found with the dealer's customer group (KNVV-KDGRP) and the order date, and if the basket condition is met the campaign condition is applied to the items.
3. If the free goods rule is met, a free-of-charge item is added; for tiered campaigns the correct tier is chosen from the basket total.
4. The campaign's payment terms (ZTERM) and fixed value date are written to the order's business data (VBKD); if instalment payment terms are used, the payment plan is split into instalments on the invoice.
5. Budget check: the discount granted by the campaign so far is totalled from the campaign condition lines of open and billed orders (KONV, PRCD_ELEMENTS in S/4HANA). If the budget is exceeded, the rule either issues a warning or saves the order with a delivery block.
6. The campaign usage report shows per dealer the campaign order value, the discount granted, the free quantity and the remaining budget. The portal or quotation screen calculates the campaign price before creating an order with BAPI_SALESORDER_SIMULATE.

## Authorization objects

- V_KONH_VKO: Campaign condition maintenance authorization by sales organization
- V_VBAK_AAT: Order creation authorization by order type
- V_VBAK_VKO: Authorization to display the usage report by sales organization

## Frequently asked questions

### How does this differ from the standard sales deal and promotion?

The campaign's discount records still sit in the standard sales deal. The enhancement adds the basket condition, tier selection, free goods, campaign payment terms and budget check on top, so existing pricing and reporting are not disturbed.

### How is the campaign budget tracked?

The budget is defined per campaign and compared with the total campaign discount in open and billed orders. Rejected items and returns are deducted from the total; the remaining budget appears in the usage report.

### Does it also work for orders coming from the portal?

Yes. Because the rules run while the order is saved, they apply in the same way to orders created in VA01, by mass upload or from the portal through a BAPI.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=sd-dealer-campaign-promotion
