Freight Cost Accrual and Carrier Invoice Difference Posting
Short answer: A custom program that allocates the freight cost calculated per shipment to deliveries and customers, posts a period-end accrual for freight not yet invoiced, matches carrier invoices with the accrual and posts differences within tolerance automatically with the shipment reference. The reconciliation status per carrier and the shipping cost per customer are shown on the same screen.
- Estimated effort
- L · 18–25 working days
- System
- ECC and S/4HANA
- Tables
- 14
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
The standard freight cost document (VI01/VI02) calculates freight from tariffs and, at settlement, creates a purchase order and service entry; the carrier invoice is entered in MIRO against that order. There is, however, no screen that lists the difference between accrual and invoice per shipment, posts it automatically within a tolerance and tracks the reconciliation status with the carrier. The allocation of freight per customer and delivery is not reported either; when the settlement runs in spreadsheets, overpayments and the real cost per shipment stay hidden.
Who uses it? Logistics and shipping teams, vendor invoice and general ledger teams, cost accounting and sales controlling.
Closest standard alternatives
- VI01 Create Shipment Costs. Creates the freight cost document and calculates it from tariffs; does not track the accrual-invoice difference per shipment.
- VI02 Change Shipment Costs. Changes the freight cost document and triggers settlement (purchase order, service entry).
- MIRO Enter Incoming Invoice. Enters the carrier invoice against the order; does not report the difference with the shipment reference or post it separately by tolerance.
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| VTTKShipment Header | Completed shipments and carrier | Read | ECC + S/4 |
| VTTPShipment Item | Deliveries in the shipment (for allocation) | Read | ECC + S/4 |
| LIKPDelivery Header | Delivery weight, volume and customer | Read | ECC + S/4 |
| VFKKShipment Costs: Header Data | Freight cost document header | Read | ECC + S/4 |
| VFKPShipment Costs: Item Data | Freight cost items: carrier, amount, settlement purchase order | Read | ECC + S/4 |
| PRCD_ELEMENTSPricing Elements (Document Conditions) | Freight and surcharge condition lines (S/4HANA) | Read | S/4HANA only |
| KONVConditions (Transaction Data) | Freight and surcharge condition lines (ECC) | Read | ECC only |
| EKKOPurchasing Document Header | Purchase order created by settlement | Read | ECC + S/4 |
| RBKPDocument Header: Incoming Invoice | Carrier invoice header | Read | ECC + S/4 |
| RSEGDocument Item: Incoming Invoice | Carrier invoice items and purchase order reference | Read | ECC + S/4 |
| LFA1Vendor Master (General Section) | Carrier name | Read | ECC + S/4 |
| BKPFAccounting Document Header | Document header of the accrual and difference posting (written) | Write | ECC + S/4 |
| ACDOCAUniversal Journal Entry Line Items | Line items of the accrual and difference posting (S/4HANA) | Write | S/4HANA only |
| BSEGAccounting Document Segment | Line items of the accrual and difference posting (ECC) | Write | ECC only |
S/4HANA notes
- KONV → PRCD_ELEMENTS: In S/4HANA document conditions are stored in PRCD_ELEMENTS; custom code reading KONV must be adapted.
BAPIs and functions used
- BAPI_ACC_DOCUMENT_POSTAccounting: Post Document. Posts the period-end freight accrual and the invoice difference
- SD_SALESDOCUMENT_CHANGEChange Sales and Distribution Document. Writes a statistical freight condition to unbilled order items
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Commits the postings
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_BUKRS | Company code | Range / multiple | VFKP-BUKRS | Yes | 1000 |
| S_TDLNR | Carrier | Range / multiple | VFKP-TDLNR | No | 700120 |
| S_TKNUM | Shipment | Range / multiple | VTTK-TKNUM | No | 00012045 |
| P_BUDAT | Posting date | Single value | BKPF-BUDAT | Yes | 30.11.2026 |
| P_MODE | Run: report / accrual / difference posting | Radio button | — | Yes | Rapor |
| P_TOL | Automatic posting tolerance (amount) | Single value | — | No | 250 |
| P_TEST | Test run | Checkbox | — | No | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Shipment | VTTK-TKNUM |
| 2 | Carrier | VFKP-TDLNR |
| 3 | Carrier name | LFA1-NAME1 |
| 4 | Freight cost document | VFKK-FKNUM |
| 5 | Customer | LIKP-KUNAG |
| 6 | Calculated freight | VFKP-NETWR |
| 7 | Invoice | RBKP-BELNR |
| 8 | Invoiced amount | RSEG-WRBTR |
| 9 | Difference | Calculated Invoiced amount − calculated freight |
| 10 | Currency | VFKP-WAERS |
| 11 | Status | Calculated Accrued, matched, closed with difference or disputed |
| 12 | Accounting document | BKPF-BELNR |
Sample result list
| Shipment | Carrier | Carrier name | Freight cost document | Customer | Calculated freight | Invoice | Invoiced amount | Difference | Currency | Status | Accounting document |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 00012045 | 700120 | Örnek Lojistik A.Ş. | 0000004512 | 200118 | 18,500 | 5105600211 | 18,500 | 0 | TRY | Matched | |
| 00012046 | 700135 | Demo Nakliyat Ltd. | 0000004513 | 200342 | 9,200 | 5105600215 | 9,380 | 180 | TRY | Closed with difference | 100045230 |
| 00012050 | 700142 | Anadolu Taşımacılık A.Ş. | 0000004520 | 200118 | 12,400 | 5105600220 | 14,100 | 1,700 | TRY | Disputed | |
| 00012058 | 700120 | Örnek Lojistik A.Ş. | 0000004531 | 300045 | 21,750 | TRY | Accrued | 100045288 |
How does the program work?
- Shipments completed in the selected period (VTTK) and their freight cost documents (VFKK/VFKP) are read. The freight amount, surcharges (waiting time, extra stops, tolls) and tax condition lines come from PRCD_ELEMENTS in S/4HANA and from KONV in ECC (VFKP-KNUMV).
- Allocation: the freight of each shipment is distributed to its deliveries (VTTP → LIKP) by gross weight, volume or equal share and reported per customer, sales order and product group. Optionally a statistical freight condition is written to sales order items not yet billed with SD_SALESDOCUMENT_CHANGE, so freight flows into the invoice and into profitability analysis.
- Period-end accrual: for shipments that have a freight cost document but no carrier invoice yet, an accrual is posted with BAPI_ACC_DOCUMENT_POST to the freight expense and accrual accounts with the shipment number as reference, and its reversal is scheduled for the first day of the next period. If standard settlement (purchase order + service entry) is used, the GR/IR account already acts as the accrual, so this step is switched off and only the report runs.
- Matching: carrier invoices (RBKP/RSEG) are linked to the shipment through the purchase order created by settlement (VFKP-EBELN, EKKO/EKPO) or through a reference field set during installation. The difference between invoice and accrual is calculated per shipment and carrier.
- Difference posting: differences within tolerance are posted with BAPI_ACC_DOCUMENT_POST to the freight expense account with the shipment reference (a test run only lists the proposal). Differences outside the tolerance go to a dispute list, and the reconciliation status with the carrier (open, matched, closed with difference, disputed) is tracked.
- Postings go to ACDOCA in S/4HANA and BKPF/BSEG in ECC; the document number is stored on the shipment line and the user drills down from the line to the document.
Performance notes
Restrict freight cost documents by company code, carrier and settlement date; read the condition lines for the document list in one go. In the allocation, total the delivery weights once per shipment. Package the postings per carrier, issue COMMIT WORK after each package and schedule the period-end run in the background.
Features
- ALV list (sort, filter, subtotals)
- Test mode (check without posting) Accrual and difference postings are first listed as a proposal.
- Runs as a background job The period-end accrual and next-day reversal are scheduled as jobs.
- Double-click drill-down to the document From a line the user drills down to the shipment, freight cost document, invoice and accounting document.
- Line-by-line result and error log
- Export to Excel
Authorization objects
- V_VFKK_FKAAuthorization by freight cost document type
- F_BKPF_BUKPosting authorization by company code
- M_RECH_WRKInvoice display authorization by plant
Frequently asked questions
We use standard freight settlement; is the accrual step needed?
If settlement creates a purchase order and service entry, the GR/IR account already acts as the accrual; the program then skips the accrual step and only performs allocation, invoice matching and difference tracking. If settlement is not used, the program posts the period-end accrual.
How is freight allocated to customers?
The freight of a shipment is allocated to its deliveries by gross weight, volume or equal share; the rule is chosen per shipment type during installation. The allocated amount is reported per customer, sales order and product group and can optionally be written to the order item as a statistical condition.
What happens to differences outside the tolerance?
They are not posted automatically; they go to the dispute list. After agreeing with the carrier, the logistics team can approve and post the difference or ask the carrier for a corrected invoice; each step is kept in the status history.
Related reports
Sales Order Gross Margin Report by Item
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 …
Vehicle Loading and Shipment Planning Program (Domestic and Export)
A custom planning program that groups deliveries ready for shipping by route and destination and proposes loads based on the weight, volume and pallet …
Vehicle Request Cockpit and Unsupplied Vehicle Report
A custom cockpit that derives vehicle demand from deliveries ready for shipping, sends vehicle requests to logistics companies with vehicle type, date …
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.