Aiden WMS

Goods Receipt

TL;DR — Aiden WMS Goods-Receipt → SAP B1 Mapper
  • Purpose: Convert WMS goods-receipt transactions into SAP B1 documents via Service Layer based on documents[0].customFields.objectType.

  • Routing (by objectType):

    • PurchaseOrders → Purchase Delivery Note (SAP endpoint: PurchaseDeliveryNotes).

    • ProductionOrders → Production Receipt / Inventory Goods Receipt (SAP endpoint: InventoryGenEntries).

    • StockTransferRequests → Stock Transfer (SAP endpoint: StockTransfers).

    • Other objectType → Logged as unmatched; not mapped.

  • Common behavior:

    • Traceability: transaction.id → U_AEN_WMS_TRANSID on every SAP document.

    • Dates: documents[].processDate → DocDate (no truncation).

    • Base linkage: documents[].customFields.externalId → BaseEntry (parsed as number).

    • Line joining: savedLines[].documentLine matched to lines[].documentLine to rebuild base-line details.

    • Tracking: savedLines with serialNumber → SAP serial rows; with batchNumber → SAP batch rows; otherwise quantity-only line.

  • Purchase Delivery Notes (objectType=PurchaseOrders → PurchaseDeliveryNotes):

    • Header:

      • CardCode ← documents[].businessPartner.businessPartnerId.

      • DocDate ← documents[].processDate.

      • U_AEN_WMS_TRANSID ← transaction.id.

      • DocumentAdditionalExpenses[] copied field-for-field (ExpenseCode, LineNum, LineTotal, DistributionMethod, VatGroup).

    • Lines:

      • BaseEntry ← documents[].customFields.externalId; BaseLine ← lines[].customFields.lineNum (or matched group); BaseType = 22.

      • Quantity = sum of savedLines.quantity per source line/tracking group.

      • Serials: InternalSerialNumber from savedLines.serialNumber; Quantity per serial row.

      • Batches: BatchNumber, ExpiryDate from savedLines; Quantity uses savedLines.baseQuantity.

  • Production Receipts (objectType=ProductionOrders → InventoryGenEntries):

    • Header: DocDate ← documents[].processDate; U_AEN_WMS_TRANSID ← transaction.id.

    • Lines:

      • BaseEntry ← documents[].customFields.externalId; BaseType = 202; grouped by documentLine.

      • Quantity = sum of savedLines.quantity per source line/tracking group.

      • Serials: InternalSerialNumber with per-row Quantity.

      • Batches: BatchNumber, ExpiryDate; batch Quantity uses savedLines.baseQuantity.

  • Stock Transfers (objectType=StockTransferRequests → StockTransfers):

    • Prereq: Warehouse master refreshed hourly (WarehouseCode, DefaultBin, EnableBinLocations) to drive bin allocation.

    • Header: U_AEN_WMS_TRANSID ← transaction.id.

    • Lines & bins:

      • BaseEntry ← documents[].customFields.externalId; BaseLine from matching WMS doc line; BaseType = 1250000001.

      • Quantity = sum of savedLines.quantity per source line/tracking group.

      • Serials: InternalSerialNumber from savedLines.serialNumber (and/or lines[].customFields.serialNumbers[].serialNumber).

      • Batches: BatchNumber; batch Quantity from savedLines.baseQuantity (no expiry on this map).

      • Bin allocations: if EnableBinLocations = tYES for the target WarehouseCode → BinAbsEntry = DefaultBin; Quantity follows mapped line qty.

  • What implementers can expect:

    • Supported WMS receipts become SAP B1 documents with preserved transaction id, base document links (externalId/BaseEntry + line numbers), and tracking (serial/batch/expiry/baseQuantity).

    • Stock transfer bin allocations require accurate SAP warehouse config; without bin-enabled warehouses and DefaultBin, default bin cannot be derived.

This integration receives Aiden WMS goods-receipt transactions and turns them into SAP Business One service-layer requests. The first document in the incoming message decides the business scenario through documents[0].customFields.objectType.

Input objectType

Mapper result

SAP endpoint

PurchaseOrders

Purchase delivery note

PurchaseDeliveryNotes

ProductionOrders

Production receipt / inventory goods receipt

InventoryGenEntries

StockTransferRequests

Stock transfer

StockTransfers

Messages with another objectType are logged as unmatched and are not mapped to an SAP endpoint.

The checked-in output_*.json files are examples of the target shape, but the generated MapForce Java under mappings/output/com/mapforce/ is the source of truth for the current logic.

Common Behavior

The mapper uses the WMS transaction id as traceability on the SAP document:

Input field

Output field

In-between behavior

transaction.id

U_AEN_WMS_TRANSID

Copied as text to the SAP user-defined field.

documents[].processDate

DocDate

Copied as provided by WMS. No date truncation is performed by the mapper.

documents[].customFields.externalId

BaseEntry

Parsed as a number and used as the base SAP document entry.

savedLines[].documentLine matched to lines[].documentLine

SAP base line fields

The mapper joins saved receipt quantities back to their original WMS document line.

For serial and batch handling, the mapper reads savedLines. A saved line with a serial number becomes serial-number detail. A saved line with a batch number becomes batch-number detail. Lines without serial or batch data are mapped as normal quantity lines.

Purchase Delivery Notes

Purchase receipts are created when the WMS document has objectType = "PurchaseOrders". The result is posted to PurchaseDeliveryNotes.

WMS input

SAP output

Business rule

documents[].businessPartner.businessPartnerId

CardCode

The vendor/customer code from WMS becomes the SAP business partner code.

