# Automatic Posting of Utility, Telecom and Fuel e-Invoices with Account and Cost Center Determination

> A program that distributes the monthly electricity, gas, water, telecom and fuel e-invoices to the right G/L account and cost center by rules based on the supplier tax number, subscriber or installation number and vehicle plate, and posts them as vendor invoices. The non-deductible expense split for passenger cars, rounding and discount lines are also handled automatically by rule.

- Type: Program, Custom development, Interface
- Module: FI
- Estimated effort: L (10–15 working days)
- Last updated: 2026-11-18
- URL: https://nekuhub.com/en/programs/automatic-posting-of-utility-telecom-and-fuel-einvoices/


## Why is the standard not enough?

FB60 and FB10 enter the invoice by hand; e-invoice integration solutions bring the invoice into SAP but do not know which account and cost center the lines belong to. For hundreds of subscriptions and vehicles the same distribution is done by hand every month, the non-deductible share for passenger cars is calculated as a separate line and small rounding differences are a nuisance. FBD1 recurring entries do not suit invoices whose amounts change.

### Closest standard alternatives

- FB60: Enters the vendor invoice by hand; no distribution rules by subscriber or plate.
- FB10: Offers fast invoice entry; the user still chooses the account and cost center.
- FBD1: Sets up recurring entries with fixed amounts; does not suit invoices whose amounts change.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| LFA1 | Vendor account from the supplier tax number | Read | - | ECC + S/4 |
| LFB1 | Vendor company code data and reconciliation account | Read | LFB1-LIFNR = LFA1-LIFNR | ECC + S/4 |
| DFKKBPTAXNUM | Business partner tax numbers (S/4HANA) | Read | - | S/4HANA only |
| SKB1 | Expense account open for posting | Read | SKB1-SAKNR = kuraldaki ana hesap | ECC + S/4 |
| CSKS | Cost center validity | Read | CSKS-KOSTL = kuraldaki masraf yeri | ECC + S/4 |
| T007A | Tax code check | Read | - | ECC + S/4 |
| BKPF | Vendor invoice document; duplicate reference check | Read / write | BKPF-XBLNR = e-fatura numarası | ECC + S/4 |
| BSEG | Distributed expense, non-deductible expense and tax lines | Write | BSEG-BUKRS = BKPF-BUKRS AND BSEG-BELNR = BKPF-BELNR | ECC + S/4 |
| ACDOCA | Journal entry lines (S/4HANA) | Write | ACDOCA-RBUKRS = BKPF-BUKRS AND ACDOCA-BELNR = BKPF-BELNR | S/4HANA only |

## BAPIs and functions used

- FI_DUPLICATE_INVOICE_CHECK: Blocks duplicate invoices
- BAPI_ACC_DOCUMENT_CHECK: Checks the document without posting
- BAPI_ACC_DOCUMENT_POST: Posts the vendor invoice
- BAPI_TRANSACTION_COMMIT: Saves successful documents
- CALCULATE_TAX_FROM_GROSSAMOUNT: Checks the tax amount from gross lines

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_BUKRS | Company code | Range / multiple | BKPF-BUKRS | Yes |
| S_LIFNR | Supplier | Range / multiple | LFA1-LIFNR | No |
| S_BLDAT | Invoice date | Range / multiple | BKPF-BLDAT | No |
| P_BUDAT | Posting date | Single value | BKPF-BUDAT | Yes |
| P_PARK | Park and send for approval instead of posting | Checkbox | - | No |
| P_TEST | Test mode | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Supplier | LFA1-LIFNR |
| Supplier name | LFA1-NAME1 |
| Invoice number | BKPF-XBLNR |
| Subscriber / plate | Calculated: Subscriber, installation number or plate on the invoice |
| G/L account | BSEG-HKONT |
| Cost center | BSEG-KOSTL |
| Amount | BSEG-WRBTR |
| Non-deductible | Calculated: Amount split with the rule rate on passenger car lines |
| Change vs previous month | Calculated: (This month − last month) / last month |
| Document | BKPF-BELNR |
| Status | Calculated: Posted, parked, rule pending, duplicate or error |

## How does the program work?

1. Invoices from the e-invoice integration are read: supplier tax number, invoice number and date, lines, taxes and the subscriber/installation number or plate on the invoice. The vendor account is found by the supplier tax number (LFA1-STCD1/STCD2 in ECC, business partner tax numbers DFKKBPTAXNUM in S/4HANA).
2. The rule table is checked: supplier + subscriber/installation number → G/L account and cost center; supplier + plate → vehicle cost center and vehicle type (passenger/commercial). An invoice without a rule goes to the 'rule pending' list, and a rule defined once is used in later months.
3. For passenger cars the non-deductible share is split to a separate expense account with the rate in the rule table; the rate and scope are entered during installation according to current regulation, the program has no fixed value. Rounding and discount lines are written to defined accounts.
4. Checks that the G/L account is open for posting (SKB1), the cost center is valid (CSKS) and the tax code (T007A) fits; duplicate invoices are blocked with FI_DUPLICATE_INVOICE_CHECK.
5. The document is checked with BAPI_ACC_DOCUMENT_CHECK and posted as a vendor invoice with BAPI_ACC_DOCUMENT_POST (BKPF, BSEG; ACDOCA in S/4HANA). Optionally it is parked first and sent to the invoice approval workflow.
6. The result list shows supplier, subscriber/plate, distributed accounts, non-deductible amount and document number; a monthly comparison flags subscriptions whose amount rose clearly compared with the previous month.

## Authorization objects

- F_BKPF_BUK: Posting authorization for the company code
- F_BKPF_KOA: Authorization to post vendor and G/L items
- K_CSKS: Authorization to read cost center master data

## Frequently asked questions

### How is fuel distributed if the plate is not on the invoice?

If a vehicle ID system or card number is on the invoice, the rule is set up with the card number. If there is no distinguishing data, the invoice is posted to a default cost center and a distribution list can be uploaded separately.

### What if the non-deductible rate changes?

The rate is kept in the rule table with a valid-from date; the new rate is entered from the relevant date and past invoices are not affected. The program contains no legal rate; the finance team maintains it according to current regulation.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=fi-utility-einvoice-auto-posting
