Aiden WMS

Goods Receipt on WMS managed warehouse (ad-hoc)

TL;DR — Aiden WMS Goods Receipt → Inventory Inbound Mapper
  • Purpose: Convert a posted SAP B1 Purchase Delivery Note / Goods Receipt PO into an ad‑hoc WMS InventoryInbound so stock can be booked into WMS. Fixed reason: PDN (“Ad‑Hoc Purchase Delivery Note”).

  • Flow & Endpoint: B1 PDN/GRPO → mapper builds InventoryInbound → publishes with endpoint header InventoryInbound. correlation.correlationId comes from the Kafka message key for traceability.

  • Inputs used:

    • Header: DocNum, CardCode, CardName.

    • Lines: ItemCode, Quantity, WarehouseCode, UoMEntry/UoMCode/MeasureUnit/UnitsOfMeasurment, FreeText.

    • Optional children: SerialNumbers[] and BatchNumbers[] (BatchNumber, ExpiryDate, Quantity).

    • No warehouse master load; no BOM helper in this project.

  • Why multiple WMS lines per B1 line: The mapper emits up to three expansions from each B1 line:

    • Plain line: included when the “batch number equals empty” check passes; quantity = B1 line Quantity.

    • Serial lines: one WMS line per serial (InternalSerialNumber present); quantity = 1 each.

    • Batch lines: one WMS line per batch (BatchNumber present); quantity = BatchNumbers.Quantity ÷ DocumentLines.UnitsOfMeasurment.

    • Line numbers are auto‑numbered across all expansions (not using B1 LineNum).

  • Warehouse and bin:

    • lines[].warehouseId = WarehouseCode (from B1 line).

    • lines[].binId = WarehouseCode + “-ONT1” (synthetic placeholder; replace when implemented).

    • No picking‑warehouse filter; all mapped per structure.

  • UoM rule (for all expansions):

    • If UoMEntry ≠ -1 → uomCode = UoMCode.

    • If UoMEntry = -1 → uomCode = "m" + MeasureUnit (empty measure → "m").

  • Per‑expansion mappings:

    • Plain: itemId = ItemCode; quantity = line Quantity; no serial/batch/expiry.

    • Serial: itemId = serial.ItemCode; quantity = 1; serialNumber = InternalSerialNumber.

    • Batch: itemId = batch.ItemCode; quantity = batch qty ÷ UnitsOfMeasurment; batchNumber; expiryDate.

  • Common line fields:

    • documentLine = auto‑number start/step 1.

    • details = line FreeText.

    • license/carrier/customFields are not populated.

  • Header custom fields and reason:

    • reason.reasonId = PDN; reason.reasonDesc = Ad‑Hoc Purchase Delivery Note.

    • customFields.CardCode = CardCode; customFields.CardName = CardName; customFields.DocNum = DocNum.

    • data.owner and data.details are not mapped.

  • Not covered / caveats: No status/open‑qty logic; no picking‑warehouse filtering; no prices/VAT/discounts; no B1 bin allocations (bin is synthetic -ONT1); exact deduplication between plain vs batch/serial isn’t attempted—expansions are independent.

  • Implementer checklist:

    • Ensure the published B1 doc is the intended PDN/GRPO for this flow.

    • Align WMS with synthetic bins like “01-ONT1” or replace this convention.

    • Validate UnitsOfMeasurment for batch items (quantities = batch ÷ UoM factor).

    • Expect one line per serial with quantity 1.

    • Track via correlation.correlationId and customFields.DocNum.

    • Don’t expect BOM processing, warehouse filters, or header owner/details from this mapper.

Functional documentation for the Aiden WMS goods receipt → inventory inbound mapper.

This document describes what happens after the mapper is installed: which SAP Business One (B1) goods receipt / purchase delivery note data is sent to Aiden WMS, how values are translated, and which business rules apply. It is intended for end-users and functional consultants.


1. Overview



Source

SAP B1 Purchase Delivery Note / Goods Receipt PO (Service Layer document JSON)

Target

Aiden WMS inventory inbound document (InventoryInbound)

Purpose

Convert a posted B1 goods receipt into an ad-hoc WMS inventory inbound so stock can be booked into WMS

