Guide for SAP Business One administrators and partners
Master data replication for SAP Business One: what has to travel, and what must not
Copying a record from one company database to another is easy. Keeping it the same for years is not. Four questions decide whether a replication can be trusted, and each has a way of going wrong that only shows up months later.
1. Copying is not replicating
A group that runs several SAP Business One companies usually wants the same items, the same customers and the same price lists in each. The first attempt is almost always a copy: an export and an import, a Data Transfer Workbench template, or a script that reads a record in one company and writes it into another.
A copy works on the first day. Replication is what happens on every day after it: the item is renamed at head office, a branch corrects a customer's phone number, someone adds a price list, an item group gets a different number in the new company. A replication has to answer four questions for every record, every time:
- Is this the same record as that one?
- Which of its fields belong to the group, and which to one company?
- What does it point at, and does that exist over there?
- Who changed it last?
2. Is this the same record?
For items and business partners the answer looks obvious: the same code. It stops being obvious when a branch was migrated from another system and its customers carry other codes, or when two companies both created item A1000 for different things.
For most setup data there is no shared code at all. SAP Business One numbers item groups, manufacturers, price lists, payment terms, sales employees, territories and many more by itself. Item group 101 in one company is "Printers"; in another company 101 is "Services" and "Printers" is 105. The number means nothing outside its own company.
| Kind of key | Examples | How two records are recognised as the same |
|---|---|---|
| A code people choose | Items, business partners, warehouses, G/L accounts, projects, cost centres | The same code, or a rule for how the code changes on the way, or a cross-reference per record |
| A number SAP assigns | Item groups, manufacturers, price lists, payment terms, units of measure, sales employees | The same name the first time, then a remembered pairing of the two numbers |
| Several fields together | A user-defined field (table and name), a special price (item and business partner) | The same combination, each part translated to the other company's key |
The important word is remembered. Matching by name works once. After "Printers" is renamed "Printing devices" at head office, a replication that only matches by name finds nothing in the branch and creates a second group. A replication needs its own memory of which record is which, a link, and the link has to win over the name.
3. Which fields belong to the group?
An item in SAP Business One has roughly two hundred fields. Not one replication should send them all.
| Kind of field | Examples on an item | What should happen |
|---|---|---|
| What SAP owns | Quantity on stock, ordered quantities, moving average price, dates of change | Never sent, whatever anyone configures |
| What usually belongs to one company | Number series, default warehouse, revenue and expense accounts | Left alone unless someone decides otherwise for this group |
| What cannot change once the record is used | Whether the item is managed by serial or batch numbers, the valuation method, the inventory unit of measure | Sent when the record is created, never afterwards |
| What the group shares | Description, group, manufacturer, units, prices, bar codes | Replicated |
Two details catch almost every home-made copy job. First, companies do not have the same fields: a user-defined field that exists at head office and not in the branch makes the Service Layer refuse the whole record, not just that field. Second, SAP Business One stores an empty number as 0 and a yes/no that was never set as empty. A comparison that takes "nothing" and "0" for different values will write the same record again on every run, for ever.
4. What does it point at?
An item is not a self-contained thing. It points at an item group, a manufacturer, a unit of measure group and several units, a preferred vendor, tax groups, G/L accounts, and one price list per price row. Every one of those is another record with its own key in its own company.
Sending ItemsGroupCode: 101 to a company where 101 is something else does not fail. It succeeds, and puts the item into the wrong group. That is the worst kind of error a replication can make, because nothing reports it.
So every field that points at another record has to be translated to the target's own key before anything is written, and there has to be an answer for the case that the target has no such record yet:
- Hold the record and say what is missing. Safe, and the right default.
- Create what is missing first. Convenient for setup data that the group shares anyway, such as item groups and manufacturers.
- Use a fixed value in that company, or leave the field empty.
- Map it by hand. The only right answer for what differs by law or by bank: tax groups, payment methods with their house bank, dunning terms.
5. The lists inside a record
Addresses, contact persons, prices, bar codes, the components of a bill of materials: lists inside a record are where most replications quietly lose data. Each company numbers the rows of a list itself. Contact person "Dana Meyer" is row 3 at head office and row 1 in the branch.
Two decisions have to be made per list. What happens to a row that only the target has: does it stay (merge) or is it removed (mirror)? And how is a row recognised when its name changes? If a contact person is matched by name alone, renaming her creates a second contact person in every target and leaves the old one behind. The replication has to remember which row became which.
6. Who changed it last?
Sooner or later someone changes a replicated record in the target company. A branch corrects a phone number or blocks a customer. The next replication run sees a difference between source and target, and a simple job resolves it the only way it knows: it overwrites the branch.
To do better, a replication has to know what the target held after its own last write. A value that differs from the source and from that memory was changed in the target by someone. Then there is a real choice: the source wins anyway, the target keeps its change, or a person decides. With the same memory on both sides, a change can even travel back, which is what two-way replication is: only a field changed in both companies is a conflict.
7. Noticing a change without touching the company
The classic way to notice changes is a stored procedure in the company database, the Transaction Notification. It works, and it means custom code inside every company, which every upgrade and every support call has to take into account.
The Service Layer offers a way from outside. Items and business partners carry the date and time of their last change, so they can be asked for everything that changed since the last look. Small setup tables carry no such stamp, but they are small: they can be read whole and compared by a fingerprint of the fields that matter. Removed records need a third look: a record that is missing from the list has to be asked for by its key before it counts as removed, and a sudden mass of removals is more likely an unreadable company than a clean-up.
8. A checklist for any replication
- It keeps its own record of which record is which, and that record wins over names
- Stock, balances and costs cannot be sent, by construction
- Fields the target lacks are left out and reported, not fatal
- Every reference is translated, and a missing one never becomes a wrong one
- Rows of lists are followed by identity, not by position or name
- A change made in the target is recognised as one
- You can see what a run would write before it writes
- Afterwards you can see what was written, field by field, and put it back
- It never deletes
9. How CertiReplica does it
CertiReplica was built around these four questions. It talks to each company through the Service Layer only and installs nothing in SAP Business One. For every record and target it does the same eight steps: read, filter, find the counterpart, shape, translate references, compare, write, read back.
- A link per pair of records answers question one, for codes that differ and for numbers SAP assigns.
- A catalogue describes for each of its 32 objects what never travels, what is local by default and what is sent on creation only; a rule changes the treatment of any field.
- References are matched, mapped, created first, fixed or left empty, per rule, and a record that cannot be completed is held with a sentence that says why.
- A snapshot of what the target held answers question four, one way or two-way.
- A simulation shows every change before it is written, and the history keeps every change after.
It works in full for 30 days without a licence. Request a trial, or read what it needs.