Aiden WMS

Sales Order

TL;DR — Aiden WMS Sales Order Mapper
  • Purpose: Converts an open SAP B1 sales order into an Aiden WMS OutgoingDocument for pick/ship processing.

  • Flow: B1 sales order (JSON) → Mapper applies rules, filters, and translations → Outputs WMS OutgoingDocument with correlation id for tracking.

  • Fixed Defaults (always set):

    • baseType=SalesOrder, handling=Manual, priority=3, customFields.objectType=Orders.

  • Inputs:

    • Full B1 order: header (DocNum/DocEntry/CardCode/CardName/DueDate/Status/PartialSupply/DocObjectCode/PickRemark/NumAtCard), ship-to (AddressExtension), lines (DocumentLines), header expenses, special lines.

    • Auto-loaded: Warehouse list with U_AEN_WHS_Picking (Y/N).

    • Auto-built: Sales BOM helper (iSalesTree parents).

    • Correlation: integration message key → correlation.correlationId.

  • What Lines Are Sent:

    • Only lines whose WarehouseCode has U_AEN_WHS_Picking = Y. Others are omitted. Configure B1 warehouses accordingly.

  • Statuses:

    • Strip bost_ prefix; map Close→Closed. Applied to header (data.status) and lines (lines[].status).

  • Partial Delivery Flags:

    • PartialSupply → data.partialDelivery; BackOrder → lines[].partialDelivery; tYES/tNO → true/false.

  • Object Type:

    • DocObjectCode valued-mapped, e.g., oOrders→Orders (typical for sales order).

  • Line UoM (uomCode):

    • If UoMEntry != -1 → use UoMCode. If -1 → use "m" + MeasureUnit (MeasureUnit missing → just "m"). Also copy UoMEntry to lines[].customFields.UoMEntry.

  • Ship-to Address:

    • Uses AddressExtension Ship-to only. street/addressId = ShipToStreet + optional space + ShipToStreetNo; city/zip/county/country direct from ShipTo*.

  • Sales BOM (lines[].salesBom):

    • Present only for TreeType in {iSalesTree, iIngredient}.

    • Parents (iSalesTree): parent=true, respectSingleQuantity=true, parentLine=1+max(parent VisualOrder < current), singleQuantity = line Quantity ÷ last matching parent qty.

    • Non-BOM lines: no salesBom block.

  • Customer Reference (NumAtCard):

    • If present, sent as a dynamic property named NumAtCard.

  • Additional Expenses:

    • Header → data.customFields.DocumentAdditionalExpenses[].

    • Line → lines[].customFields.DocumentAdditionalExpenses[].

    • Copies: ExpenseCode, LineTotal, GroupCode, DistributionMethod, VatGroup, LineNum/LineNumber.

  • Special Lines (Text):

    • Only dslt_Text and only when AfterLineNumber matches the line’s VisualOrder. Mapped to data.customFields.DocumentSpecialLines[] with amounts/texts.

  • Not Mapped / Omissions:

    • Bill-to address; prices/VAT/discounts/currency in core fields; data.owner; lines[].totalQuantity; non-picking warehouses; non-text special lines; production-tree BOM not treated as sales BOM; no extra closed-line filtering beyond status mapping; no BP enrichment beyond CardCode/CardName.

  • End-to-End Expectation:

    • B1 order published → warehouses loaded → mapper outputs WMS order: header + BP + ship-to + filtered lines + rules (status/partial/UoM/BOM) → track with correlation.correlationId and customFields.externalId (DocEntry).

  • Consultant Checklist:

    • Set U_AEN_WHS_Picking=Y on all picking warehouses.

    • Maintain Ship-to (AddressExtension) on orders.

    • Understand UoM fallback for UoMEntry=-1 (m + MeasureUnit).

    • For BOM in WMS, use iSalesTree/iIngredient and consistent VisualOrder.

    • For text annotations, use dslt_Text with AfterLineNumber matching the target line’s VisualOrder.

    • Expect defaults: handling=Manual, priority=3, baseType=SalesOrder on every document.

Functional documentation for the Aiden WMS sales order mapper.

This document describes what happens after the mapper is installed: which SAP Business One (B1) sales order 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 sales order (Service Layer document JSON)