After installation, when a B1 goods receipt (purchase delivery note) is published to the integration, the mapper produces a WMS inventory inbound that contains:

  • Fixed reason PDN (“Ad-Hoc Purchase Delivery Note”)

  • Supplier identification (CardCode / CardName) and B1 DocNum

  • One or more inventory lines derived from B1 document lines, expanded when serials or batches exist

  • Warehouse, synthetic bin id, item, quantity, UoM, optional serial/batch/expiry

  • Correlation id for tracking

Fixed business defaults

WMS field

Fixed value

Meaning for WMS

data.reason.reasonId

PDN

Goods receipt / purchase delivery note origin

data.reason.reasonDesc

Ad-Hoc Purchase Delivery Note

Human-readable reason

Line binId suffix

-ONT1

Appended to warehouse code (e.g. 01-ONT1)

This is a placeholder in the template. Should be replaced when used.

Serial line quantity

1

Always one unit per serial line

Runtime endpoint

After mapping, the Camel route sets the outbound endpoint header to:

  • InventoryInbound

There is no warehouse master load and no BOM helper in this project (unlike sales order / sales return mappers).


2. What the mapper uses as input

2.1 Main payload — B1 goods receipt (Purchase Delivery Note)

The primary input is the full B1 document JSON (Service Layer entity), typically a purchase delivery note (oPurchaseDeliveryNotes), including for example:

  • Header: DocNum, CardCode, CardName

  • Lines: DocumentLines[] with ItemCode, Quantity, WarehouseCode, UoMEntry, UoMCode, MeasureUnit, UnitsOfMeasurment, FreeText

  • Optional line children:

    • SerialNumbers[] (InternalSerialNumber, ItemCode, …)

    • BatchNumbers[] (BatchNumber, ExpiryDate, ItemCode, Quantity, …)

2.2 Correlation id

The message correlation id (integration message key / Kafka key) is passed into MapForce as parameter exchangeProperty and written to:

  • correlation.correlationId

Use this to trace a WMS inventory inbound back to the integration message.

DocNum is also registered as the integration external application id (monitoring), separate from the mapped JSON body.


3. Business behavior

3.1 Why three kinds of WMS lines?

MapForce emits up to three parallel line expansions from each B1 document line context (clone objects on the output array). Practically:

Expansion

When it produces WMS lines

Quantity source

Plain item line

When the batch filter treats the batch number as empty (string compare result mapped: only 0 → include)

B1 line Quantity

Serial lines

When a serial’s InternalSerialNumber is not null

Constant 1 per serial

Batch lines

When batch number is present (after null/missing substitute)

BatchNumbers.Quantity ÷ DocumentLines.UnitsOfMeasurment

A single B1 line can therefore result in multiple WMS lines if it carries serials and/or batches, in addition to the plain-line path when the batch-empty filter allows it.

Consultant impact: WMS may receive more lines than B1 line count. Serial-managed and batch-managed items expand into tracking-specific lines. Validate UoM factors (UnitsOfMeasurment) for batch quantities.

3.2 Document line numbering

WMS documentLine is not taken from B1 LineNum.

It is generated with MapForce auto-number, using start and step 1.

The same auto-number stream feeds plain, serial, and batch expansions, so line numbers are sequential across generated WMS lines (not necessarily aligned 1:1 with B1 LineNum).

3.3 Warehouse and bin

WMS field

Rule

warehouseId

Direct copy of B1 line WarehouseCode

binId

Concatenate WarehouseCode + constant -ONT1

This is a placeholder in the template. Should be replaced when used.

Example: warehouse 01 → bin id 01-ONT1.

There is no filter on picking-enabled warehouses in this mapper (all document lines participate in the mapping structure as defined).

3.4 Unit of measure (uomCode)

For each generated line (plain / serial / batch expansions share the same UoM logic from the parent B1 line):

  1. If UoMEntry is not -1 → use UoMCode

  2. If UoMEntry is -1 → use "m" + MeasureUnit

    • Missing MeasureUnit is substituted with empty string before concat (result can be just m)

3.5 Plain item lines

  • Filter: batch number path is null-substituted to empty string, then compared; valuemap keeps only compare result 0 (default false → line suppressed for other compare results).

  • itemId ← B1 line ItemCode

  • quantity ← B1 line Quantity

  • No batchNumber, expiryDate, or serialNumber on this expansion

3.6 Serial lines

  • Filter: B1 SerialNumbers.InternalSerialNumber is not null

  • One WMS line per serial record

  • itemId ← serial’s ItemCode (not necessarily re-read only from parent line)

  • quantity ← constant 1

  • serialNumberInternalSerialNumber (after missing → empty substitute on the serial path used for filters/output as wired)

  • No batch/expiry on this expansion

