Qeasy Cloud
Get Started

Practical Tutorial: Syncing MES Order Outbound to U8 Sales Shipment

· 许创贵· Integration Solutions· 14 views· 5 min read

What This Strategy Solves

On the shop floor of a discrete manufacturing enterprise, MES is where the "outbound fact" is born, while ERP (U8) is where finance and inventory converge. After MES confirms order outbound, if warehouse staff still have to manually key in shipment documents in U8, the result is slow, error-prone, and leads to mismatched books. This strategy ensures that once MES confirms outbound, a shipment linked to the original sales order number is automatically generated in U8, achieving "outbound equals bookkeeping."

Data Flow and Field Mapping

The flow is one-way push: MES (WebAPI) → Qeasy Data Integration Platform → U8 (WebAPI).

Source side: MES exposes a common/search query interface (POST), paginating outbound confirmations. The key field is confrimNo (outbound confirmation number); id or an updated timestamp can serve as the increment cursor.

Target side: U8 exposes an XSFHDAdd sales shipment creation interface (POST). On write, the MES confirmation number, sales order number, shipment date, and material lines need to be mapped in.

Key field mapping (only the tricky ones in practice):

MeaningMES SourceU8 TargetNote
Outbound confirmation No.confrimNocDLCodeUnique in U8
Sales order No.saleOrderNocSOCodeMust match an existing U8 SO
Shipment datecreateTimedDateTypically yyyy-MM-dd
Business typeFixedcBusType"普通销售" to avoid wrong template
Auto-auditFixedAutoAuditStart with false
Material codematerialCodecInvCodeCentralized code mapping
QuantityqtyiQuantityMind UOM conversion

Configuration on Qeasy

We use the Qeasy data integration platform to host this strategy, split into three blocks: source collection, target write, mapping and transformation.

Source configuration essentials:

  • Use common/search (POST); pass queryKey and wsId as variables rather than hardcoding them in production.
  • Pagination: pageNum from 1, pageSize around 100 — enough throughput without tripping MES timeouts.
  • Increment strategy: use the MES confirmation timestamp as the cursor. Qeasy's "scheduling increment start point" auto-remembers the last successful cursor; the first run is full, then increments only.

Target configuration essentials:

  • Use XSFHDAdd (POST) with AddType=1 (new shipment).
  • Key placeholders: cDLCode ← {{confrimNo}}, cSOCode ← source sales order field, dDate ← {{createTime}}.
  • Auto-audit: keep AutoAudit=false initially; flip it on once data is stable. This is the most common pitfall — many customers enable auto-audit too early, then bad data updates U8 inventory and is hard to roll back.

Mapping and transformation:

  • Keep code mappings (material, customer, warehouse) in Qeasy's centralized mapping module; never hardcode in scripts. When either side changes a code, one place is enough.
  • Stage header and body separately: first push only the header (doc No., order No., date), verify correctness, then enable line items — a common "safe approach" among Qeasy customers.

Implementation Steps

Step 1: One-time full initialization

  • Manually trigger a full run on Qeasy to backfill historical outbound confirmations. Keep auto-audit off in this round; treat generated U8 shipments as "shadow data" for reconciliation. Only move to increments after amount, quantity, and order number are all verified.
  • Full schedule: manual trigger only, no crontab needed.

Step 2: Set increment starting point

  • Move the increment cursor to the cutoff of the full run, e.g., the first record after a specific timestamp.
  • Never skip this step; otherwise full and increment overlap, and U8 rejects on duplicate doc numbers.

Step 3: Daily scheduling

  • Source polling: */9 7-22 * * * (every 9 minutes during work hours). Target write: stagger by a few minutes, e.g., 2-59/9 7-22 * * *, so the target doesn't write before source finishes pulling.
  • No scheduling at night, to avoid unintended audits during off-hours.

Step 4: Monitoring and reconciliation

  • Configure a dashboard on Qeasy comparing "source pulled = target successfully written"; alert on any delta.
  • Weekly, hand-verify 5–10 shipments in U8 for inventory and document status.

Pitfalls Recap

  1. Sales order not matched, whole batch rejected: U8 shipments must link to an existing, open sales order. If the MES order number does not exist in U8, XSFHDAdd errors out. Best practice: add a pre-check script in Qeasy to confirm the SO exists in U8 before pushing.
  2. Duplicate document number, duplicate shipment: MES confirmation numbers are theoretically unique, but cross-day reruns or manual entries can collide. Prefix cDLCode with a tenant/factory code, e.g., {factory}-{confrimNo}, to eliminate conflicts at the root.
  3. UOM conversion ignored: MES uses "pcs" while U8 uses "boxes" or has base/auxiliary units. Pushing quantity as-is often triggers "quantity abnormal." Resolve in the mapping stage, not by editing U8 documents afterward.
  4. Auto-audit turned on too early: Many customers enable AutoAudit=true for convenience, but when upstream data is wrong, U8 documents are already audited and inventory updated. Recovery is expensive.
  5. Cross-day timezone and date boundary: MES createTime includes time while U8 dDate usually takes only the date. Schedules crossing midnight can misclassify next-day records. Truncate the date to yyyy-MM-dd in Qeasy's field transformation.

Applicable and Non-applicable Scenarios

Applicable: Discrete manufacturers where MES outbound confirmation is the single source of shipment truth, U8 already holds matching sales orders, and the goal is "outbound equals bookkeeping." Also applies to supply chain integration projects needing inventory alignment between MES and ERP.

Not applicable: Trades where U8 sales orders do not yet exist or where invoicing precedes shipping; or scenarios where MES outbound data requires manual review before reaching finance — in those cases, use a semi-automatic trigger mode.

Original content. Please credit the source when reposting: https://www.qeasy.cloud/insights/solutions/strat-mes-web-u8-0201-mes-u8-d57b2951

Comments