Aiden WMS

Stock Transfer to WMS managed warehouse

TL;DR — Aiden WMS Stock Transfer External Mapper (Outbound)
  • Purpose: Turn a SAP B1 stock transfer/stock transfer request into a WMS IncomingDocument so an external warehouse can receive the goods. Base type is TransferRequest.

  • Flow & Correlation: B1 stock transfer doc on Kafka → mapper builds WMS IncomingDocument with baseType=TransferRequest → publishes to WMS → correlation.correlationId is set from the Kafka message key for tracing.

  • Inputs:

    • Header: DocNum/DocEntry, DueDate, DocumentStatus, DocObjectCode, FromWarehouse, ToWarehouse.

    • Lines: LineNum, ItemCode, Quantity, WarehouseCode (to), FromWarehouseCode (from), LineStatus, UoMEntry/UoMCode/MeasureUnit, optional dynamic name/value properties.

    • Optional config: line.detail.fieldname property to map a chosen line dynamic property into lines[].details.

  • Business partner (BP): Represents the sender (from-warehouse).

    • businessPartnerId = first line’s FromWarehouseCode.

    • name = "From Warehouse " + that code.

  • Line warehouse (destination):

    • lines[].warehouseId = line WarehouseCode (to-warehouse), i.e., where WMS should receive.

  • Statuses:

    • Header: data.status = DocumentStatus without “bost_”; “Close” normalized to “Closed”.

    • Lines: lines[].status = LineStatus without “bost_”; “Close” → “Closed”.

  • Object type mapping (customFields.objectType):

    • DocObjectCode = 1250000001 → StockTransferRequests.

    • DocObjectCode = oPurchaseOrders → PurchaseOrders.

    • Anything else → Unknown Type.

  • UoM per line (uomCode):

    • If UoMEntry != -1 → use UoMCode.

    • If UoMEntry = -1 → use "m" + MeasureUnit; if MeasureUnit missing → "m".

  • Dates & quantity:

    • data.receiveDate = DueDate; lines[].receiveDate = same DueDate.

    • lines[].quantity = line Quantity.

  • Header mappings & IDs:

    • data.documentId = DocNum.

    • customFields.externalId = DocEntry.

    • data.baseType = TransferRequest.

    • data.owner is not mapped (null in samples).

  • Line mappings:

    • documentLine and customFields.lineNum = LineNum.

    • itemId = ItemCode.

    • details = dynamic property value when its name equals line.detail.fieldname; otherwise empty.

  • Not covered / caveats: CardCode/CardName are not used for BP; prices/currency/discounts not mapped; no serial/batch expansions or bin allocations; header From/To are overridden by line-level From/To for BP and warehouseId; expenses not populated by this simple mapping; line details require correct config and matching property on the line.

  • E2E expectation: B1 creates/updates STR → message on Kafka → mapper builds IncomingDocument (TransferRequest, BP = from-warehouse, lines to the destination warehouse) → publish to WMS → trace using correlation id, DocNum, and externalId (DocEntry).

  • Consultant checklist:

    • Ensure DocObjectCode uses the expected values (e.g., 1250000001 for StockTransferRequests).

    • Remember BP = FromWarehouse, and line warehouseId = ToWarehouse.

    • Maintain UoM entries; understand -1/manual fallback ("m" + MeasureUnit).

    • Configure line.detail.fieldname if WMS operators need line remarks/details.

    • Align external warehouse flows to baseType = TransferRequest and trace with correlation id + DocEntry/DocNum.

Functional documentation for the Aiden WMS stock transfer external mapper (outbound).

This document describes what happens after the mapper is installed: how a SAP Business One (B1) stock transfer / stock transfer request becomes a WMS IncomingDocument for external warehouse receiving, which fields are mapped, and which business rules apply. It is intended for end-users and functional consultants.


1. Overview



Source

SAP B1 stock transfer document (e.g. Stock Transfer Request) on Kafka

Target

Aiden WMS Incoming document (IncomingDocument)

Purpose

Create a WMS receipt / transfer-request document so an external warehouse can receive the goods

After installation, when a relevant B1 stock transfer document is published, the mapper produces a WMS document with:

  • Document identity and base type TransferRequest

  • A synthetic “business partner” representing the from warehouse

  • Receive date from the B1 due date

  • Lines for items to receive at the to warehouse

  • Status and object-type translations

  • Correlation id for tracking

Fixed business defaults

WMS field

Fixed value

