WM Program Custom development Mass upload

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

  • LI11N Enter Inventory Count. Enters count results by hand, document by document; no file upload and no tolerance check.
  • LI20 Clear Inventory Differences in WM. Clears differences in WM; does not separate which differences should be recounted.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
LINKWM Inventory Document HeaderInventory document header and statusReadECC + S/4
LINPWM Inventory Document ItemBins in the document (items)ReadECC + S/4
LINVInventory Data per QuantSystem stock and counted quantity per quant (written via L_INV_COUNT_EXT)WriteECC + S/4
MBEWMaterial ValuationUnit price for the difference valueReadECC + S/4
MAKTMaterial DescriptionsMaterial description in the logon languageReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILECount file (XLSX or CSV)Single value—YesC:\temp\sayim_100_1711.xlsx
P_TOLVALAllowed difference value per rowSingle value—No250
P_TOLPCTAllowed difference percentageSingle value—No2
P_ALLAlso enter rows outside toleranceCheckbox—No—
P_TESTTest mode (check without entering counts)Checkbox—NoX

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Warehouse numberLINV-LGNUMYes
2Inventory documentLINV-IVNUMYes
3Storage binLINV-LGPLAYes
4MaterialLINV-MATNRYes
5BatchLINV-CHARGNo
6Counted quantityLINV-MENGAYes
7UnitLINV-MEINSNo

Sample upload file

1Warehouse number *Inventory document *Storage bin *Material *BatchCounted quantity *Unit
2100000000451201-04-03FG-5001B26-041246CS
3100000000451201-04-05FG-512080CS
4100000000451303-12-01RM-2040S26-0091310KG
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2Inventory documentLINV-IVNUM
3Storage binLINV-LGPLA
4MaterialLINV-MATNR
5DescriptionMAKT-MAKTX
6System stockLINV-GESME
7CountedLINV-MENGA
8Difference qtyCalculated Counted − system stock
9Difference valueCalculated Difference qty × MBEW price (STPRS or VERPR by VPRSV) ÷ PEINH
10StatusCalculated Entered, recount or error
11MessageCalculated Tolerance result or message from L_INV_COUNT_EXT

Sample result list

RowInventory documentStorage binMaterialDescriptionSystem stockCountedDifference qtyDifference valueStatusMessage
2000000451201-04-03FG-5001Packed product A4846-2-620RecountDifference value exceeds the tolerance of 250
3000000451201-04-05FG-5120Canned tomato 400 g808000EnteredCount entered, no difference
4000000451303-12-01RM-2040Steel sheet 2 mm312310-2-122.40EnteredWithin tolerance, can be cleared in LI20
A view built with fictional sample data; not real system data.

How does the program work?

  1. The file (XLSX or CSV) is read; each row is expected to hold warehouse number, inventory document, bin, material, batch and counted quantity.
  2. 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.
  3. 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).
  4. 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.
  5. 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.
  6. 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

WM Package Custom

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 …

4 components · v1.0

Related reports

WM Report Custom ALV report

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 …

LAGP · LQUA · MARC · LINK

WM Report Custom ALV report

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 …

T320 · MARD · LQUA · LTAP

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.

Related report: WM Count Result Upload from Scanner File with Tolerance Check Program