Aiden WMS

Stock Transfer (ad-hoc only)

TL;DR — Aiden WMS Stock Transfer Mapper (Inbound)
  • Purpose: Turn completed WMS stock transfers (get + put) into SAP B1 StockTransfers, with serial validation and optional bin allocations. Same-warehouse moves are ignored.

  • Flow & Results:

    • If get warehouse ≠ put warehouse → build and POST B1 Stock Transfer.

    • If get warehouse = put warehouse → skip (typically bin-to-bin within same WH).

    • Serial on put line must exist in B1 or be patched into an empty slot; otherwise the whole message errors.

  • Inputs used:

    • WMS message: transaction.id, documents[] with getLines[] and putLines[] (matched by documentLine), including itemId, warehouseId, binId, baseQuantity, batch/serial.

    • Warehouse master (hourly): WarehouseCode, EnableBinLocations, DefaultBin (drives bin allocations).

    • Serial pre-check (per message): For each non-empty put serial, validate in B1 or patch into an empty serial slot; fail fast if none available.

  • Key mapping rules:

    • Quantity: B1 line Quantity = putLines.baseQuantity (inventory/base units).

    • Warehouses per line: FromWarehouseCode = getLines.warehouseId; WarehouseCode = putLines.warehouseId.

    • Serials (from put lines): SerialNumbers[].InternalSerialNumber = serialNumber; Quantity = put baseQuantity; ItemCode = itemId.

    • Batches (from put lines): BatchNumbers[].BatchNumber = batchNumber; Quantity = put baseQuantity; ItemCode = itemId.

    • Bin allocations (when enabled):

      • Condition: EnableBinLocations = tYES and DefaultBin present for the involved warehouse.

      • StockTransferLinesBinAllocations: BinAbsEntry = DefaultBin; Quantity = put baseQuantity; BinActionType = batFromWarehouse/batToWarehouse.

    • Posting: Output is an array with StockTransferLines; POST to B1 StockTransfers.

  • Behavioral filters:

    • Same-warehouse transfers produce no lines → message ignored (expected for intra-warehouse bin moves).

    • Empty serials skip B1 serial lookup; any serial failure stops processing.

  • Traceability:

    • Use Kafka key and transaction.id for tracking; the mapper posts to B1 only when from/to differ.

  • Not covered / caveats:

    • WMS binId (string) is not mapped directly to B1 BinAbsEntry (uses warehouse DefaultBin).

    • No BP, prices, or costing mapped.

    • Ensure get/put documentLine pairing is correct to align items and warehouses.

  • Implementer checklist:

    • Use cross-warehouse transfers when you need a B1 Stock Transfer; intra-warehouse moves won’t post.

    • Maintain serial masters or empty slots in B1 for serialized put lines.

    • Configure bin-managed warehouses (EnableBinLocations + DefaultBin) if you need bin allocations on the transfer.

    • Prefer accurate put baseQuantity; align get/put lines by documentLine.

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:

  1. Validates serials in B1 (if present on put lines)

  2. Maps get/put lines into a B1 stock transfer

  3. Optionally adds bin allocations when warehouses use bin locations

  4. 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:

  1. GetItemAndSerial mapping builds a list from put lines: documentId, documentLine, ItemCode, SerialNumber

  2. For each row with a non-empty serial:

    • GET B1 SerialNumberDetails for that item + serial

    • If not found: GET an empty serial slot (SerialNumber and MfrSerialNo null) 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 warehouseId

Put warehouseId

Result

Different

Different

Transfer line(s) produced → B1 POST

Same

Same

No lines → mapped body [] → message ignored

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

FromWarehouseCode

Get line warehouseId

WarehouseCode (destination)

Put line warehouseId

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

SerialNumbers[].InternalSerialNumber

putLines.serialNumber

After serial pre-check

SerialNumbers[].Quantity

putLines.baseQuantity

As mapped

SerialNumbers[].ItemCode

putLines.itemId


BatchNumbers[].BatchNumber

putLines.batchNumber

When present

BatchNumbers[].Quantity

putLines.baseQuantity


BatchNumbers[].ItemCode

putLines.itemId


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

BinAbsEntry

Warehouse DefaultBin

Quantity

Put baseQuantity (for that line context)

BinActionType

batFromWarehouse (from side) and/or batToWarehouse (to side)

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:

  1. Runs an intermediate mapping (WMS + warehouses → intermediate stock transfer structure)

  2. 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

documentId

documents.documentId


documentLine

putLines.documentLine


ItemCode

putLines.itemId


SerialNumber

putLines.serialNumber

Drives B1 serial check

4.2 Stock transfer lines (when from ≠ to)

B1 target field

WMS / source input

What happens

Notes

StockTransferLines[].ItemCode

Put itemId

Direct (after join/filter)

Matched to get by documentLine

StockTransferLines[].Quantity

Put baseQuantity

Direct

Base units

StockTransferLines[].FromWarehouseCode

Get warehouseId

Direct

Only if ≠ put WH

StockTransferLines[].WarehouseCode

Put warehouseId

Direct

Destination WH

SerialNumbers[]

Put serialNumber (+ item/qty)

When serial filled

After serial pre-check

BatchNumbers[]

Put batchNumber (+ item/qty)

When batch filled


StockTransferLinesBinAllocations[]

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

EnableBinLocations = tYES

From bin action

batFromWarehouse

To bin action

batToWarehouse

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 binId string

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

transaction.id

ST20251007002

Get line

WH 05, item A00005, baseQuantity 100, bin 05-RCV-S2

Put line

WH 01, item A00005, baseQuantity 100, serial 123456, bin 01-AA

B1 output (excerpt from 99_target.json)

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

  1. User completes a stock transfer in WMS (pick from WH A, put to WH B).

  2. WMS publishes get/put confirmation.

  3. Integration registers put-line serials in B1 if needed.

  4. If WH A ≠ WH B, mapper builds B1 Stock Transfer (qty, serials/batches, optional bins).

  5. Document is POSTed to B1 StockTransfers.

  6. If WH A = WH B, message is ignored (no inter-warehouse document).

  7. Trace with Kafka key and transaction.id.


9. Implementation checklist for consultants

  1. Use stock transfers across warehouses when B1 stock transfer documents are required.

  2. Same-warehouse relocation will not create a B1 stock transfer with this mapper.

  3. Maintain serial masters / empty serial slots in B1 for serialized put lines.

  4. For bin-managed warehouses, set EnableBinLocations and DefaultBin correctly if bin allocations on the B1 transfer are required.

  5. Prefer baseQuantity accuracy (inventory units) on put lines.

  6. Align get/put documentLine pairing so from/to warehouses and items match.

  7. Monitor ignored messages for unexpected same-warehouse traffic.


10. Source artifacts

Artifact

Role

mappings/StockTransfer/StockTransfer.mfd

Main stock transfer MapForce (intermediate + output)

mappings/GetItemAndSerial/get-item-and-serial.mfd

Put-line item/serial extract

mappings/StockTransfer/input.stocktransfer.schema.json

WMS input contract

mappings/StockTransfer/output.stocktransfer.schema.json

B1 output contract

mappings/StockTransfer/intermediate.warehouses.schema.json

Warehouse master

src/.../route/MainRoutes.java

Kafka flow, ignore empty body, StockTransfers POST

src/.../route/SAPB1Routes.java

Serial GET/PATCH

src/.../route/ConfigurationRoute.java

Hourly warehouse load

src/.../mapper/Mapper.java

Two-step MapForce run

src/.../mapper/GetItemAndSerialMapper.java

Serial extract runner

scenario_files/1_Stocktransfer_-_different_warehouse/

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.