Target

Aiden WMS outgoing order document (OutgoingDocument)

Purpose

Convert an open B1 sales order into a WMS pick/ship order document

After installation, when a sales order is published to the integration, the mapper produces a WMS document that contains:

  • Document identity and type

  • Customer (business partner)

  • Ship-to address

  • Order lines for picking-enabled warehouses only

  • Optional sales BOM structure on BOM-related lines

  • Optional freight/expenses and text special lines

  • Correlation id for tracking

Fixed business defaults

These values are always set by the mapper (not taken from B1):

WMS field

Fixed value

Meaning for WMS

data.baseType

SalesOrder

Document originates from a sales order

data.handling

Manual

Manual handling mode in WMS

data.priority

3

Default priority

data.customFields.objectType

Orders

Custom object type label


2. What the mapper uses as input

2.1 Main payload — B1 sales order

The primary input is the full B1 sales order document, including for example:

  • Header: DocNum, DocEntry, CardCode, CardName, DocDueDate, DocumentStatus, PartialSupply, DocObjectCode, PickRemark, NumAtCard

  • Ship-to address: AddressExtension.ShipTo*

  • Lines: DocumentLines[]

  • Header additional expenses: DocumentAdditionalExpenses[]

  • Special lines: DocumentSpecialLines[]

2.2 Warehouse list (automatic)

The integration periodically loads warehouses from B1:

  • WarehouseCode

  • U_AEN_WHS_Picking (Y / N)

  • (also retrieved but not used in field mapping: EnableBinLocations, DefaultBin)

Business impact: only order lines whose warehouse is marked as picking-enabled (U_AEN_WHS_Picking = Y) are sent to WMS.

2.3 Sales BOM helper data (automatic)

From the same sales order, the integration builds a helper list of lines where:

  • TreeType = iSalesTree (sales BOM parent lines)

That list is used only to calculate sales BOM parent/child quantities and parent line references on the WMS lines. Consultants do not need to supply this separately.

2.4 Correlation id

The message correlation id (integration message key) is written to:

  • correlation.correlationId

Use this to trace a WMS document back to the integration message.


3. Business behavior

3.1 Which lines are sent to WMS?

A B1 order line is included in data.lines only when its WarehouseCode matches a warehouse with U_AEN_WHS_Picking = Y.

Lines for warehouses with U_AEN_WHS_Picking = N (or unknown warehouse) are not sent to WMS.

Configure picking warehouses correctly in B1 (U_AEN_WHS_Picking) before go-live. Otherwise orders may arrive in WMS with missing lines.

3.2 Document and line status

B1 statuses look like bost_Open / bost_Close.

The mapper:

  1. Removes the bost_ prefix → Open / Close

  2. Translates CloseClosed (other values stay as-is, e.g. Open)

Applied to:

  • Header: DocumentStatusdata.status

  • Line: LineStatuslines[].status

B1 value

WMS value

bost_Open

Open

bost_Close

Closed

3.3 Partial delivery flags

B1 tYES / tNO flags are converted to booleans:

B1 field

WMS field

Translation

PartialSupply

data.partialDelivery

tYEStrue, tNOfalse

Line BackOrder

lines[].partialDelivery

tYEStrue, tNOfalse

3.4 Object type

B1 DocObjectCode

WMS data.objectType

oOrders

Orders

oDeliveryNotes

DeliveryNotes

oStockTransferRequests

StockTransferRequests

oPurchaseOrders

PurchaseOrders

For a normal sales order this is Orders.

3.5 Unit of measure on lines (uomCode)

For each line:

  1. If UoMEntry is not -1 → use UoMCode

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

    • If MeasureUnit is missing, an empty string is used after m (result can be just m)

UoMEntry is also copied unchanged to lines[].customFields.UoMEntry.

3.6 Ship-to address

Address is taken from ship-to fields on the sales order (AddressExtension), not bill-to.

WMS address field

Source

street

ShipToStreet + space + ShipToStreetNo (street no. omitted when null)

addressId

Same concatenated street value as street

city

ShipToCity

zipCode

ShipToZipCode

county

ShipToCounty

country

ShipToCountry

3.7 Sales BOM structure (lines[].salesBom)

