Transfer data within SAP Business One
For every new sales order, the delivery is to be created at once in the same company — with all
lines except the freight flat rate, which stays in the order. Source and target are both
CAMBIRA_DE; nothing comes in from outside, nothing goes out. This guide sets up the route
"Lieferungen aus Aufträgen" for it.
At the end, the sales office creates sales order 4131 for K-10317 "Hollmann Bau GmbH", with
ARM-4711 quantity 4 and FRACHT-PAUSCHAL quantity 1, and the route creates delivery 80251 from
it — with exactly one line, ARM-4711, quantity 4.
Here the data stays in your own company. If it is to go into a second SAP company, that is an export route with its own connection — see Transfer master data into a second company.
What you need
- Three permissions, each at the level Full: Routes creates the route, Activation activates the snapshot, Automation releases the route at the end — see Permissions.
- No connection. An internal route has no counterpart.
- Starting point: Configuration → Routes.
Xchange saves every input automatically. In operation, it takes effect only with the activated configuration snapshot — that is step 5.
1. Create the route
- Configuration → Routes → Create.
- Direction Internal. The type switches to Processing, the data origin offers only Dataset, and the Connection field disappears.
- Name:
Lieferungen aus Aufträgen. - Create.
In the route list, the route then stands in the group "SAP Business One", at the very top. What sets the three directions apart and which combinations the dialog allows is covered under Routes.
2. Say where to read from
On the Source data tab:
- Fetch endpoint:
Orders. - Below it is the Single-fetch endpoint
Orders({{DocEntry}}). Xchange fills it from the fetch endpoint; through it, the route reads the order that the event reports.
This route needs no data filter — every new order is to get a delivery.
3. Map header and lines
On the Mapping tab:
- Open the Step settings: Name
Lieferung anlegen, Write intent Create, Target endpointDeliveryNotes. The target here is SAP Business One itself, so a path of the Service Layer. - Create a row with Target field
CardCodeand sourceOriginalPayload.CardCode. - Add a list and open it; in its List settings, enter the Target List
DocumentLinesand the Source ListOriginalPayload.DocumentLines[*]. - In the list, map
ItemCodeandQuantityfrom the Element fields group. - Leave out the freight flat rate. On the Filter tab of the List settings, create the
condition
ItemCodedoes not equalFRACHT-PAUSCHAL. This line stays in the order and does not go into the delivery.
How a list is created and filled is covered in detail under Map header and lines when the target splits differently; all comparisons of the filter are listed under Routes — Mapping.
4. Set the trigger
The route is to run as soon as an order is created. On the Automation tab:
- Add trigger, type Event.
- Operating mode Same as fetch endpoint — the trigger listens to
Orders, the object the route reads from. - Under Trigger on, switch on only Created. A change to the order is not to create a second delivery.
The whole path of an event trigger is described in React to a change in SAP.
Do not listen to the object the route creates. If the trigger were set to Other object
DeliveryNotes, every delivery the route creates would start the route again. Xchange then warns:
"Route creates 'DeliveryNotes' itself and can trigger itself again — narrow the event with a
condition the created records do not meet". When the warning appears and why it stays even with a
condition is covered under Routes — Automation.
5. Check and activate
- In the Test area of the Mapping tab, run an order with a freight flat rate through and check
that
DocumentLinescarries only the other lines. - Activate the configuration snapshot — see Validate and activate.
- Switch to Execution and turn on the switch in the Automation column of this route.
Only then does the route create deliveries.
What comes next
After the first order, the job appears in History: the records are called Source and Target there, and both are in SAP Business One. How to read a job there is covered under History.
See also
- React to a change in SAP (guide) — the event trigger step by step
- Map header and lines when the target splits differently (guide) — lists and their filter
- Routes (reference) — direction, type and data origin in the creation dialog
- Routes — Automation (reference) — the event and the warning about self-triggering
- Routes (core concept) — what sets an internal route apart from import and export