{"audience":"Logistics and shipping teams, vendor invoice and general ledger teams, cost accounting and sales controlling.","authorization_objects":[{"note":"Authorization by freight cost document type","object":"V_VFKK_FKA"},{"note":"Posting authorization by company code","object":"F_BKPF_BUK"},{"note":"Invoice display authorization by plant","object":"M_RECH_WRK"}],"components":[],"countries":[],"effort_days_max":25,"effort_days_min":18,"effort_size":"L","faq":[{"a":"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.","q":"We use standard freight settlement; is the accrual step needed?"},{"a":"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.","q":"How is freight allocated to customers?"},{"a":"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.","q":"What happens to differences outside the tolerance?"}],"features":[{"code":"alv","label":"ALV list (sort, filter, subtotals)","note":""},{"code":"test_run","label":"Test mode (check without posting)","note":"Accrual and difference postings are first listed as a proposal."},{"code":"background","label":"Runs as a background job","note":"The period-end accrual and next-day reversal are scheduled as jobs."},{"code":"drilldown","label":"Double-click drill-down to the document","note":"From a line the user drills down to the shipment, freight cost document, invoice and accounting document."},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"excel","label":"Export to Excel","note":""}],"functions":[{"name":"BAPI_ACC_DOCUMENT_POST","role":"Posts the period-end freight accrual and the invoice difference"},{"name":"SD_SALESDOCUMENT_CHANGE","role":"Writes a statistical freight condition to unbilled order items"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Commits the postings"}],"gap":"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.","id":"sd-freight-cost-accrual-settlement","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-18","logic":"1. 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).\n2. 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.\n3. 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.\n4. 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.\n5. 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.\n6. 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.","module":"SD","object_type":"batch_job","output_columns":[{"calculated":false,"formula":"","label":"Shipment","source_field":"TKNUM","source_table":"VTTK"},{"calculated":false,"formula":"","label":"Carrier","source_field":"TDLNR","source_table":"VFKP"},{"calculated":false,"formula":"","label":"Carrier name","source_field":"NAME1","source_table":"LFA1"},{"calculated":false,"formula":"","label":"Freight cost document","source_field":"FKNUM","source_table":"VFKK"},{"calculated":false,"formula":"","label":"Customer","source_field":"KUNAG","source_table":"LIKP"},{"calculated":false,"formula":"","label":"Calculated freight","source_field":"NETWR","source_table":"VFKP"},{"calculated":false,"formula":"","label":"Invoice","source_field":"BELNR","source_table":"RBKP"},{"calculated":false,"formula":"","label":"Invoiced amount","source_field":"WRBTR","source_table":"RSEG"},{"calculated":true,"formula":"Invoiced amount − calculated freight","label":"Difference","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Currency","source_field":"WAERS","source_table":"VFKP"},{"calculated":true,"formula":"Accrued, matched, closed with difference or disputed","label":"Status","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Accounting document","source_field":"BELNR","source_table":"BKPF"}],"parameters":[{"example":"1000","kind":"select_option","label":"Company code","name":"S_BUKRS","ref_field":"VFKP-BUKRS","required":true},{"example":"700120","kind":"select_option","label":"Carrier","name":"S_TDLNR","ref_field":"VFKP-TDLNR","required":false},{"example":"00012045","kind":"select_option","label":"Shipment","name":"S_TKNUM","ref_field":"VTTK-TKNUM","required":false},{"example":"30.11.2026","kind":"parameter","label":"Posting date","name":"P_BUDAT","ref_field":"BKPF-BUDAT","required":true},{"example":"Rapor","kind":"radio","label":"Run: report / accrual / difference posting","name":"P_MODE","ref_field":"","required":true},{"example":"250","kind":"parameter","label":"Automatic posting tolerance (amount)","name":"P_TOL","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test run","name":"P_TEST","ref_field":"","required":false}],"part_of":[],"performance":"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.","process":"O2C","quote_url":"https://nekuhub.com/en/request-a-quote/?report=sd-freight-cost-accrual-settlement","related":["sd-sales-order-gross-margin","sd-vehicle-load-planning","sd-vehicle-request-carrier-cockpit"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Creates the freight cost document and calculates it from tariffs; does not track the accrual-invoice difference per shipment.","tcode":"VI01"},{"note":"Changes the freight cost document and triggers settlement (purchase order, service entry).","tcode":"VI02"},{"note":"Enters the carrier invoice against the order; does not report the difference with the shipment reference or post it separately by tolerance.","tcode":"MIRO"}],"summary":"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.","tables":[{"access":"read","join_on":"","role":"Completed shipments and carrier","table":"VTTK","variant":"both"},{"access":"read","join_on":"VTTP-TKNUM = VTTK-TKNUM","role":"Deliveries in the shipment (for allocation)","table":"VTTP","variant":"both"},{"access":"read","join_on":"LIKP-VBELN = VTTP-VBELN","role":"Delivery weight, volume and customer","table":"LIKP","variant":"both"},{"access":"read","join_on":"","role":"Freight cost document header","table":"VFKK","variant":"both"},{"access":"read","join_on":"VFKP-FKNUM = VFKK-FKNUM","role":"Freight cost items: carrier, amount, settlement purchase order","table":"VFKP","variant":"both"},{"access":"read","join_on":"PRCD_ELEMENTS-KNUMV = VFKP-KNUMV","role":"Freight and surcharge condition lines (S/4HANA)","table":"PRCD_ELEMENTS","variant":"s4"},{"access":"read","join_on":"KONV-KNUMV = VFKP-KNUMV","role":"Freight and surcharge condition lines (ECC)","table":"KONV","variant":"ecc"},{"access":"read","join_on":"EKKO-EBELN = VFKP-EBELN","role":"Purchase order created by settlement","table":"EKKO","variant":"both"},{"access":"read","join_on":"","role":"Carrier invoice header","table":"RBKP","variant":"both"},{"access":"read","join_on":"RSEG-EBELN = VFKP-EBELN","role":"Carrier invoice items and purchase order reference","table":"RSEG","variant":"both"},{"access":"read","join_on":"LFA1-LIFNR = VFKP-TDLNR","role":"Carrier name","table":"LFA1","variant":"both"},{"access":"write","join_on":"","role":"Document header of the accrual and difference posting (written)","table":"BKPF","variant":"both"},{"access":"write","join_on":"ACDOCA-BELNR = BKPF-BELNR","role":"Line items of the accrual and difference posting (S/4HANA)","table":"ACDOCA","variant":"s4"},{"access":"write","join_on":"BSEG-BELNR = BKPF-BELNR","role":"Line items of the accrual and difference posting (ECC)","table":"BSEG","variant":"ecc"}],"title":"Freight Cost Accrual and Carrier Invoice Difference Posting","url":"https://nekuhub.com/en/programs/freight-cost-accrual-and-carrier-invoice-difference/","vendor_id":"nekudos"}