3.7 Batch lines

  • Filter: batch number is not null (after missing substitute on the batch value path)

  • One WMS line per batch record

  • itemId ← batch’s ItemCode

  • quantityBatchNumbers.Quantity divided by line UnitsOfMeasurment

  • batchNumber ← batch BatchNumber

  • expiryDate ← batch ExpiryDate

  • No serial on this expansion

If UnitsOfMeasurment is 0 or inconsistent, batch quantities in WMS will be wrong. Ensure B1 line UoM factors are correct for batch-managed items.

3.8 Line details

On all three expansions, WMS details is filled from the B1 line FreeText.

3.9 Header custom fields and reason

WMS field

Source

reason.reasonId

Constant PDN

reason.reasonDesc

Constant Ad-Hoc Purchase Delivery Note

customFields.CardCode

B1 CardCode

customFields.CardName

B1 CardName

customFields.DocNum

B1 DocNum

data.owner and data.details are not mapped.


4. Field mapping tables

Legend:

  • WMS output field — path in the Aiden WMS inventory inbound document

  • B1 / source input — field on the goods receipt or other source

  • What happens — copy or transformation

  • Notes — consultant-relevant remarks

4.1 Correlation

WMS output field

B1 / source input

What happens

Notes

correlation.correlationId

Integration message key

Direct (MapForce param exchangeProperty)

End-to-end tracing

4.2 Header (data)

WMS output field

B1 / source input

What happens

Notes

data.reason.reasonId

Constant PDN

Always

data.reason.reasonDesc

Constant Ad-Hoc Purchase Delivery Note

Always

data.owner

Not mapped


data.details

Not mapped


data.customFields.CardCode

CardCode

Direct

Supplier code

data.customFields.CardName

CardName

Direct

Supplier name

data.customFields.DocNum

DocNum

Direct

B1 document number

4.3 Shared line fields (all expansions)

WMS output field

B1 / source input

What happens

Notes

lines[].documentLine

Auto-number start/step 1

Not B1 LineNum

lines[].warehouseId

DocumentLines.WarehouseCode

Direct


lines[].binId

Direct


lines[].uomCode

UoMEntry, UoMCode, MeasureUnit

Conditional — see §3.4

From parent line

lines[].details

DocumentLines.FreeText

Direct


lines[].licenseId

Not mapped


lines[].carrierId / carrier

Not mapped


lines[].customFields

Not populated meaningfully

Schema placeholders only

4.4 Plain item expansion

WMS output field

B1 / source input

What happens

Notes

Line included?

Batch number empty filter

Compare + valuemap (0→true)

See §3.5

lines[].itemId

DocumentLines.ItemCode

Direct


lines[].quantity

DocumentLines.Quantity

Direct


lines[].batchNumber

Not set on this clone


lines[].serialNumber

Not set on this clone


lines[].expiryDate

Not set on this clone


4.5 Serial expansion

WMS output field

B1 / source input

What happens

Notes

Line included?

SerialNumbers.InternalSerialNumber

is-not-null filter

One WMS line per serial

lines[].itemId

SerialNumbers.ItemCode

Direct


lines[].quantity

Constant 1

Always

lines[].serialNumber

SerialNumbers.InternalSerialNumber

Direct (with missing substitute on path)


lines[].batchNumber / expiryDate

Not set on this clone


4.6 Batch expansion

WMS output field

B1 / source input

What happens

Notes

Line included?

BatchNumbers.BatchNumber

is-not-null (after substitute)

One WMS line per batch

lines[].itemId

BatchNumbers.ItemCode

Direct


lines[].quantity

Batch Quantity, line UnitsOfMeasurment

Divide batch qty ÷ UoM factor

See §3.7

lines[].batchNumber

BatchNumbers.BatchNumber

Direct


lines[].expiryDate

BatchNumbers.ExpiryDate

Direct


lines[].serialNumber

Not set on this clone



5. Value translations and constants (reference)

5.1 Fixed constants

Constant

Used for

PDN

data.reason.reasonId

Ad-Hoc Purchase Delivery Note

data.reason.reasonDesc

m

UoM fallback prefix when UoMEntry = -1

-1

UoM entry comparison

1

Serial quantity; auto-number start/step

-ONT1

Bin id suffix after warehouse code

(empty string)

Substitute for missing MeasureUnit / batch-serial null paths

