# Daily Transfer of Store POS and Retail Sales to SAP

> A custom interface that transfers the end-of-day sales of store tills into SAP. Sales are totalled per store, day and material and posted as goods issues from store stock, while turnover and payment types (cash, credit card, gift voucher) are posted to accounting; the till total and the amount posted in SAP are compared in a reconciliation list.

- Type: Program, Custom development, Interface
- Module: SD
- Estimated effort: L (12–18 working days)
- Industry: Retail
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/store-pos-retail-sales-transfer-to-sap/


## Why is the standard not enough?

In the retail industry solution, POS sales are received with standard IDocs; systems without that solution have no ready inbound for till sales. Each store's daily sales are deducted from stock with MIGO/MB1A and posted to accounting manually with FB50, while entering them one by one as cash sales orders is not workable at high volume. The custom interface does this automatically every day and shows the differences.

### Closest standard alternatives

- MIGO: Deducts store sales from stock manually; no file import and no combined accounting posting.
- FB50: Posts turnover to accounting manually; no reconciliation with stock and till totals.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| T001W | Plant representing the store, and its name | Read | - | ECC + S/4 |
| T001L | Store storage location | Read | T001L-WERKS = T001W-WERKS | ECC + S/4 |
| MEAN | Barcode to material mapping | Read | - | ECC + S/4 |
| MARD | Stock check in the store location | Read | MARD-MATNR = MEAN-MATNR AND MARD-WERKS = T001W-WERKS | ECC + S/4 |
| MSEG | Goods issue items for sales (ECC) | Write | - | ECC only |
| MATDOC | Goods issue items for sales (S/4HANA) | Write | - | S/4HANA only |
| BKPF | Turnover and collection accounting document; reference for the duplicate check | Read / write | - | ECC + S/4 |

## BAPIs and functions used

- BAPI_GOODSMVT_CREATE: Posts the goods issue for sales from store stock
- BAPI_ACC_DOCUMENT_POST: Posts turnover, VAT and payment types to accounting
- BAPI_SALESORDER_CREATEFROMDAT2: Optional: creates cash sales orders for SD statistics
- BAPI_TRANSACTION_COMMIT: Commits each store-day posting

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_PATH | Folder of the end-of-day files | Single value | - | Yes |
| P_BUDAT | Posting date (blank = sales day) | Single value | BKPF-BUDAT | No |
| P_BWART | Sales movement type | Single value | MSEG-BWART | Yes |
| P_SDORD | Also create cash sales orders | Checkbox | - | No |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Store (plant) | T001W-WERKS | Yes |
| Storage location | T001L-LGORT | No |
| Sales date | BKPF-BUDAT | Yes |
| Barcode | MEAN-EAN11 | Yes |
| Quantity | MSEG-MENGE | Yes |
| Net amount | BSEG-WRBTR | Yes |
| Tax code | BSEG-MWSKZ | Yes |
| Payment type | POS payment type code; mapped to a G/L account during installation | No |

## Result list columns

| Column | Source |
|---|---|
| Store | T001W-WERKS |
| Store name | T001W-NAME1 |
| Sales day | Calculated: Sales date in the file |
| Till turnover | Calculated: Σ net amount in the file |
| Turnover posted in SAP | Calculated: Σ revenue lines in the accounting document |
| Difference | Calculated: Till turnover − turnover posted in SAP |
| Goods issue document | MSEG-MBLNR |
| Accounting document | BKPF-BELNR |
| Failed rows | Calculated: Number of rows not matched or not posted |
| Status | Calculated: Posted, difference, duplicate or error |

## How does the program work?

1. Each store's end-of-day file (or the single file of the central POS server) is read from a folder on the application server. The store code is mapped to plant and storage location (T001W, T001L), the POS article code or barcode to the material (MEAN).
2. Checks: has the same store and day already been processed (document header reference store-date), is the barcode defined, does the material have stock in the store location (MARD). Unmatched rows go to an error file; the rest are processed.
3. Rows are totalled per store, day and material; returns are kept separate. Turnover is also totalled by tax code and collections by payment type.
4. Stock: a goods issue for sales (movement type 251, 252 for returns) is posted from the store location with BAPI_GOODSMVT_CREATE.
5. Accounting: BAPI_ACC_DOCUMENT_POST credits revenue accounts by tax code and debits cash, card receivables and gift voucher accounts by payment type; the profit center is the store. If SD statistics are needed, the same totals can also be created as cash sales orders and invoices (BAPI_SALESORDER_CREATEFROMDAT2).
6. The reconciliation list shows per store and day the till turnover, the turnover posted in SAP, the difference, and the goods issue and accounting document numbers.

## Authorization objects

- M_MSEG_BWA: Goods movement posting authorization by movement type
- M_MSEG_WMB: Goods movement authorization by plant (store)
- F_BKPF_BUK: Accounting posting authorization by company code

## Frequently asked questions

### Are sales posted per receipt or in totals?

By default they are posted in totals per store, day and material; this is sufficient for stock and accounting and keeps the number of documents low. If receipt detail is needed, the file is archived and the reconciliation list can drill down to receipt lines.

### What happens if a product with a barcode unknown in SAP is sold?

The row goes to the error file and the rest of the store-day is processed; the difference appears in the reconciliation list. Once the barcode is defined, only the failed rows are reprocessed.

### Do we need this interface if we use the retail industry solution?

In that case the standard POS inbound IDocs are preferred. This interface is for core SAP systems running without the retail industry solution, which is common for manufacturers and wholesalers with their own stores.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=sd-retail-pos-integration