documents[].processDate

DocDate

Receipt processing date is used as the SAP document date.

transaction.id

U_AEN_WMS_TRANSID

Keeps the SAP document traceable to the WMS transaction.

documents[].customFields.DocumentAdditionalExpenses[]

DocumentAdditionalExpenses[]

Document-level additional expenses are copied to the SAP document.

Additional expenses are mapped field-for-field:

WMS input

SAP output

ExpenseCode

ExpenseCode

LineNum

LineNum

LineTotal

LineTotal

DistributionMethod

DistributionMethod

VatGroup

VatGroup

Lines

WMS input

SAP output

Business rule

documents[].customFields.externalId

DocumentLines[].BaseEntry

Links the delivery note line to the original SAP purchase order.

lines[].customFields.lineNum or matching document line group

DocumentLines[].BaseLine

Identifies the source purchase-order line.

objectType = "PurchaseOrders"

DocumentLines[].BaseType = 22

The mapper converts the WMS object type to the SAP purchase order base type.

Matching savedLines[].quantity

DocumentLines[].Quantity

Quantities are summed per source line and tracking group.

savedLines[].serialNumber

DocumentLines[].SerialNumbers[].InternalSerialNumber

Non-empty serial numbers create SAP serial-number rows.

Serial saved-line quantity

DocumentLines[].SerialNumbers[].Quantity

Quantity is copied for each serial entry.

savedLines[].batchNumber

DocumentLines[].BatchNumbers[].BatchNumber

Non-empty batch numbers create SAP batch-number rows.

savedLines[].expiryDate

DocumentLines[].BatchNumbers[].ExpiryDate

Expiry date is copied when provided.

savedLines[].baseQuantity

DocumentLines[].BatchNumbers[].Quantity

Batch quantity uses base quantity, not display quantity.

Production Receipts

Production receipts are created when the WMS document has objectType = "ProductionOrders". The result is posted to InventoryGenEntries.

Header

WMS input

SAP output

Business rule

documents[].processDate

DocDate

The WMS processing timestamp becomes the SAP document date value.

transaction.id

U_AEN_WMS_TRANSID

Keeps the receipt traceable to the WMS transaction.

Lines

WMS input

SAP output

Business rule

documents[].customFields.externalId

DocumentLines[].BaseEntry

Links the goods receipt to the original SAP production order.

WMS line grouping

SAP base line handling

The mapper groups saved receipt lines by documentLine.

objectType = "ProductionOrders"

DocumentLines[].BaseType = 202

The mapper converts the WMS object type to the SAP production order base type.

Matching savedLines[].quantity

DocumentLines[].Quantity

Quantities are summed per source line and tracking group.

savedLines[].serialNumber

DocumentLines[].SerialNumbers[].InternalSerialNumber

Non-empty serial numbers create serial-number rows.

Serial saved-line quantity

DocumentLines[].SerialNumbers[].Quantity

Quantity is copied for each serial entry.

savedLines[].batchNumber

DocumentLines[].BatchNumbers[].BatchNumber

Non-empty batch numbers create batch-number rows.

savedLines[].expiryDate

DocumentLines[].BatchNumbers[].ExpiryDate

Expiry date is copied when provided.

savedLines[].baseQuantity

DocumentLines[].BatchNumbers[].Quantity

Batch quantity uses base quantity, not display quantity.

Stock Transfers

Stock transfers are created when the WMS document has objectType = "StockTransferRequests". The result is posted to StockTransfers.

Before stock-transfer mapping runs, the integration refreshes SAP warehouse configuration hourly from:

Warehouses?$select=WarehouseCode,DefaultBin,EnableBinLocations

That warehouse list is passed into the MapForce mapper so it can allocate lines to the correct SAP bin.

Header

WMS input

SAP output

Business rule

transaction.id

U_AEN_WMS_TRANSID

Keeps the stock transfer traceable to the WMS transaction.

Lines And Bins

WMS input

SAP output

Business rule

documents[].customFields.externalId

StockTransferLines[].BaseEntry

Links the transfer to the source SAP stock-transfer request.

Matching WMS document line

StockTransferLines[].BaseLine

Keeps each transfer line tied to its source request line.

objectType = "StockTransferRequests"

StockTransferLines[].BaseType = 1250000001

The mapper converts the WMS object type to the SAP stock-transfer-request base type.

Matching savedLines[].quantity

StockTransferLines[].Quantity

Quantities are summed per source line and tracking group.

savedLines[].serialNumber or lines[].customFields.serialNumbers[].serialNumber

StockTransferLines[].SerialNumbers[].InternalSerialNumber

Serial-managed items create SAP serial-number rows. Some serial rows use quantity 1 per serial number.

SAP warehouse list where EnableBinLocations = "tYES" and WarehouseCode matches WMS warehouseId

StockTransferLinesBinAllocations[].BinAbsEntry

The mapper uses the matching warehouse DefaultBin.

Mapped line quantity

StockTransferLinesBinAllocations[].Quantity

Bin allocation quantity follows the mapped transfer-line quantity.

What Implementers Can Expect

After installation, supported WMS goods receipts automatically become SAP Business One documents for purchase orders, production orders, or stock-transfer requests. The mapper preserves the WMS transaction id on every SAP document, links lines back to SAP base documents through externalId and line numbers, and carries serial, batch, expiry, and base quantity information where present.

For stock transfers, correct bin output depends on SAP warehouse configuration being available to the integration. If a warehouse is not bin-enabled or no matching WarehouseCode is returned, the mapper cannot derive the default bin allocation for that warehouse.