B1 tree types used:

TreeType

Meaning in this mapper

iSalesTree

Sales BOM parent

iIngredient

Sales BOM ingredient/child

Other (e.g. iProductionTree, empty)

Not treated as sales BOM

When is salesBom present on a line?

  • Only if the line is a sales BOM parent or ingredient (iSalesTree or iIngredient).

  • Otherwise the salesBom object is omitted.

Fields:

WMS field

Rule

salesBom.parent

true when TreeType = iSalesTree, else false (for BOM-relevant lines)

salesBom.respectSingleQuantity

true when TreeType = iSalesTree; for other BOM-relevant cases the false branch is empty in the mapping (effectively only set meaningfully on parents)

salesBom.parentLine

For sales-tree parents: 1 + highest BOM parent VisualOrder that is still less than this line’s VisualOrder (from the sales-tree helper list). Used to point children/related structure to the parent visual order context

salesBom.singleQuantity

For sales-tree parents: line Quantity divided by the last matching BOM parent quantity among helper lines with VisualOrder less than this line’s VisualOrder. Represents component quantity per single parent kit

Practical expectation for consultants:

  • Sales BOM parents and ingredients are flagged in WMS via salesBom.

  • Parent kit lines get parent = true and respectSingleQuantity = true.

  • Quantity/parent-line calculations depend on VisualOrder ordering of sales-tree lines on the B1 document.

  • Non-BOM lines (normal items, production tree, etc.) do not get a salesBom block.

3.8 Customer reference (NumAtCard)

If filled in B1, NumAtCard is sent as a dynamic custom property:

  • Property name: NumAtCard

  • Property value: the B1 NumAtCard value

(Output schema path: dynamic property / property.name.)

3.9 Additional expenses

  • Header DocumentAdditionalExpensesdata.customFields.DocumentAdditionalExpenses[]

  • Line DocumentLineAdditionalExpenseslines[].customFields.DocumentAdditionalExpenses[]

Copied fields: ExpenseCode, LineTotal, GroupCode, DistributionMethod, VatGroup, and line number (LineNum / LineNumber).

3.10 Special lines (text lines)

B1 DocumentSpecialLines are not all copied blindly.

A special line is sent to WMS only when both are true:

  1. LineType = dslt_Text (text line only — comment in mapping: “Alleen tekst regels”)

  2. AfterLineNumber equals the current order line’s VisualOrder (text is attached in context of that visual order / line position)

Mapped into data.customFields.DocumentSpecialLines[] with amounts/texts copied from B1 (order number, line type, subtotals, freights, tax, gross totals, line text, etc.).


4. Field mapping tables

Legend:

  • WMS output field — path in the Aiden WMS order document

  • B1 / source input — field on the sales order 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 copy

Used for end-to-end tracing

4.2 Document header (data)

WMS output field

B1 / source input

What happens

Notes

data.documentId

DocNum

Direct

WMS document number from B1 doc num

data.baseType

Constant SalesOrder

Always

data.pickDate

DocDueDate

Direct

Due date becomes pick date

data.handling

Constant Manual

Always

data.priority

Constant 3

Always

data.status

DocumentStatus

Strip bost_ + CloseClosed

See §3.2

data.objectType

DocObjectCode

Value map

See §3.4

data.partialDelivery

PartialSupply

tYES/tNO → boolean


data.details

PickRemark

Direct


data.owner

Not mapped

Remains empty/absent

data.customFields.externalId

DocEntry

Direct

Internal B1 key

data.customFields.objectType

Constant Orders

Always

Dynamic property NumAtCard

NumAtCard

Name constant + value copy

Only meaningful when filled in B1

4.3 Business partner

WMS output field

B1 / source input

What happens

Notes

data.businessPartner.businessPartnerId

CardCode

Direct


data.businessPartner.name

CardName

Direct


4.4 Address (data.address)

WMS output field

B1 / source input

What happens

Notes

data.address.addressId

ShipToStreet + ShipToStreetNo

Concatenate with space; null street no. → empty

Same value as street

data.address.street

ShipToStreet + ShipToStreetNo

Same as addressId

Ship-to only

data.address.city

ShipToCity

Direct


data.address.zipCode

