Skip to main content

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.

Distinction

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​

  1. Configuration → Routes → Create.
  2. Direction Internal. The type switches to Processing, the data origin offers only Dataset, and the Connection field disappears.
  3. Name: Lieferungen aus Aufträgen.
  4. 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:

  1. Fetch endpoint: Orders.
  2. 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:

  1. Open the Step settings: Name Lieferung anlegen, Write intent Create, Target endpoint DeliveryNotes. The target here is SAP Business One itself, so a path of the Service Layer.
  2. Create a row with Target field CardCode and source OriginalPayload.CardCode.
  3. Add a list and open it; in its List settings, enter the Target List DocumentLines and the Source List OriginalPayload.DocumentLines[*].
  4. In the list, map ItemCode and Quantity from the Element fields group.
  5. Leave out the freight flat rate. On the Filter tab of the List settings, create the condition ItemCode does not equal FRACHT-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:

  1. Add trigger, type Event.
  2. Operating mode Same as fetch endpoint — the trigger listens to Orders, the object the route reads from.
  3. 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​

  1. In the Test area of the Mapping tab, run an order with a freight flat rate through and check that DocumentLines carries only the other lines.
  2. Activate the configuration snapshot — see Validate and activate.
  3. 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​