Functional documentation for the Aiden WMS sales return mapper.
This document describes what happens after the mapper is installed: which SAP Business One (B1) sales return / return request 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 return / return request document (Service Layer document JSON) |
|
Target |
Aiden WMS inbound return document ( |
|
Purpose |
Convert an open B1 return document into a WMS inbound return request for warehouse receipt processing |
After installation, when a return document is published to the integration, the mapper produces a WMS document that contains:
-
Document identity (with
SO-prefix) and type labels for returns -
Customer (business partner)
-
Ship-to address
-
Return lines for picking-enabled warehouses only, with remaining open quantity
-
Line references back to the base B1 document (
BaseType/BaseEntry/BaseLine) -
Optional sales BOM structure on BOM-related lines
-
Optional freight/expenses
-
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 |
|---|---|---|
|
|
|
Manual handling mode in WMS |
|
|
|
Default priority |
|
|
|
Custom object type label for returns |
|
|
|
Same label on every line |
Note: A constant
SalesReturnalso exists in the mapping near header fields historically associated withbaseType. Headerdata.receiveDateis present in the output schema but is not wired in the current MapForce mapping. LinereceiveDateis mapped fromShipDate.
Key differences vs sales-order mapper
|
Topic |
Sales order mapper |
This sales return mapper |
|---|---|---|
|
Kafka / WMS endpoint |
|
|
|
|
|
|
|
Line quantity |
|
|
|
|
|
|
|
Custom object type |
|
|
|
Header internal key |
often |
|
|
Line base document refs |
typically not |
|
|
Header date field |
|
Header |
|
Special lines |
text special lines mapped |
|
2. What the mapper uses as input
2.1 Main payload — B1 return document
The primary input is the full B1 document JSON (schema named input_sales_order in MapForce for historical reasons), including for example:
-
Header:
DocNum,DocEntry,CardCode,CardName,DocumentStatus,PartialSupply,DocObjectCode,PickRemark,NumAtCard -
Ship-to address:
AddressExtension.ShipTo* -
Lines:
DocumentLines[](includingRemainingOpenQuantity,VisualOrder,BaseType/BaseEntry/BaseLine, UoM, warehouse, tree type, etc.) -
Header additional expenses:
DocumentAdditionalExpenses[] -
Line additional expenses:
DocumentLineAdditionalExpenses[]
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 return 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 document, 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 / Kafka 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 document 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 returns may arrive in WMS with missing lines.
3.2 Document id prefix
WMS data.documentId is built as:
-
Constant prefix
SO- -
Concatenated with B1
DocNum
Example: B1 DocNum = 950 → WMS documentId = SO-950.
3.3 Document and line status
B1 statuses look like bost_Open / bost_Close.
The mapper:
-
Removes the
bost_prefix →Open/Close -
Translates
Close→Closed(other values stay as-is, e.g.Open)
Applied to:
-
Header:
DocumentStatus→data.status -
Line:
LineStatus→lines[].status
|
B1 value |
WMS value |
|---|---|
|
|
|
|
|
|
3.4 Partial delivery flags
B1 tYES / tNO flags are converted to booleans:
|
B1 field |
WMS field |
Translation |
|---|---|---|
|
|
|
|
|
Line |
|
|
3.5 Object type (data.objectType)
|
B1 |
WMS |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Separately, custom object type on header and lines is always the constant SalesReturn (not driven by DocObjectCode).
3.6 Quantity on lines
|
WMS field |
Source |
Rule |
|---|---|---|
|
|
|
Direct — open remaining quantity, not ordered |
For returns, WMS receives what is still open to receive/return. Fully closed quantities will appear as zero (or whatever B1 reports as remaining open).
Ordered Quantity is still used inside sales BOM single-quantity calculations when BOM parents apply (see §3.10).
3.7 Document line number
|
WMS field |
Source |
Rule |
|---|---|---|
|
|
|
|
|
|
|
Direct B1 line number |
So WMS documentLine is visual-order based (1-based offset), while customFields.lineNum keeps the original B1 LineNum.
3.8 Unit of measure on lines (uomCode)
For each line:
-
If
UoMEntryis not-1→ useUoMCode -
If
UoMEntryis-1→ use"m" + MeasureUnit-
If
MeasureUnitis missing, an empty string is used afterm(result can be justm)
-
UoMEntry is also copied unchanged to lines[].customFields.UoMEntry.
3.9 Ship-to address
Address is taken from ship-to fields on the document (AddressExtension), not bill-to.
|
WMS address field |
Source |
|---|---|
|
|
|
|
|
Same concatenated street value as |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Not mapped as a separate field (folded into street) |
3.10 Sales BOM structure (lines[].salesBom)
B1 tree types used:
|
|
Meaning in this mapper |
|---|---|
|
|
Sales BOM parent |
|
|
Sales BOM ingredient/child |
|
Other (e.g. |
Not treated as sales BOM |
When is salesBom present on a line?
-
Only if the line is a sales BOM parent or ingredient (
iSalesTreeoriIngredient). -
Otherwise the
salesBomobject is omitted.
Fields:
|
WMS field |
Rule |
|---|---|
|
|
|
|
|
|
|
|
For sales-tree parents: |
|
|
For sales-tree parents: line |
Practical expectation for consultants:
-
Sales BOM parents and ingredients are flagged in WMS via
salesBom. -
Parent kit lines get
parent = trueandrespectSingleQuantity = true. -
Quantity/parent-line calculations depend on
VisualOrderordering of sales-tree lines on the B1 document. -
Non-BOM lines do not get a
salesBomblock.
3.11 Base document references on lines
For each included line, B1 base document fields are copied into line custom fields:
|
WMS field |
B1 source |
|---|---|
|
|
|
|
|
|
|
|
|
These support tracing a return line back to the originating B1 document/line (e.g. delivery or invoice base).
3.12 Customer reference (NumAtCard)
If filled in B1, NumAtCard is sent as a dynamic custom property:
-
Property name:
NumAtCard -
Property value: the B1
NumAtCardvalue
(Output schema path: dynamic property / property.name under header customFields.)
3.13 Additional expenses
-
Header
DocumentAdditionalExpenses→data.customFields.DocumentAdditionalExpenses[] -
Line
DocumentLineAdditionalExpenses→lines[].customFields.DocumentAdditionalExpenses[]
Copied fields: ExpenseCode, LineTotal, GroupCode, DistributionMethod, VatGroup, and line number (LineNum).
3.14 Special lines
DocumentSpecialLines exists on the B1 input schema but is not mapped in this MapForce definition. Text/special lines are not sent to WMS by this mapper.
3.15 Integration endpoint
After mapping, the Camel route sets the outbound HTTP/WMS endpoint header to:
-
InboundReturnRequest
This is an inbound return flow for WMS (not an outgoing pick document).
4. Field mapping tables
Legend:
-
WMS output field — path in the Aiden WMS return document
-
B1 / source input — field on the return document or other source
-
What happens — copy or transformation
-
Notes — consultant-relevant remarks
4.1 Correlation
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
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 |
|---|---|---|---|
|
|
|
Concatenate constant |
e.g. |
|
|
— |
Constant |
Always |
|
|
— |
Constant |
Always |
|
|
|
Strip |
See §3.3 |
|
|
|
Value map |
See §3.5 |
|
|
|
|
|
|
|
|
Direct |
|
|
|
— |
Not mapped |
Schema field only |
|
|
— |
Not mapped |
Remains empty/absent |
|
|
|
Direct |
Internal B1 key (header) |
|
|
— |
Constant |
Always |
|
Dynamic property |
|
Name constant + value copy |
Only meaningful when filled in B1 |
4.3 Business partner
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Direct |
|
|
|
|
Direct |
|
4.4 Address (data.address)
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Concatenate with space; null street no. → empty |
Same value as street |
|
|
|
Same as |
Ship-to only |
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
— |
Not mapped |
Included in street concat |
4.5 Lines (data.lines[])
Only lines for picking-enabled warehouses (§3.1).
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
|
Not raw |
|
|
|
Direct |
Must be picking-enabled |
|
|
|
Direct |
|
|
|
|
Direct |
Open qty for return/receive |
|
|
|
Conditional — see §3.8 |
|
|
|
|
Strip |
|
|
|
|
Direct |
Line-level receive date |
|
|
|
|
|
|
|
|
Direct |
|
|
|
|
Direct |
Original B1 line number |
|
|
|
Direct |
|
|
|
Header |
Direct |
Document internal key on the line |
|
|
— |
Constant |
Always on included lines |
|
|
|
Direct |
Base document type |
|
|
|
Direct |
Base document entry |
|
|
|
Direct |
Base document line |
4.6 Sales BOM on lines (lines[].salesBom)
Only for TreeType in (iSalesTree, iIngredient) — see §3.10.
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
|
Present if parent or ingredient |
Omitted otherwise |
|
|
|
|
|
|
|
|
|
|
|
|
Line |
|
Parents/BOM calc |
|
|
Line |
Quantity ÷ last matching parent qty |
Per-single-parent qty |
4.7 Line additional expenses
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
Line expense |
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
B1 line expense number |
4.8 Header additional expenses
|
WMS output field |
B1 / source input |
What happens |
Notes |
|---|---|---|---|
|
|
Header |
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
|
|
|
Direct |
|
5. Value translations (reference)
5.1 Yes/no flags
|
B1 |
WMS |
|---|---|
|
|
|
|
|
|
5.2 Warehouse picking flag
|
B1 |
Meaning in mapper |
|---|---|
|
|
Warehouse lines are sent to WMS |
|
|
Warehouse lines are not sent to WMS |
5.3 Status
|
After removing |
Final WMS status |
|---|---|
|
|
|
|
|
|
|
Other |
Unchanged (passthrough) |
5.4 Document object code
|
B1 |
WMS |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
5.5 Sales tree types
|
B1 |
Mapper treatment |
|---|---|
|
|
Sales BOM parent |
|
|
Sales BOM ingredient/child |
|
Other |
No |
5.6 Fixed constants
|
Constant |
Used for |
|---|---|
|
|
Prefix of |
|
|
|
|
|
|
|
|
Header and line |
|
|
UoM fallback prefix when |
|
|
UoM entry comparison |
|
|
Dynamic property name |
|
|
Sales BOM detection |
|
|
Status prefix stripped |
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) |
|
Header |
Header date fields not wired; only line |
|
Prices, VAT, discounts, currency |
Not mapped to WMS core fields |
|
Sales employee / owner |
|
|
Ordered line |
WMS qty uses |
|
|
Present on input schema but not mapped |
|
Non-picking warehouses |
Lines suppressed |
|
Production tree BOM ( |
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 |
|
Scenario target sample |
|
7. End-to-end expectation (happy path)
-
A sales return / return request is created or updated in SAP B1 and published to the integration.
-
Integration loads picking warehouse configuration from B1 (hourly).
-
Integration builds a sales-tree helper body from lines with
TreeType = iSalesTree. -
Mapper converts the document to a WMS return document:
-
Header + BP + ship-to address
-
documentId=SO-+DocNum -
Only lines on picking warehouses
-
Quantity = remaining open quantity
-
documentLine= visual order + 1 -
Status / partial-delivery / UoM / BOM / base refs applied
-
Custom object type
SalesReturn
-
-
WMS receives an
InboundReturnRequestready for inbound warehouse processing. -
correlation.correlationId, headercustomFields.DocEntry, and line base refs support support/troubleshooting.
8. Example (illustrative)
Illustrative values based on mappings/input_sales_order.example.json and confirmed MapForce rules.
Project scenario files under scenario_files/1_mainRoute are schema placeholders and are not reliable expected I/O samples.
B1 input (excerpt)
|
Field |
Example value |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ship-to street / no. |
from |
|
Line |
Item e.g. stock item, warehouse |
WMS output (expected shape)
|
WMS field |
Example result |
|---|---|
|
Endpoint |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Line included? |
Only if warehouse has |
|
|
|
|
|
From |
|
|
From line |
|
|
|
|
|
B1 |
|
|
From B1 line when present |
|
|
Only for |
9. Implementation checklist for consultants
-
Warehouses: set
U_AEN_WHS_Picking = Yon every warehouse that must create WMS return work. -
Open quantities: ensure B1 remaining open quantities reflect what should still be received in WMS.
-
Ship-to address: maintain
AddressExtensionship-to fields on the return document. -
UoM: understand
-1UoM entry fallback (m+ measure unit). -
Sales BOM: use
iSalesTree/iIngredientand consistentVisualOrderif WMS must receive BOM structure. -
Base document links: maintain
BaseType/BaseEntry/BaseLineon return lines when WMS or support needs origin tracing. -
Tracking: use
correlation.correlationId, headercustomFields.DocEntry, and line base refs for support. -
Defaults: expect
handling=Manual,priority=3, custom object typeSalesReturn, and document id prefixSO-on every document. -
Do not expect special text lines or header receive/pick dates from this mapper.
10. Source artifacts (for reference)
|
Artifact |
Role |
|---|---|
|
|
MapForce mapping definition (field logic) |
|
|
B1 document schema (shared naming with sales order) |
|
|
WMS document schema |
|
|
Warehouse list schema |
|
|
Sales-tree helper schema |
|
|
Kafka in, BOM prep, endpoint |
|
|
MapForce invoke (body, BOM, warehouses, correlationId) |
|
|
Hourly warehouse load |
|
|
Sample placeholders (not full mapped examples) |
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.