ShipToZipCode

Direct


data.address.county

ShipToCounty

Direct


data.address.country

ShipToCountry

Direct


4.5 Lines (data.lines[])

Only lines for picking-enabled warehouses (§3.1).

WMS output field

B1 / source input

What happens

Notes

lines[].documentLine

DocumentLines.LineNum

Direct


lines[].warehouseId

DocumentLines.WarehouseCode

Direct

Must be picking-enabled

lines[].itemId

DocumentLines.ItemCode

Direct


lines[].quantity

DocumentLines.Quantity

Direct


lines[].totalQuantity

Not mapped

Present in schema but unused

lines[].uomCode

UoMEntry, UoMCode, MeasureUnit

Conditional — see §3.5


lines[].status

DocumentLines.LineStatus

Strip bost_ + CloseClosed


lines[].receiveDate

DocumentLines.ShipDate

Direct


lines[].partialDelivery

DocumentLines.BackOrder

tYES/tNO → boolean


lines[].details

DocumentLines.FreeText

Direct


lines[].customFields.lineNum

DocumentLines.LineNum

Direct

Duplicate of document line for custom use

lines[].customFields.UoMEntry

DocumentLines.UoMEntry

Direct


4.6 Sales BOM on lines (lines[].salesBom)

Only for TreeType in (iSalesTree, iIngredient) — see §3.7.

WMS output field

B1 / source input

What happens

Notes

salesBom (object present?)

TreeType

Present if parent or ingredient

Omitted otherwise

salesBom.parent

TreeType

true if iSalesTree, else false


salesBom.respectSingleQuantity

TreeType

true if iSalesTree


salesBom.parentLine

Line VisualOrder + sales-tree helper VisualOrder

1 + max helper visual order < current

Parents/BOM calc

salesBom.singleQuantity

Line Quantity + helper quantities / visual orders

Quantity ÷ last matching parent qty

Per-single-parent qty

4.7 Line additional expenses

WMS output field

B1 / source input

What happens

Notes

lines[].customFields.DocumentAdditionalExpenses[].ExpenseCode

Line expense ExpenseCode

Direct


...LineTotal

LineTotal

Direct


...GroupCode

GroupCode

Direct


...DistributionMethod

DistributionMethod

Direct


...VatGroup

VatGroup

Direct


...LineNum

LineNumber

Direct

B1 line expense number

4.8 Header additional expenses

WMS output field

B1 / source input

What happens

Notes

data.customFields.DocumentAdditionalExpenses[].ExpenseCode

Header ExpenseCode

Direct


...LineTotal

LineTotal

Direct


...GroupCode

GroupCode

Direct


...DistributionMethod

DistributionMethod

Direct


...VatGroup

VatGroup

Direct


...LineNum

LineNum

Direct


4.9 Special lines (data.customFields.DocumentSpecialLines[])

Filtered — see §3.10.

WMS output field

B1 / source input

What happens

Notes

Special line included?

LineType, AfterLineNumber, line VisualOrder

Only text lines tied to visual order

dslt_Text only

...OrderNumber

OrderNumber

Direct


...LineType

LineType

Direct


...LineText

LineText

Direct


...Subtotal / SubtotalFC / SubtotalSC

Same B1 fields

Direct


...TaxAmount / TaxAmountFC / TaxAmountSC

Same B1 fields

Direct


...Freight1Freight3 (+ FC/SC)

Same B1 fields

Direct


...GrossTotal / GrossTotalFC / GrossTotalSC

Same B1 fields

Direct



5. Value translations (reference)

5.1 Yes/no flags

B1

WMS

tYES

true

tNO

false

5.2 Warehouse picking flag

B1 U_AEN_WHS_Picking

Meaning in mapper

Y

Warehouse lines are sent to WMS

N

Warehouse lines are not sent to WMS

5.3 Status

After removing bost_

Final WMS status

Open

Open

Close

Closed

Other

Unchanged (passthrough)

5.4 Document object code

B1

WMS

oOrders

Orders

oDeliveryNotes

DeliveryNotes

oStockTransferRequests

StockTransferRequests

oPurchaseOrders

PurchaseOrders

5.5 Sales tree types

B1 TreeType

Mapper treatment

