WM Count Result Upload from Scanner File with Tolerance Check Program
Short answer: A custom upload program that enters WM count results made with handheld scanners or Excel into inventory documents in bulk, calculates the difference value and separates rows outside tolerance for recount. Differences within tolerance become ready for clearing in LI20.
- Estimated effort
- M · 6–9 working days
- System
- ECC and S/4HANA
- Tables
- 5
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
LI11N enters count results by hand, document by document and item by item; it does not upload from a file and does not compare the value of the entered difference with a tolerance. LI20 clears differences but does not separate which ones should be recounted first. In large counts, keying hundreds of bins by hand causes errors and delays.
Who uses it? Counting teams, inventory controllers, warehouse supervisors and finance teams running the year-end count.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| LINKWM Inventory Document Header | Inventory document header and status | Read | ECC + S/4 |
| LINPWM Inventory Document Item | Bins in the document (items) | Read | ECC + S/4 |
| LINVInventory Data per Quant | System stock and counted quantity per quant (written via L_INV_COUNT_EXT) | Write | ECC + S/4 |
| MBEWMaterial Valuation | Unit price for the difference value | Read | ECC + S/4 |
| MAKTMaterial Descriptions | Material description in the logon language | Read | ECC + S/4 |
S/4HANA notes
- MBEW: In S/4HANA the Material Ledger is mandatory and valuation data is read through a compatibility view. Prices remain readable; validate value calculations against the currency and valuation view in use.
BAPIs and functions used
- L_INV_COUNT_EXTEnter Warehouse Inventory Count from External System. Enters count results made outside SAP into the inventory document
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Count file (XLSX or CSV) | Single value | — | Yes | C:\temp\sayim_100_1711.xlsx |
| P_TOLVAL | Allowed difference value per row | Single value | — | No | 250 |
| P_TOLPCT | Allowed difference percentage | Single value | — | No | 2 |
| P_ALL | Also enter rows outside tolerance | Checkbox | — | No | — |
| P_TEST | Test mode (check without entering counts) | Checkbox | — | No | X |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Warehouse number | LINV-LGNUM | Yes |
| 2 | Inventory document | LINV-IVNUM | Yes |
| 3 | Storage bin | LINV-LGPLA | Yes |
| 4 | Material | LINV-MATNR | Yes |
| 5 | Batch | LINV-CHARG | No |
| 6 | Counted quantity | LINV-MENGA | Yes |
| 7 | Unit | LINV-MEINS | No |
Sample upload file
| 1 | Warehouse number * | Inventory document * | Storage bin * | Material * | Batch | Counted quantity * | Unit |
|---|---|---|---|---|---|---|---|
| 2 | 100 | 0000004512 | 01-04-03 | FG-5001 | B26-0412 | 46 | CS |
| 3 | 100 | 0000004512 | 01-04-05 | FG-5120 | 80 | CS | |
| 4 | 100 | 0000004513 | 03-12-01 | RM-2040 | S26-0091 | 310 | KG |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Inventory document | LINV-IVNUM |
| 3 | Storage bin | LINV-LGPLA |
| 4 | Material | LINV-MATNR |
| 5 | Description | MAKT-MAKTX |
| 6 | System stock | LINV-GESME |
| 7 | Counted | LINV-MENGA |
| 8 | Difference qty | Calculated Counted − system stock |
| 9 | Difference value | Calculated Difference qty × MBEW price (STPRS or VERPR by VPRSV) ÷ PEINH |
| 10 | Status | Calculated Entered, recount or error |
| 11 | Message | Calculated Tolerance result or message from L_INV_COUNT_EXT |
Sample result list
| Row | Inventory document | Storage bin | Material | Description | System stock | Counted | Difference qty | Difference value | Status | Message |
|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 0000004512 | 01-04-03 | FG-5001 | Packed product A | 48 | 46 | -2 | -620 | Recount | Difference value exceeds the tolerance of 250 |
| 3 | 0000004512 | 01-04-05 | FG-5120 | Canned tomato 400 g | 80 | 80 | 0 | 0 | Entered | Count entered, no difference |
| 4 | 0000004513 | 03-12-01 | RM-2040 | Steel sheet 2 mm | 312 | 310 | -2 | -122.40 | Entered | Within tolerance, can be cleared in LI20 |
How does the program work?
- The file (XLSX or CSV) is read; each row is expected to hold warehouse number, inventory document, bin, material, batch and counted quantity.
- LINK-ISTAT is checked to confirm the inventory document is open and LINP to confirm the bin belongs to the document; system stock is read from LINV-GESME.
- Difference quantity = counted − system stock; the difference value uses the MBEW price (STPRS when price control is S, VERPR when V, divided by the price unit).
- When the difference value and percentage are within the tolerances on the selection screen, the row is entered as a count result with L_INV_COUNT_EXT.
- Rows outside tolerance are not entered unless “Also enter rows outside tolerance” is selected; they go to a recount list that can be downloaded as a file to send back to the scanners.
- In test mode no count is entered; the difference and tolerance result of all rows is listed.
Performance notes
Read LINK, LINP and LINV once for the document numbers in the file; cache MBEW prices per material + valuation area. Call L_INV_COUNT_EXT once per inventory document with all rows of that document.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file The recount list is downloaded as a file to load back onto the scanners.
- Export to Excel An empty count template can be downloaded as Excel.
- Runs as a background job
Authorization objects
- L_LGNUMInventory authorization by warehouse number and storage type
- L_TCODEWM transaction authorization (count entry)
Frequently asked questions
Does the program also post the differences to stock?
No. The program enters the count result and evaluates the difference. Clearing the WM difference (LI20) and posting it to IM (LI21) deliberately remain separate steps, so finance approval is preserved.
What if the scanner file layout changes?
The file layout is kept in a mapping table; adding a mapping for scanners with a different column order or headers needs no code change.
How is a row matched when a bin holds several quants?
The row is matched to the quant (LINV-LQNUM) by material and batch. If the same material and batch has several quants, the counted quantity is split in proportion to system stock and this is shown in the log.
Packages that include this solution
Physical Inventory Count and Difference Pack
A four-component pack that runs a count campaign from start to finish: storage bins due for counting, bulk entry of count results from handheld …
Related reports
Cycle Count Due Bins and Count Progress Report
A custom ALV report that shows the storage bins whose count is due or overdue based on the last count date and the material's cycle counting …
WM vs IM Stock Comparison Report
A custom ALV report that compares inventory management stock per storage location (MARD) with the total of warehouse management quants (LQUA) by …
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.