SD Program Custom development Enhancement

Automatic Consumption of Dealer Advance Cheques by Sales Orders, Usage List and Link to Rebate Agreements

Short answer: An enhancement that defines advance or commitment cheques received from dealers as master data and, when a sales order is saved, automatically deducts the order value from the balance of a suitable cheque. It provides a usage list per cheque and a summary email to the dealer; the cheque is linked to the dealer's rebate agreement so it can be used in the period-end rebate calculation.

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

Why is the standard not enough?

Received cheques are posted in FI as special G/L transactions, and credit management can take them into account in the exposure. But standard SAP cannot tie a specific cheque to specific orders, reduce the cheque's remaining balance per order or show which order was covered by which cheque. A rebate or discount agreement granted with a commitment cheque is not linked to the cheque automatically either.

Who uses it? Dealer channel sales teams, credit and collection teams, finance and dealer rebate owners.

Closest standard alternatives

  • FBL5N Customer Line Items. Shows received cheques as special G/L items; there is no link to orders and no remaining balance.
  • VBO1 Create Rebate Agreement. Creates rebate agreements in ECC; does not track a cheque balance. In S/4HANA new agreements are managed as condition contracts.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
BSIDCustomer Open ItemsSpecial G/L open item and due date of the received chequeReadECC + S/4
BSEDBill of Exchange Fields Document SegmentCheque details: cheque number, bank, place of issueReadECC + S/4
VBAKSales Document HeaderOrder net value; cheque reference (ZUONR), delivery block and agreement number are setRead / writeECC + S/4
VBAPSales Document ItemBalance write-back for rejected or changed itemsReadECC + S/4
KONAAgreementsRebate agreement linked to the cheque (ECC)ReadECC + S/4
KNA1Customer Master (General Section)Dealer name and email address numberReadECC + S/4

S/4HANA notes

  • BSID → I_OperationalAcctgDocItem: In S/4HANA BSID is no longer filled as a separate index table; reads work through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.

BAPIs and functions used

  • BAPI_AR_ACC_GETOPENITEMSCustomer Account Open Items at Key Date. Fetches the dealer's open cheque items when defining a cheque
  • SO_NEW_DOCUMENT_ATT_SEND_API1SAPoffice: Send New Document with Attachments. Sends the cheque usage summary to the dealer

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
S_KUNNRDealerRange / multipleVBAK-KUNNRNo200510
S_BOENOCheque numberRange / multipleBSED-BOENONo4471203
S_ERDATOrder dateRange / multipleVBAK-ERDATNo01.10.2026 – 18.11.2026
P_OPENOnly cheques with a remaining balanceCheckbox—NoX
P_MAILSend summary email to dealersCheckbox—No—

Result list columns

#ColumnSource
1Cheque numberBSED-BOENO
2DealerVBAK-KUNNR
3Dealer nameKNA1-NAME1
4Due dateBSID-ZFBDT
5Cheque amountBSID-WRBTR
6OrderVBAK-VBELN
7UsedCalculated Amount of the order deducted from the cheque
8Remaining balanceCalculated Cheque amount − total used by all orders
9Rebate agreementVBAK-KNUMA
10StatusCalculated Open, fully used, expired or insufficient balance

Sample result list

Cheque numberDealerDealer nameDue dateCheque amountOrderUsedRemaining balanceRebate agreementStatus
4471203200510Anadolu Mağazacılık Ltd.31.01.2027500,00010045310182,400317,60050000124Open
4471203200510Anadolu Mağazacılık Ltd.31.01.2027500,0001004538896,750220,85050000124Open
8820417200511Örnek Ev Dekorasyon A.Ş.15.12.2026250,00010045402250,0000Fully used
8820455200511Örnek Ev Dekorasyon A.Ş.28.02.2027150,000100454150150,000Insufficient balance
A view built with fictional sample data; not real system data.

How does the program work?

  1. The cheque master data screen creates an advance cheque record from the received cheque document posted in FI (BSID special G/L item, cheque details in BSED: cheque number, bank, place of issue, due date); the cheque type (advance, commitment), valid sales area, usage start and end date and an optional rebate agreement number are entered. The record is kept in a custom cheque table.
  2. When a sales order is saved, USEREXIT_SAVE_DOCUMENT_PREPARE in MV45AFZZ runs (in S/4HANA the same check can also be built with BADI_SD_SALES_BASIC). If the dealer, sales area and order type are enabled for cheque usage in setup, the valid cheques are sorted by due date.
  3. The order’s net value (VBAK-NETWR; whether tax is included is chosen in setup) is deducted from the remaining balance of the first suitable cheque; if it is not enough, the next cheque is used. The usage line is written to the usage table with order number, amount and user, and the cheque reference is passed to the order’s assignment field (VBAK-ZUONR).
  4. If the balance is not enough, the behaviour from setup is applied: warning, delivery block (VBAK-LIFSK) or blocking the save. If an order item is rejected, its value goes down or the order is deleted, the used amount is written back to the cheque.
  5. The usage list shows per cheque the initial amount, used, remaining, orders and due date. A weekly job emails each dealer a cheque usage summary with SO_NEW_DOCUMENT_ATT_SEND_API1.
  6. If the cheque is linked to a rebate agreement (KONA via VBO1 in ECC, a condition contract in S/4HANA), the agreement number is set on the order (VBAK-KNUMA); the period-end rebate calculation selects the orders covered by the cheque with this number.

Performance notes

At order save, read only that dealer's valid cheques by key fields; do not scan FI open items on every save and keep the cheque balance in the usage table. Lock the cheque record (ENQUEUE) so the same balance is not used twice by concurrent orders.

Features

  • ALV list (sort, filter, subtotals)
  • Double-click drill-down to the document The cheque opens the FI document and the order opens the sales order.
  • Send the result by email Dealers receive a weekly cheque usage summary.
  • Runs as a background job
  • Export to Excel

Authorization objects

  • V_VBAK_VKOSales order authorization by sales organization
  • F_BKPF_BUKAuthorization to display cheque documents
  • S_OC_SENDSending external email to dealers

Frequently asked questions

Does this replace the credit check?

No. Credit management keeps monitoring the dealer's total exposure; this enhancement tracks which orders consume a specific cheque. Both work together: an order of a dealer with an advance cheque can be released against the cheque balance even if the credit limit is used up, if setup allows it.

What happens if the cheque bounces?

When the cheque is processed as dishonoured in FI, the cheque record is blocked; new orders are no longer deducted from it and the amounts already used are flagged as a risk in the list. Open orders can get a delivery block according to the setup.

What changes when moving to S/4HANA?

The cheque, order and usage logic stays the same. On the rebate side, condition contracts are used instead of SD rebate agreements, and the link to the cheque is made with the contract number. A BAdI can be preferred over the user exit.

Related reports

Let us build this program 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: Automatic Consumption of Dealer Advance Cheques by Sales Orders, Usage List and Link to Rebate Agreements