iSalesTree

Sales BOM parent

iIngredient

Sales BOM ingredient/child

Other

No salesBom block

5.6 Special line type filter

B1 LineType

Sent to WMS?

dslt_Text

Yes, if AfterLineNumber matches line VisualOrder

Other

No


6. What is not mapped / important omissions

Consultants should not expect the following from this mapper:

Topic

Behavior

Bill-to address

Not mapped (ship-to only)

Prices, VAT, discounts, currency

Not mapped to WMS order document core fields

Sales employee / owner

data.owner not mapped

lines[].totalQuantity

Schema field exists but is not populated

Non-picking warehouses

Lines suppressed

Non-text special lines

Suppressed

Production tree BOM (iProductionTree)

Not treated as sales BOM

Closed-line filter

No extra filter beyond status mapping; closed statuses can still map if the line’s warehouse is picking-enabled

Business partner master data beyond CardCode/CardName

Not enriched from BP GET in the MapForce mapping itself


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

  1. Sales order is created/updated in SAP B1 and published to the integration.

  2. Integration loads picking warehouse configuration from B1.

  3. Mapper converts the order to a WMS order document:

    • Header + BP + ship-to address

    • Only lines on picking warehouses

    • Status/partial-delivery/UoM/BOM rules applied

  4. WMS receives an OutgoingDocument ready for outbound warehouse processing.

  5. correlation.correlationId and customFields.externalId (DocEntry) support support/troubleshooting.


8. Example (from project scenario data)

Illustrative values based on scenario_files/1_Sales_order and mapping examples.

B1 input (excerpt)

Field

Example value

DocNum / DocEntry

711

CardCode

C70000

CardName

British Technology

DocDueDate

2025-01-01T00:00:00Z

DocumentStatus

bost_Open

PartialSupply

tYES

DocObjectCode

oOrders

Ship-to street

111 Lansbury Ave

Ship-to city

Hounslow, Greater London

Ship-to zip

TW14 0

Ship-to country

GB

Line 0

Item P20001, qty 1, warehouse 04, TreeType=iProductionTree, UoMEntry=-1, BackOrder=tYES

WMS output (expected shape)

WMS field

Example result

data.documentId

711

data.baseType

SalesOrder

data.businessPartner.businessPartnerId

C70000

data.businessPartner.name

British Technology

data.pickDate

2025-01-01T00:00:00Z

data.handling

Manual

data.priority

3

data.status

Open

data.objectType

Orders

data.partialDelivery

true

data.address.street / addressId

111 Lansbury Ave (+ street no. if present)

data.address.city

Hounslow, Greater London

data.address.country

GB

data.customFields.externalId

711

data.customFields.objectType

Orders

Line included?

Only if warehouse 04 has U_AEN_WHS_Picking = Y

lines[].itemId

P20001

lines[].quantity

1

lines[].status

Open

lines[].partialDelivery

true

lines[].uomCode

From UoM rule (UoMEntry = -1m + MeasureUnit, e.g. m or mPallet)

lines[].salesBom

Omitted for iProductionTree


9. Implementation checklist for consultants

  1. Warehouses: set U_AEN_WHS_Picking = Y on every warehouse that must create WMS work.

  2. Ship-to address: maintain AddressExtension ship-to fields on the sales order.

  3. UoM: understand -1 UoM entry fallback (m + measure unit).

  4. Sales BOM: use iSalesTree / iIngredient and consistent VisualOrder if WMS must receive BOM structure.

  5. Text lines: use dslt_Text special lines with AfterLineNumber aligned to the related line VisualOrder.

  6. Tracking: use correlation.correlationId and customFields.externalId (DocEntry) for support.

  7. Defaults: expect handling=Manual, priority=3, baseType=SalesOrder on every document.


10. Source artifacts (for reference)

Artifact

Role

mappings/sales-order-mapper.mfd

MapForce mapping definition (field logic)

mappings/input_sales_order.schema.json

B1 sales order schema

mappings/output_order_document.schema.json

WMS order document schema

mappings/intermediate.warehouses.schema.json

Warehouse list schema

mappings/input_bom_order.schema.json

Sales-tree helper schema

scenario_files/1_Sales_order/

Sample source/target messages


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