5.2 UoM rule

Condition

uomCode result

UoMEntry ≠ -1

UoMCode

UoMEntry = -1

m + MeasureUnit (MeasureUnit may be empty)

5.3 Batch-empty filter (plain lines)

String-compare result (batch vs empty)

Valuemap

Plain line emitted?

0

true

Yes

Other

default false

No

5.4 Endpoint

Integration setting

Value

Outbound HTTP/WMS endpoint header

InventoryInbound


6. What is not mapped / important omissions

Consultants should not expect the following from this mapper:

Topic

Behavior

Document status / open qty filters

No status strip or remaining-open filter; mapping uses line structure as defined

Picking warehouse flag

Not used (no warehouse master intermediate)

Prices, VAT, discounts

Not mapped

Owner / header details

Not mapped

License / carrier fields

Not mapped

Bin locations from B1 bin allocations

Not used; bin is synthetic WarehouseCode-ONT1

This is a placeholder in the template. Should be replaced when used.

Scenario target sample

scenario_files/1_mainRoute/99_target.json is dummy — not expected mapped output

Exact de-duplication of plain vs batch/serial

Three expansions are separate MapForce clones; validate real samples for your item types


7. End-to-end expectation (happy path)

  1. A Purchase Delivery Note / Goods Receipt PO is posted in SAP B1 and published to the integration.

  2. Integration sets correlation from the Kafka key and external application id from DocNum.

  3. Mapper builds a WMS inventory inbound:

    • Reason PDN / Ad-Hoc Purchase Delivery Note

    • Supplier + DocNum in custom fields

    • Lines expanded for plain / serial / batch cases

    • Bin ids as warehouse-ONT1

  4. Message is published with endpoint InventoryInbound.

  5. WMS books ad-hoc inbound inventory accordingly.


8. Example (illustrative)

Based on mappings/inputExample.json (Purchase Delivery Note) and confirmed MapForce rules.
Scenario files under scenario_files/1_mainRoute are placeholders and are not reliable expected I/O samples.

B1 input (excerpt)

Field

Example value

Document

Purchase Delivery Note (Goods Receipt PO)

DocNum / DocEntry

564

CardCode

V1010

CardName

Verre Oosten Import

Line

Item, warehouse, quantity, UoM; optional serials/batches

WMS output (expected shape)

WMS field

Example result

Endpoint

InventoryInbound

correlation.correlationId

Kafka / integration message key

data.reason.reasonId

PDN

data.reason.reasonDesc

Ad-Hoc Purchase Delivery Note

data.customFields.CardCode

V1010

data.customFields.CardName

Verre Oosten Import

data.customFields.DocNum

564

lines[].warehouseId

e.g. 01

lines[].binId

e.g. 01-ONT1

lines[].documentLine

Auto-numbered 1, 2, 3, …

Plain line qty

B1 line Quantity

Serial line qty

1 each

Batch line qty

Batch qty ÷ UnitsOfMeasurment

lines[].uomCode

From UoM rule


9. Implementation checklist for consultants

  1. Document type: ensure the published B1 document is the intended goods receipt / PDN payload for this flow.

  2. Warehouse codes: must match WMS warehouses; bin is always WarehouseCode-ONT1 — configure that bin (or accept the convention) in WMS.

  3. UoM: understand -1 fallback (m + measure unit) and batch quantity ÷ UnitsOfMeasurment.

  4. Serial items: expect one WMS line per serial with quantity 1.

  5. Batch items: expect one WMS line per batch with batch number and expiry.

  6. Reason: WMS will always see reason PDN / Ad-Hoc Purchase Delivery Note (not free text from B1 comments).

  7. Tracking: use correlation.correlationId and customFields.DocNum for support.

  8. Do not expect picking-warehouse filtering or BOM handling from this mapper.


10. Source artifacts (for reference)

Artifact

Role

mappings/goods-receipt-to-inventoryinbound.mfd

MapForce mapping definition (field logic)

mappings/inputSchema.json / inputExample.json

B1 input contract and sample

mappings/outputSchema.json

WMS inventory inbound schema

src/main/java/.../route/MainRoutes.java

Kafka in/out, endpoint InventoryInbound

src/main/java/.../mapper/Mapper.java

MapForce invoke (body + correlation id)

scenario_files/1_mainRoute/

Placeholder samples


Generated from the mapping definition and integration behavior in this project. If the MapForce mapping changes, this document should be reviewed and updated.


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.