Functional documentation for the Aiden WMS stock transfer mapper (inbound).
This document describes what happens after the mapper is installed: how a completed WMS stock transfer (get + put lines) becomes a SAP Business One (B1) Stock Transfer, which moves are ignored, and which field rules apply. It is intended for end-users and functional consultants.
1. Overview
|
|
|
|---|---|
|
Source |
Aiden WMS stock transfer confirmation (Kafka) |
|
Target |
SAP B1 StockTransfers (POST via Kafka) |
|
Purpose |
Post warehouse-to-warehouse moves confirmed in WMS into B1 |
After installation, when WMS finishes a stock transfer between warehouses, the integration:
-
Validates serials in B1 (if present on put lines)
-
Maps get/put lines into a B1 stock transfer
-
Optionally adds bin allocations when warehouses use bin locations
-
Posts the document to B1 — or ignores the message when there is nothing to post (typically same-warehouse moves)
High-level outcomes
|
Situation |
Result |
|---|---|
|
Get warehouse ≠ put warehouse |
B1 Stock Transfer created |
|
Get warehouse = put warehouse |
No B1 document; message ignored |
|
Serial on put line not in B1 and no empty serial slot |
Processing stops with known error |
|
Bin-enabled warehouse with DefaultBin |
Bin allocation rows on the transfer line |
2. What the mapper uses as input
2.1 WMS stock transfer message
Typical structure:
-
transaction.id— WMS transaction id (integration external application id) -
transaction.type— e.g.StockTransfer -
documents[]:-
documentId,status,user, … -
getLines[]— stock taken from a warehouse/bin
(documentLine,warehouseId,binId,itemId,baseQuantity,quantity, UoM, batch/serial, …) -
putLines[]— stock put into a warehouse/bin
(same line shape; serials used for B1 serial check and transfer serials)
-
Lines are matched between get and put primarily by documentLine.
2.2 Warehouse master (automatic, hourly)
Loaded from B1:
-
WarehouseCode -
EnableBinLocations(tYES/tNO) -
DefaultBin(absolute bin entry when bins are enabled)
Used to decide whether bin allocations are written on the B1 stock transfer.
2.3 Serial pre-check (automatic, per message)
Before the main mapping:
-
GetItemAndSerial mapping builds a list from put lines:
documentId,documentLine,ItemCode,SerialNumber -
For each row with a non-empty serial:
-
GET B1
SerialNumberDetailsfor that item + serial -
If not found: GET an empty serial slot (
SerialNumberandMfrSerialNonull) and PATCH the WMS serial onto it -
If no empty slot exists → hard stop (“No empty serialnumbers left”)
-
Empty serials skip the B1 check.
3. Business behavior
3.1 When is a B1 stock transfer created?
The MapForce intermediate step builds transfer lines only when from warehouse ≠ to warehouse for the matched get/put line pair.
|
Get |
Put |
Result |
|---|---|---|
|
Different |
Different |
Transfer line(s) produced → B1 POST |
|
Same |
Same |
No lines → mapped body |
Log text in the integration: “No body so ignore message!! (is often movement in same warehouse)”.
This is intentional for pure bin-to-bin moves within one warehouse: they do not create a B1 inter-warehouse stock transfer.
3.2 Quantity
B1 line Quantity comes from the put line baseQuantity (inventory/base units), not necessarily the display quantity in a sales UoM.
3.3 Warehouses on the line
|
B1 field |
WMS source |
|---|---|
|
|
Get line |
|
|
Put line |
Header-level from/to warehouse codes may also be derived (first get/put warehouse) in the intermediate structure depending on output shape.
3.4 Serials and batches on the transfer
From put lines (when from ≠ to):
|
B1 structure |
WMS source |
Notes |
|---|---|---|
|
|
|
After serial pre-check |
|
|
|
As mapped |
|
|
|
|
|
|
|
When present |
|
|
|
|
|
|
|
|
3.5 Bin allocations
When a warehouse involved in the move has:
-
EnableBinLocations = tYES, and -
a non-null
DefaultBin
the mapping can emit StockTransferLinesBinAllocations with:
|
Field |
Value |
|---|---|
|
|
Warehouse |
|
|
Put |
|
|
|
WMS binId (string bin code) is not the direct B1 bin absolute entry in this mapping; B1 default bin absolute entry from the warehouse master is used.
If bins are not enabled or DefaultBin is missing, bin allocation arrays are typically empty (as in the different-warehouse scenario sample).
3.6 Two-step MapForce mapping
Internally the Java mapper:
-
Runs an intermediate mapping (WMS + warehouses → intermediate stock transfer structure)
-
Runs a final mapping (intermediate → output array of stock transfer documents)
Consultants only care about the final B1 payload; the two-step design supports filtering same-warehouse moves and attaching bins cleanly.
4. Field mapping tables
Columns: B1 target field | WMS / source input | What happens | Notes
4.1 Supporting extract (Get item and serial)
|
Output field |
WMS source |
Notes |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Drives B1 serial check |
4.2 Stock transfer lines (when from ≠ to)
|
B1 target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
Put |
Direct (after join/filter) |
Matched to get by |
|
|
Put |
Direct |
Base units |
|
|
Get |
Direct |
Only if ≠ put WH |
|
|
Put |
Direct |
Destination WH |
|
|
Put |
When serial filled |
After serial pre-check |
|
|
Put |
When batch filled |
|
|
|
Warehouse master + quantities |
Conditional |
See §3.5 |
4.3 Output document shape
Final output is an array of stock transfer objects (often one element), each with StockTransferLines (and optional from/to warehouse fields per schema).
Posted with:
-
HTTP endpoint:
StockTransfers -
HTTP method: POST
5. Value translations and constants (reference)
|
Concept |
Value / rule |
|---|---|
|
Same warehouse |
No B1 document; ignored |
|
Different warehouse |
Create Stock Transfer |
|
Bin enabled flag |
|
|
From bin action |
|
|
To bin action |
|
|
Empty serial |
Skip serial Service Layer check |
6. What is not mapped / caveats
|
Topic |
Behavior |
|---|---|
|
Same-warehouse bin moves |
Ignored for B1 stock transfer |
|
WMS |
Not mapped 1:1; DefaultBin abs entry used when bins enabled |
|
Business partner / card |
Not required for this WH-to-WH transfer shape |
|
Prices / costing |
Not mapped here |
|
Get-line serials |
Serial extract uses put lines |
|
Failed serial master |
Hard error; no partial transfer post |
7. Example (scenario 1_Stocktransfer_-_different_warehouse)
WMS input (excerpt)
|
Field |
Example |
|---|---|
|
|
|
|
Get line |
WH |
|
Put line |
WH |
B1 output (excerpt from 99_target.json)
{
"StockTransferLines": [
{
"ItemCode": "A00005",
"Quantity": "100",
"FromWarehouseCode": "05",
"WarehouseCode": "01",
"SerialNumbers": [
{
"InternalSerialNumber": "123456",
"Quantity": 100,
"ItemCode": "A00005"
}
],
"StockTransferLinesBinAllocations": []
}
]
}
Bin allocations are empty here because warehouse 01 in the sample master has bins disabled / no default bin path producing allocations for this case; warehouse 05 is bin-enabled with DefaultBin in the sample warehouses file—actual bin rows depend on master data and mapping conditions for both sides.
8. End-to-end expectation
-
User completes a stock transfer in WMS (pick from WH A, put to WH B).
-
WMS publishes get/put confirmation.
-
Integration registers put-line serials in B1 if needed.
-
If WH A ≠ WH B, mapper builds B1 Stock Transfer (qty, serials/batches, optional bins).
-
Document is POSTed to B1
StockTransfers. -
If WH A = WH B, message is ignored (no inter-warehouse document).
-
Trace with Kafka key and
transaction.id.
9. Implementation checklist for consultants
-
Use stock transfers across warehouses when B1 stock transfer documents are required.
-
Same-warehouse relocation will not create a B1 stock transfer with this mapper.
-
Maintain serial masters / empty serial slots in B1 for serialized put lines.
-
For bin-managed warehouses, set EnableBinLocations and DefaultBin correctly if bin allocations on the B1 transfer are required.
-
Prefer baseQuantity accuracy (inventory units) on put lines.
-
Align get/put documentLine pairing so from/to warehouses and items match.
-
Monitor ignored messages for unexpected same-warehouse traffic.
10. Source artifacts
|
Artifact |
Role |
|---|---|
|
|
Main stock transfer MapForce (intermediate + output) |
|
|
Put-line item/serial extract |
|
|
WMS input contract |
|
|
B1 output contract |
|
|
Warehouse master |
|
|
Kafka flow, ignore empty body, StockTransfers POST |
|
|
Serial GET/PATCH |
|
|
Hourly warehouse load |
|
|
Two-step MapForce run |
|
|
Serial extract runner |
|
|
Sample different-WH transfer |
Generated from the mapping definitions and integration routes in this project. If MapForce mappings or routing change, update this document.
Maintaining this document
For the original documentation intent, when to update, source-of-truth checklist, and a ready-made refresh prompt, see README.md and the repository AGENTS.md.