Meaning

data.baseType

TransferRequest

WMS treats this as a transfer request / inbound expectation


2. What the mapper uses as input

2.1 Main payload — B1 stock transfer document

Typical B1 fields used:

  • Header: DocNum, DocEntry, DueDate, DocumentStatus, DocObjectCode, FromWarehouse, ToWarehouse, …

  • Lines StockTransferLines[]:

    • LineNum, ItemCode, Quantity

    • WarehouseCode (to warehouse on the line)

    • FromWarehouseCode (from warehouse on the line)

    • LineStatus, UoMEntry, UoMCode, MeasureUnit

    • Optional dynamic line properties (name/value) for configurable line details

DocNum is also used as the integration external application id for monitoring.

2.2 Correlation id

Integration message key → correlation.correlationId.

2.3 Optional line detail configuration

Java property:

  • line.detail.fieldname (default NOT_SET if not configured)

When a stock transfer line carries a dynamic property whose name equals this configured value, that property’s value is written to WMS lines[].details.

If the property is not present or the config does not match, line details are not filled from that mechanism.

No separate warehouse timer or item enrichment runs in this project.


3. Business behavior

3.1 Business partner = from warehouse (important)

Unlike a purchase order mapper, the WMS business partner is not taken from CardCode / CardName for the main BP fields used here.

WMS field

Rule

data.businessPartner.businessPartnerId

First stock transfer line’s FromWarehouseCode

data.businessPartner.name

Literal prefix From Warehouse + that same first FromWarehouseCode

Example: first line FromWarehouseCode = 01 → BP id 01, name From Warehouse 01.

This presents the sending warehouse as the “partner” on the WMS incoming document for external receiving.

3.2 Line warehouse = destination (to)

WMS lines[].warehouseId comes from the line WarehouseCode (to warehouse), i.e. where goods should be received in the destination context—not the from warehouse.

3.3 Document and line status

B1 statuses look like bost_Open / bost_Close.

Level

B1 field

Transformation

WMS field

Header

DocumentStatus

Strip bost_, then CloseClosed

data.status

Line

LineStatus

Strip bost_, then CloseClosed

lines[].status

B1 value

WMS status

bost_Open

Open

bost_Close

Closed

3.4 Object type

customFields.objectType is derived from B1 DocObjectCode:

B1 DocObjectCode

WMS objectType

oPurchaseOrders

PurchaseOrders

1250000001

StockTransferRequests

Anything else

Unknown Type (default)

Stock transfer requests in B1 commonly use object code 1250000001 → WMS StockTransferRequests.

3.5 Unit of measure (uomCode)

For each line:

  1. If UoMEntry is not -1 → use UoMCode

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

    • Missing MeasureUnit is substituted with empty → result can be just m

Sample data often has UoMEntry = -1, UoMCode = Handmatig, MeasureUnit = null → WMS uomCodem.

3.6 Dates

WMS field

B1 source

data.receiveDate

DueDate

lines[].receiveDate

Same header DueDate

3.7 Quantity

WMS line quantity ← B1 line Quantity (as on the stock transfer line).


4. Field mapping tables

Columns: WMS output field | B1 / source input | What happens | Notes

4.1 Correlation

WMS output field

B1 / source input

What happens

Notes

correlation.correlationId

Integration message key

Direct

Tracing

4.2 Document header (data)

WMS output field

B1 / source input

What happens

Notes

data.documentId

DocNum

Direct


data.baseType

Constant TransferRequest

Always

data.receiveDate

DueDate

Direct


data.status

DocumentStatus

Strip bost_ + CloseClosed


data.customFields.externalId

DocEntry

Direct

Internal B1 key

data.customFields.objectType

DocObjectCode

Valuemap — see §3.4


data.owner

Not mapped / null in samples


4.3 Business partner (from warehouse)

WMS output field

B1 / source input

What happens

Notes

data.businessPartner.businessPartnerId

First line FromWarehouseCode

first-items

Not CardCode

data.businessPartner.name

From Warehouse + first FromWarehouseCode

Concat + first-items

Synthetic name

CardCode / CardName on B1 header

Not used for these BP fields

Still present on B1 payload

4.4 Lines (data.lines[])

WMS output field

B1 / source input

What happens

Notes

lines[].documentLine

StockTransferLines.LineNum

Direct


lines[].customFields.lineNum

StockTransferLines.LineNum

Direct


lines[].warehouseId

