Functional documentation for the Aiden WMS goods delivery mapper (inbound).
This document describes what happens after the mapper is installed: how a WMS goods movement message is routed, which SAP Business One (B1) or WMS documents are created, and which field rules apply. It is intended for end-users and functional consultants.
1. Overview
|
|
|
|---|---|
|
Source |
Aiden WMS goods / delivery message (Kafka) |
|
Targets |
SAP B1 documents via Service Layer and/or WMS warehouse documents |
|
Purpose |
Confirm outbound/inbound warehouse work back into ERP (or continue as a WMS warehouse document) |
One inbound message can become different document types depending on documents[0].customFields.objectType (and, for stock transfers, whether the target warehouse is external).
High-level outcomes
|
Result document |
Typical origin in WMS |
Destination system |
|---|---|---|
|
B1 Delivery Note |
Delivery against a sales order |
SAP B1 ( |
|
B1 Inventory Gen. Exit (issue) |
Issue against a production order |
SAP B1 ( |
|
B1 Stock Transfer |
Stock transfer request to an external warehouse |
SAP B1 ( |
|
WMS Incoming document |
Stock transfer request not external |
Aiden WMS ( |
|
WMS Purchase document (payload shape) |
Goods against a purchase order |
Aiden WMS warehouse Kafka with endpoint |
2. Message routing
Routing key: documents[0].customFields.objectType.
|
|
Extra condition |
What runs |
Published as |
|---|---|---|---|
|
|
— |
Load related B1 order(s) → Delivery Notes mapper |
B1 |
|
|
At least one line with |
Production Issue mapper |
B1 |
|
|
All lines backflush (or field missing / no matching lines) |
Skipped (ignored status) |
Nothing |
|
|
|
Stock Transfer mapper (+ warehouse master) |
B1 |
|
|
Target not external / flag not |
WMS Incoming Document mapper |
WMS |
|
|
— |
Purchase Orders mapper (purchase-document payload) |
WMS |
|
Anything else |
— |
Logged: no match |
Nothing |
Configure
objectTypeand (for transfers)targetIsExternalcorrectly on the WMS message. Wrong values send the document down the wrong path or skip it.
3. Shared behavior (all flows)
3.1 Correlation and tracking
|
Value |
Source |
Used for |
|---|---|---|
|
Integration correlation / message id |
Kafka message key |
XIAM monitoring |
|
External application id |
|
XIAM / tracking |
|
B1 UDF |
|
Trace WMS transaction on B1 document |
3.2 Serial number check (before document mapping)
For every picked/saved unit that carries a serial, the integration:
-
Builds an item + serial list from the WMS message (Get item and serial helper mapper).
-
Looks up B1
SerialNumberDetailsfor thatItemCode+SerialNumber. -
If not found:
-
Looks for an empty serial slot on that item (
SerialNumberandMfrSerialNonull). -
PATCHes the WMS serial onto that slot (
SerialNumberandMfrSerialNo).
-
-
If no empty slot exists → processing stops with a known error: serial not available for the item.
Saved lines without a serial skip the B1 lookup. If one serial check fails, remaining serial checks for the message are not continued (hard stop for the whole message).
Consultant impact: serials must exist (or empty serial masters must be available) in B1 before confirmation. Missing serial masters cause a hard failure, not a partial document.
3.3 Sales order enrichment (Orders only)
Before the delivery-note mapping:
-
Collects
customFields.externalIdfrom each WMS document (B1 orderDocEntry). -
GETs B1
Orders(DocEntry,DocNum,DocumentLines). -
Uses order lines for base-line matching, UoM / units-of-measurement enrichment on packages, etc.
3.4 Warehouse master
Loaded from B1 on a timer (every 3600 seconds from startup):
-
WarehouseCode,DefaultBin,EnableBinLocations,U_AEN_WHS_Picking
Main functional use in this project: stock transfer bin allocations when the line warehouse has bin locations enabled and a default bin. (U_AEN_WHS_Picking is loaded with the master; bin allocation is the confirmed consumer in this mapper.)
3.5 Delivery note output sorting
Delivery note JSON is normalized/sorted before it is sent to B1: DocumentLines ordered by VisualOrder.
4. Flow: Delivery notes (objectType = Orders)
4.1 Business behavior
Creates one or more SAP B1 Delivery Notes from a WMS delivery confirmation against sales order(s).
Important rules:
-
Base document: order identified by
customFields.externalId→ B1BaseEntry. -
Base type: from
customFields.objectTypevia valuemap:-
Orders→17 -
StockTransferRequests→1250000001
-
-
Lines are aggregated from WMS
savedLines(picked quantities), joined back to order/document lines for item, UoM, sales BOM, etc. -
Intermediate saved-line paths: batch (
batchNumberfilled), serial (serialNumberfilled), or plain (both empty). -
Batches: when
savedLines.batchNumberis filled, B1 batch lines are created (batch no., expiry, qty frombaseQuantity). -
Serials: when
savedLines.serialNumberis filled, B1 serial lines are created (InternalSerialNumber, qty fromsavedLines.quantity). -
Packages / SSCC:
savedLines.licenseId+carrierdriveDocumentPackages/DocumentPackageItems(U_AEN_WMS_Track= license,Type= carrier). -
Header & line additional expenses are copied/grouped into B1 expense structures with base doc references; line expenses set
BaseGroupfromGroupCode. -
Special lines from WMS line custom fields are carried into B1
DocumentSpecialLinesfor the fields listed below. -
Sales BOM attributes on WMS lines (
parent,parentLine,singleQuantity,respectSingleQuantity) are available in the intermediate line enrichment used by the mapping.
4.2 Field mapping — Delivery Note header
|
Target field (B1 Delivery Note) |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
WMS transaction trace |
|
|
Aggregated from |
Group-by line / sum qty |
See lines table |
|
|
|
Group/copy + base refs |
See expenses table |
|
|
|
Group packages |
|
|
|
Line |
Group/merge into DN |
See special lines table |
Comments is present on the B1 output schema but is not confirmed as filled from WMS in the current mapping.
4.3 Field mapping — Delivery Note lines
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Direct |
B1 order DocEntry |
|
|
Intermediate |
Group-by via saved-line join |
|
|
|
|
Valuemap → |
DN valuemap uses |
|
|
|
Sum per base line |
|
|
|
Generated |
Auto-number (start 0) |
Scoped with external id |
|
|
Same as generated |
Copy of |
Java sorts lines by this |
|
|
|
When batch path |
|
|
|
|
When batch path |
|
|
|
|
When batch path |
Not |
|
|
|
When serial path |
After serial validation |
|
|
|
When serial path |
|
|
|
|
Via intermediate; regroup on output |
See expenses table |
4.4 Field mapping — Header additional expenses
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Group-by |
|
|
|
Same |
Group key |
|
|
|
Same |
Direct |
|
|
|
Same |
Direct |
|
|
|
Same |
Direct |
|
|
|
Same |
Direct |
|
|
|
|
Direct |
|
|
|
Expense |
Direct |
|
|
|
|
Valuemap ( |
|
4.5 Field mapping — Line additional expenses
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Via intermediate line join |
Final output regroups by |
|
|
Same |
Direct / group key |
|
|
|
Same |
Direct |
|
|
|
Same |
Direct |
|
|
|
Same |
Direct |
|
|
|
Same |
Direct |
|
|
|
Expense |
First-items / GroupCode stream → |
Added so B1 receives base group from WMS group code |
|
Line number link |
Expense / line |
Mapped into line expense line number where wired |
|
4.6 Field mapping — Special lines
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Group-by line/order keys; first-items |
Final DN fields only |
|
|
Same WMS field |
First-items |
|
|
|
Same WMS field |
First-items |
|
|
|
Same WMS field |
First-items |
|
|
|
Same WMS field |
First-items |
|
Other freight/amount fields may exist on the WMS special-line payload and intermediate structures; only the fields above are confirmed on the final delivery-note output.
4.7 Field mapping — Packages
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
Package number |
Generated |
Auto-number per license group |
Starts from |
|
|
|
Max/representative carrier |
e.g. |
|
|
|
Group key |
SSCC / license |
|
Package item |
Line |
Group-by item in package |
|
|
Package item |
|
Sum |
|
|
Package item |
Line UoM / intermediate uomCode |
Max-string from enrichment |
|
|
|
B1 order line |
Lookup on order lines by item/UoM; default |
Needs order GET; B1 spelling |
4.8 Example (scenario 1_DeliveryNotesNoSerial)
|
Input (excerpt) |
Output (excerpt) |
|---|---|
|
|
DN |
|
Saved lines with batch |
Lines with |
5. Flow: Production issue (objectType = ProductionOrders)
5.1 Business behavior
Creates B1 Inventory Gen. Exit documents for production issues from WMS.
-
Runs only if not all lines are backflush (
productionOrderIssueType != im_Backflushon at least one line). -
Backflush lines are excluded from the issue document.
-
Saved lines without a usable batch path are filtered in intermediate logic (empty batch handling / not-equal filters).
-
Quantities aggregated per production order base line; batches and serials attached like other goods movements.
-
Base type valuemap includes
ProductionOrders→202.
5.2 Field mapping — Inventory Gen. Exit
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
Header document set |
|
Structural |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
Production order key |
|
|
|
Group-by |
|
|
|
|
Valuemap ( |
|
|
|
|
Sum |
Non-backflush only |
|
|
|
Serial path |
After serial check |
|
|
|
Serial path |
|
|
|
|
Batch path |
|
|
|
|
Batch path |
|
|
|
|
Batch path |
|
No CardCode, packages, expenses, or bin allocations in this flow.
6. Flow: Stock transfer external (objectType = StockTransferRequests and targetIsExternal = Y)
6.1 Business behavior
Creates a B1 Stock Transfer from a WMS stock transfer request when the target is marked external.
-
Lines built from
savedLines, joined to document lines forlineNum/ warehouse. -
Serials included when present (empty serial filtered out of serial path).
-
Batches included when present (batch quantity from
baseQuantity; no batch expiry on this MFD). -
No
DocDateon the stock-transfer output schema. -
Bin allocations: if the line’s
warehouseIdmatches a B1 warehouse withEnableBinLocations = tYESand aDefaultBin, bin allocation rows are written (BinAbsEntry= default bin, quantity from line/batch/serial path).
6.2 Field mapping — Stock Transfer
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
Document root |
|
Structural |
No |
|
|
|
Direct |
|
|
|
|
Direct |
STR doc entry |
|
|
Line |
Group-by |
|
|
|
|
Valuemap ( |
|
|
|
|
Sum |
|
|
|
|
When non-empty |
|
|
|
|
When serial path |
|
|
|
|
When non-empty |
|
|
|
|
When batch path |
No |
|
|
Warehouse master |
If |
|
|
|
Line / path quantity |
Sum/direct |
Follows transfer line qty |
7. Flow: WMS incoming document (internal stock transfer)
7.1 Business behavior
When objectType = StockTransferRequests and the target is not external, the mapper does not post a B1 stock transfer. It creates a WMS Incoming Document for the receiving warehouse process.
Observed constants / structure from the mapping:
-
data.baseType=TransferRequest -
Business partner is derived from the source warehouse (not the WMS BP master): id = source
lines.warehouseId; name ='From warehouse '+ source warehouse id -
detailsis a direct copy of WMSdocuments.details(no “From warehouse” prefix on details) -
Lines aggregated from saved lines (item, qty, UoM); line warehouse =
lines.customFields.toWarehouse -
Batch/serial info blocks built from
savedLineswhen batch or serial is non-empty (batch number, qty, expiry; serial numbers) -
Correlation id from the integration Kafka message key / XIAM message id
-
Owner copied when present on the WMS document
7.2 Field mapping — Incoming document (summary)
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
Kafka message key / XIAM message id |
MapForce parameter |
Not Camel exchange id |
|
|
|
Direct |
|
|
|
— |
Constant |
|
|
|
|
Direct when present |
|
|
|
|
Direct |
|
|
|
|
Direct copy |
Not prefixed |
|
|
Source |
Max-string via line join |
Source WH used as “BP id” |
|
|
|
Concat |
|
|
|
Saved lines + |
Group-by |
|
|
|
|
Via line join |
|
|
|
|
Sum |
|
|
|
|
Join + max-string |
To warehouse |
|
|
|
Via line join |
|
|
|
|
Direct |
|
|
|
|
Direct / passthrough |
|
|
|
|
Structured sub-documents when batch or serial present |
Batch qty from |
Published to to.kafka.warehouse with endpoint IncomingDocument.
8. Flow: Purchase document (objectType = PurchaseOrders)
8.1 Business behavior
Maps the WMS confirmation into a purchase-document payload shape (not a B1 Delivery/GRPO in this route).
-
Header/BP/dates/details largely copied from the WMS documents block.
-
Lines grouped by saved line document line; quantity summed.
-
Item, warehouse, UoM, details joined from order lines by
documentLine. -
Serials exposed as dynamic properties:
-
Collection name:
serialNumbers -
Element name:
serialNumber
-
-
No batches in this MFD.
-
Header/line additional expenses renamed into purchase-doc expense field names (
expenseCode,expenseLine,expenseLineTotal,expenseGroupCode,expenseDistributioMethod[spelling as in MFD],expenseVatGroup, …). -
customFields.objectTypeon output is set to constantStockTransferRequestsin the MapForce mapping (verify against your WMS purchase-doc expectations if this looks unexpected functionally). -
Publish target: warehouse Kafka topic with HTTP endpoint header
IncomingDocument(same endpoint name as internal stock-transfer incoming; payload remains the purchase mapper output).
8.2 Field mapping — Purchase document
|
Target field |
WMS / source input |
What happens |
Notes |
|---|---|---|---|
|
|
Camel |
MapForce parameter |
Not the Kafka/XIAM message key used by incoming document |
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
Group key from |
Group-by |
|
|
|
|
Join on documentLine |
|
|
|
|
Join on documentLine |
|
|
|
|
Sum |
|
|
|
|
Join |
|
|
|
|
Join |
|
|
Serial properties |
|
Nested |
When serial non-empty |
|
|
|
Direct |
|
|
|
— |
Constant |
As in MFD |
|
Expense custom fields |
WMS |
Renamed to expense* fields |
Header + line |
Published to to.kafka.warehouse with endpoint IncomingDocument.
9. Supporting mapper: Get item and serial
Not a business document. Builds the working list used for B1 serial validation (one output row per savedLines entry):
|
Output field |
Source |
Notes |
|---|---|---|
|
|
WMS documents / saved-lines context |
|
|
|
|
|
|
|
Matched |
Join on |
|
|
|
|
|
|
|
Same value as |
10. Value translations (reference)
10.1 Object type → B1 base type
Valuemaps differ slightly per mapper (input key is documents[].customFields.objectType):
|
WMS / message |
B1 |
Delivery notes |
Production issue |
Stock transfer |
|---|---|---|---|---|
|
|
|
Yes |
— |
— |
|
|
|
— |
Yes |
Yes |
|
|
|
Yes |
Yes |
Yes |
|
|
|
— |
Yes |
— |
10.2 Production issue type
|
|
Effect |
|---|---|
|
|
Line excluded; if all lines backflush → whole message ignored |
|
Other / not backflush |
Eligible for Inventory Gen. Exit |
10.3 Stock transfer external flag
|
|
Effect |
|---|---|
|
|
B1 Stock Transfer |
|
Not |
WMS Incoming Document |
10.4 Warehouse bins (stock transfer)
|
B1 warehouse fields |
Effect on stock transfer |
|---|---|
|
|
Bin allocation rows with |
|
Otherwise |
No bin allocation from this rule |
11. What is not done / failure & skip cases
|
Situation |
Result |
|---|---|
|
Unknown |
No document; log only |
|
Production order, only backflush lines |
Ignored (no Inventory Gen. Exit) |
|
Serial required but not available in B1 and no empty slot |
Hard stop + known error |
|
Internal stock transfer |
No B1 stock transfer; WMS incoming instead |
|
Purchase order path |
Purchase-document payload on warehouse Kafka with endpoint |
|
Prices / full financials |
Not the focus of these confirmation mappings |
|
Changing B1 order master beyond serial PATCH |
Orders are read for enrichment; serials may be patched |
12. End-to-end happy path (sales order delivery)
-
WMS completes picking/packing for a sales order and publishes a goods message (
objectType = Orders). -
Integration validates/registers serials in B1 as needed.
-
Integration loads the B1 order line structure.
-
Delivery Notes mapper builds B1 DN JSON (lines, batches, serials, packages, expenses).
-
JSON is sorted by
VisualOrderand posted to B1 as DeliveryNotes. -
U_AEN_WMS_TRANSIDand correlation ids support support/troubleshooting.
13. Implementation checklist for consultants
-
objectType on WMS documents must match one of:
Orders,ProductionOrders,StockTransferRequests,PurchaseOrders. -
For stock transfers, set
targetIsExternalcorrectly (Y= post B1 transfer; otherwise WMS incoming). -
customFields.externalIdmust be the B1 base document key (order / production order / STR DocEntry as applicable). -
Maintain serial number masters (or empty serial slots) in B1 for serialized items.
-
For deliveries with packages, ensure licenseId and carrier are filled on saved lines if SSCC/packages are required in B1.
-
For production issues, set
productionOrderIssueTypeso backflush lines are not double-issued. -
For bin-managed warehouses used in external transfers, set DefaultBin and EnableBinLocations in B1.
-
Use
transaction.id/U_AEN_WMS_TRANSIDfor tracing.
14. Source artifacts
|
Artifact |
Role |
|---|---|
|
|
WMS → B1 Delivery Notes |
|
|
Item/serial extraction |
|
|
WMS → B1 Inventory Gen. Exit |
|
|
WMS → B1 Stock Transfers |
|
|
WMS STR → WMS Incoming Document |
|
|
WMS → purchase-document payload (published as |
|
|
Routing by objectType |
|
|
Serial + order Service Layer calls |
|
|
Warehouse master load |
|
|
Sample messages (delivery note scenarios) |
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.