Functional documentation for the Aiden WMS inventory mapper (inbound).
This document describes what happens after the mapper is installed: how a WMS inventory adjustment (stock in or stock out) becomes a SAP Business One (B1) inventory document, which fields are mapped, and which business rules apply. It is intended for end-users and functional consultants.
1. Overview
|
|
|
|---|---|
|
Source |
Aiden WMS inventory transaction (Kafka) |
|
Target |
SAP B1 inventory document via Service Layer (Kafka → B1) |
|
Purpose |
Post stock corrections / free inventory movements from WMS into B1 |
After installation, when WMS completes an inventory inbound or outbound movement, the mapper produces a B1 document with:
-
Transaction reference (
U_AEN_WMS_TRANSID) -
Comments from the WMS reason description
-
Document lines (item, warehouse, quantity in base units)
-
Optional batch and/or serial sub-lines
-
G/L account derived from the WMS reason code (when configured)
Inbound vs outbound (routing)
|
WMS |
B1 document posted |
Endpoint header |
|---|---|---|
|
|
Inventory Goods Receipt (stock in) |
|
|
Anything else (e.g. |
Inventory Goods Issue (stock out) |
|
HTTP method is always POST.
2. What the mapper uses as input
2.1 WMS inventory message
Typical structure:
-
transaction.id— WMS transaction id (also used as integration external application id) -
transaction.type—InventoryInboundorInventoryOutbound(drives B1 document type) -
documents[]:-
documentId— becomes B1 UDF transaction id -
reason.reasonId/reason.reasonDesc— account mapping + comments -
lines[]— item, warehouse, quantity, optional batch/serial, optionalnumPerUom
-
No separate warehouse master load or item enrichment is required for this mapper (unlike some other Aiden flows).
2.2 Correlation / monitoring
|
Value |
Source |
Use |
|---|---|---|
|
Integration message id |
Kafka key |
XIAM correlation |
|
External application id |
|
XIAM |
|
Message type |
|
XIAM message type |
3. Business behavior
3.1 Document type selection
Only transaction.type == InventoryInbound posts an Inventory Gen. Entry.
All other types (including InventoryOutbound) post an Inventory Gen. Exit.
Consultants must set the correct transaction type in WMS so stock goes the right direction in B1.
3.2 Quantity and unit of measure
B1 line Quantity is calculated as:
Quantity = quantity × numPerUom
|
WMS fields |
Meaning |
|---|---|
|
|
Quantity in the UoM used on the line |
|
|
How many base/inventory units per that UoM |
If numPerUom is missing or not sent, behavior depends on runtime data (schema allows integer; mapping multiplies the two fields). For correct stock, WMS should send a reliable factor (often 1 when already in base UoM).
3.3 Reason → G/L account (AccountCode)
WMS documents[].reason.reasonId is translated to a B1 G/L AccountCode:
|
WMS |
B1 |
Typical meaning |
|---|---|---|
|
|
|
Inbound / stock correction in |
|
|
|
Outbound / stock correction out |
|
Other / unmapped |
No mapped account (null/empty path) |
Extend valuemap if more reasons are needed |
|
Reason id string |
Forced empty/null account branch |
Defensive handling in mapping |
Comments on the B1 document is filled from reason.reasonDesc (human-readable reason text).
3.4 Batches
If lines[].batchNumber is non-empty, a batch sub-structure is created on the B1 line:
|
B1 batch field |
WMS source |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
If batchNumber is empty, no batch block is emitted for that line.
3.5 Serials
If lines[].serialNumber is non-empty, a serial sub-structure is created:
|
B1 serial field |
WMS source |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
If serialNumber is empty, no serial block is emitted.
Important: some WMS outbound examples also carry serialNumberOutbound. The current MapForce mapping wires serialNumber only. For outbound serial stock corrections, ensure the serial is present in serialNumber (or extend the mapping if outbound-only fields must be used).
3.6 Transaction traceability
|
B1 field |
WMS source |
|---|---|
|
|
|
Use this UDF together with transaction.id for support and reconciliation.
4. Field mapping tables
Columns: B1 target field | WMS / source input | What happens | Notes
4.1 Header
|
B1 target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Direct |
Reason description |
|
|
|
Direct |
WMS document/transaction reference |
|
|
— |
Not mapped |
Present in output schema only |
4.2 Document lines
|
B1 target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Multiply |
Base units |
|
|
|
Valuemap + if-else |
See §3.3 |
4.3 Batches (conditional)
|
B1 target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
Batch block present? |
|
Filter |
Empty batch → no block |
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Multiply |
Same as line qty |
4.4 Serials (conditional)
|
B1 target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
Serial block present? |
|
Filter |
Empty serial → no block |
|
|
|
Direct |
|
|
|
|
Direct |
Same value |
|
|
|
Direct |
|
|
|
|
Multiply |
|
5. Value translations (reference)
5.1 Transaction type → B1 endpoint
|
WMS |
B1 endpoint |
|---|---|
|
|
|
|
Other (e.g. |
|
5.2 Reason id → account
|
|
|
|---|---|
|
|
|
|
|
|
|
Unmapped |
Empty/null account path |
6. What is not mapped / caveats
|
Topic |
Behavior |
|---|---|
|
Bin location ( |
Not mapped to B1 line/bin allocations in this MFD |
|
License / carrier |
Not mapped |
|
Item name |
Not mapped (B1 uses item master) |
|
|
In schema; not wired |
|
|
Not wired; use |
|
Prices / BP / base documents |
Not applicable to free inventory gen docs in this flow |
|
Multi-document payloads |
Mapping focuses on document/line structure as modeled; validate multi-doc if used |
7. Example
WMS input (scenario 1_mainRoute excerpt)
|
Field |
Example |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
Line |
Item |
Expected B1 shape (from mapping rules)
|
B1 field |
Expected |
|---|---|
|
Endpoint |
|
|
|
|
|
|
|
|
Line |
|
|
Line |
|
|
Line |
Unmapped for |
Outbound serial example (mapping sample)
inputExample.json uses transaction.type = InventoryOutbound and serialNumberOutbound.
With the current MFD, serials are only taken from serialNumber. Ensure outbound processes populate serialNumber, or the B1 exit will not carry serials.
8. End-to-end expectation
-
User posts an inventory inbound or outbound movement in WMS (with reason).
-
WMS publishes the inventory transaction to Kafka.
-
Integration chooses Inventory Gen. Entry or Exit from
transaction.type. -
Mapper builds B1 JSON (comments, UDF, lines, batches/serials, account from reason).
-
Message is sent for B1 POST.
-
Trace with Kafka key,
transaction.id, andU_AEN_WMS_TRANSID(documentId).
9. Implementation checklist for consultants
-
Align WMS reason codes with the account valuemap (
IR1→3100,OR1→3200) or request mapping extensions for additional codes (e.g.IR2). -
Use correct
transaction.typeso stock increases vs decreases in B1. -
Send reliable
numPerUomso B1 quantity is in inventory base units. -
For batch items, fill
batchNumber(and expiry if required). -
For serial items, fill
serialNumber(including outbound corrections). -
Confirm B1 G/L accounts
3100/3200(or your local equivalents after remap) exist and are allowed on inventory gen docs. -
Use
U_AEN_WMS_TRANSID/transaction.idfor reconciliation.
10. Source artifacts
|
Artifact |
Role |
|---|---|
|
|
MapForce mapping |
|
|
MapForce project |
|
|
WMS input contract / sample |
|
|
B1 output contract |
|
|
Inbound/outbound endpoint routing |
|
|
MapForce runner |
|
|
Sample source (target file may be incomplete) |
Generated from the mapping definition and integration routes in this project. If the MapForce mapping or routing changes, 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.