StockTransferLines.WarehouseCode

Direct

To warehouse

lines[].itemId

StockTransferLines.ItemCode

Direct


lines[].quantity

StockTransferLines.Quantity

Direct


lines[].uomCode

UoMEntry, UoMCode, MeasureUnit

Conditional — see §3.5


lines[].status

StockTransferLines.LineStatus

Strip bost_ + CloseClosed


lines[].receiveDate

Header DueDate

Direct

Same for all lines

lines[].details

Line dynamic property matching line.detail.fieldname

If-else / equal on property name

Optional; config-driven


5. Value translations (reference)

5.1 Status

B1

WMS

bost_Open

Open

bost_Close

Closed

5.2 Doc object code → objectType

B1 DocObjectCode

WMS customFields.objectType

oPurchaseOrders

PurchaseOrders

1250000001

StockTransferRequests

Other

Unknown Type

5.3 Constants

Constant

Usage

TransferRequest

data.baseType

From Warehouse

BP name prefix

m / -1

UoM fallback building blocks

bost_

Status prefix stripped


6. What is not mapped / caveats

Topic

Behavior

B1 CardCode / CardName as WMS BP

Not used; from-warehouse is used instead

Prices, currency, discounts

Not mapped

Serial/batch arrays on B1 lines

Not expanded into WMS line batch/serial structures in this MFD

Bin allocations

Not mapped to WMS lines here

Header FromWarehouse / ToWarehouse

Line-level From/To codes drive BP and warehouseId

Expenses

Output schema allows expense custom fields; not traced as populated from this MFD’s simple line set

Line details without config

Require correct line.detail.fieldname and matching line property


7. Example (from mapping sample input)

B1 input (excerpt)

Field

Example

DocNum / DocEntry

1

DueDate

2020-08-04T00:00:00Z

DocumentStatus

bost_Close

DocObjectCode

1250000001

Line 0

Item A00001, qty 1, FromWarehouseCode 01, WarehouseCode 02, UoMEntry -1, LineStatus bost_Close

Line 1

Item A00002, qty 2, from 01, to 02, same UoM/status pattern

Expected WMS shape (from mapping rules)

WMS field

Expected

data.documentId

1

data.baseType

TransferRequest

data.businessPartner.businessPartnerId

01

data.businessPartner.name

From Warehouse 01

data.receiveDate

2020-08-04T00:00:00Z

data.status

Closed

customFields.externalId

1

customFields.objectType

StockTransferRequests

Line warehouses

02 (to)

Line items / qty

A00001/1, A00002/2

Line status

Closed

Line uomCode

m (manual UoM / empty measure)

Published with endpoint header IncomingDocument.


8. End-to-end expectation

  1. B1 creates/updates a stock transfer request (or related document) for an external warehouse flow.

  2. Document is published to Kafka.

  3. Mapper builds a WMS IncomingDocument: transfer-request base type, from-warehouse as BP, to-warehouse on lines.

  4. Message is sent to WMS for receiving.

  5. Trace with correlation id, DocNum, and customFields.externalId (DocEntry).


9. Implementation checklist for consultants

  1. Confirm B1 documents use the expected DocObjectCode (e.g. 1250000001 for STR → StockTransferRequests).

  2. Understand WMS BP is the from warehouse, not the B1 card.

  3. Understand WMS line warehouse is the to warehouse.

  4. Maintain UoM entries; know the -1 / manual fallback (m + measure unit).

  5. If line remarks/details are required in WMS, configure line.detail.fieldname to the B1 line property name used in the payload.

  6. Align external warehouse processes with baseType = TransferRequest.

  7. Trace with correlation id + DocEntry/DocNum.


10. Source artifacts

Artifact

Role

mappings/stocktransfer-external-wms/stocktransfer-external-wms.mfd

MapForce mapping

mappings/aiden-wms-stocktransfer-external-wms.mfp

MapForce project

mappings/stocktransfer-external-wms/input_stocktransfer-external-wms.schema.json

B1 input contract

mappings/stocktransfer-external-wms/output_receipt_document.schema.json

WMS output contract

mappings/stocktransfer-external-wms/input_stocktransfer-external-wms.json

Sample B1 input

src/.../route/MainRoutes.java

Kafka in/out, IncomingDocument

src/.../mapper/Mapper.java

MapForce runner (correlationId, line.detail.fieldname)


Generated from the mapping definition and integration routes in this project. If the MapForce mapping or configuration properties 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.