To copy a multicompany structure - Example

This example describes how you can copy an entire multicompany structure, including the central DEM company, to a new multicompany structure having its own central DEM company.

Consider the following multi site setup:
Sample multi site setup
Sample multi site setup

Points of attention:

  • Company 400 is the central DEM company that contains the Enterprise Modeler data, which is shared by all companies in the structure.
  • Each enterprise unit contains entities of one company in the structure. For example: EU_B contains logistic entities in company 401. Therefore, the logistic entities (e.g. warehouses, departments) in company 401 contain a reference to this enterprise unit. Note: the codes of the enterprise units are unique within the multicompany structure. Therefore, when you copy the entire multicompany structure, including the central DEM company 400, you do not have to change the codes of the enterprise units, since in this example these codes will be unique within the new target structure as well.
  • Companies 401, 402 and 403 contain logical tables that are all linked to physical tables in company 400.
  • Company 400 does not contain logical tables.

You want to copy this setup as follows:

  • Copy company 400 to company 600
  • Copy company 401 to company 601
  • Copy company 402 to company 602
  • Copy company 403 to company 603

Company 600 is the central DEM company in the new structure.

The following figure shows the resulting structure:
New multicompany structure
New multicompany structure

Company 600 is the central DEM company that contains the Enterprise Modeler data, which is shared by all companies in the new structure. Each enterprise unit contains entities of one company in the structure. For example: EU_B contains logistic entities in company 601. Therefore, the logistic entities (e.g. warehouses, departments) in company 601 contain a reference to this enterprise unit.

Nota

The codes of the enterprise units are unique within the new multicompany structure. They do not conflict with the (identical!) codes of the enterprise units in the source multicompany structure.

Procedure summary

To copy data from the source structure to the target structure take the following steps:

  1. Create target companies 600, 601, 602 and 603
  2. Define logical tables for companies 601, 602 and 603
  3. Export data from source companies 400, 401, 402 and 403
  4. Correct company numbers
  5. Import data into companies 600, 601, 602 and 603
  6. Create missing tables for companies 600, 601, 602 and 603
  7. Define company 600 as the central DEM company for all target companies.
  8. Export version and model data from company 400 (the source central DEM company).
  9. Import version and model data into company 600 (the target central DEM company).
  10. Correct the financial company number for enterprise units in the target multicompany structure.
  11. Specify the operational enterprise structure model and version for the target multicompany structure.
  12. Reorganize tables and repair reference counters for companies 600, 601, 602 and 603

See the following section for details.

Procedure details
Fase 1. Create target companies 600, 601, 602 and 603

Create the target companies 600, 601, 602 and 603 through the Compañías (ttaad1100m000) session. Convert the changes to runtime and restart your bshell.

Fase 2. Define logical tables for companies 601, 602 and 603

Note: in the source environment, companies 401, 402 and 403 contain logical tables that are all linked to physical tables in company 400. Company 400 does not contain logical tables.

Run the Tablas lógicas (ttaad4120m000) session to define the logical tables for the new companies 601, 602, and 603.

Points of attention:

  • The set of logical tables for each target company must be identical to the set of the corresponding source company. For example: the set of logical tables for company 601 must be identical to the set for company 401, only the physical company must differ.
  • You must link all logical tables to physical company 600.
  • Convert the changes to the runtime data dictionary and restart your bshell to load the new settings.

Note: the companies in the new multicompany structure must at least share the tccom000 (Implemented Software Components) and tcemm170 (Companies) tables, and their reference tables.

Fase 3. Export data from source companies 400, 401, 402 and 403

Extract data from the source companies 400, 401, 402 and 403 to sequential files. Do not export data from the Enterprise Modeling (tg) package.

Company 400

To extract data for company 400, you must run the Crear volcado de tabla secuencial (ttaad4226m000) session twice.

Use the following settings for the first export:

Create Sequential Dump of Table (ttaad4226m000)
FieldValue
Company400-400
Packageaa-tf
Table<empty> - zzz999
Suppress Error MessagesNo
Drop Table after DumpNo
Create Fixed Length RecordsNo
Specify Field SeparatorYes
| (pipe)
Directory for Table Files/tmp/400
Basic Name for Dump File(s)<Empty>
Name of the Error File/tmp/err400-1

 

For the second export, use exactly the same settings, except:

  • Range of packages: th-zz
  • Enter a different name for the error file, e.g. /tmp/err400-2

Remaining companies

Use the same procedure to extract data from the companies 401, 402 and 403.

Points of attention:

  • Specify a different directory for each company: /tmp/401, /tmp/402 and /tmp/403 for companies 401, 402 and 403 respectively.
  • Enter a different name for the error file for each export.

Fase 4. Correct company numbers

Run the Copiar datos de la compañía (tccom0214m000) session to correct references to company numbers in the sequential files. References to the source companies 400, 401, 402 and 403 must be changed into references to the target companies 600, 601, 602 and 603 respectively.

Company 400

To correct the company number references in the sequential files of company 400:

  1. switch to company 400
  2. run the session with the following settings:
Copy Company Data (tccom0214m000)
FieldValue
Specify Field Separator| (pipe)
Directory for Table Files/tmp/400
Companies to CopyYes
400>600;401>601;402>602;403>603
Enterprise Units to CopyNo

 

Remaining companies

Run the session another 3 times to correct the sequential files of companies 401, 402 and 403. Points of attention:

  • Before you run the session you must switch to the appropriate source company number, e.g. switch to company 401 before you run the session to correct the files that were extracted from company 401.
  • The Directory for Table Files differs per company number: /tmp/401, /tmp/402 and /tmp/403 for the files of companies 401, 402 and 403 respectively.
  • The remaining settings must be exactly identical to the settings in the example above.
Fase 5. Import data into companies 600, 601, 602 and 603

Run the Crear tabla de volcado secuencial (ttaad4227m000) session to import the contents of the sequential files into the target companies.

Company 600

The following table shows the settings that you must use to load data into company 600:

Create Table from Sequential Dump (ttaad4227m000)
FieldValue
Create Tables for Different CompanyYes
600
Append if Table ExistsNo
Delete Existing TablesNo
Create Rows before IndexYes
Disable Domain ConstraintsNo
Ignore Referential Integrity ConstraintsYes
Specify Field Separators of Seq FileYes
| (pipe)
Directory for Searching Table Files/tmp/400
Pattern to Match Table Names*
File to Store Table Names not CreatedNo
Name of the Error File/tmp/err_imp600

 

Remaining companies

Use the same procedure to import data for the companies 601, 602 and 603. Points of attention:

  • The Directory for Searching Table Files is different for each company:
    • /tmp/401 contains the files that must be loaded into company 601
    • /tmp/402 contains the files that must be loaded into company 602
    • /tmp/403 contains the files that must be loaded into company 603
  • Enter a different name for the error file for each import.

Fase 6. Create missing tables for companies 600, 601, 602 and 603

Run the Crear tablas (ttaad4230m000) session to create missing tables for the companies 600, 601, 602 and 603. Specify the following settings:

Create Tables (ttaad4230m000)
FieldValue
Company600 - 603
Package<Empty> - zz
Table<Empty> - zzz999

 

Fase 7. Define company 600 as the central DEM company

Define company 600 as the central DEM company for all target companies.

Repeat the following steps for each target company (600, 601, 602, and 603):

  1. Switch to the new target company.
  2. Run the Compañía central para almacenar datos del modelizador empresarial (tgbrg0100s000) session. Specify company 600 as the central DEM company.
Fase 8. Export version and model data

Export version and model data from company 400 (the source central DEM company).

Take the following steps:

  1. Switch to company 400.
  2. Run the Exportar volcado de versión (tgbrg1235m000) session to export the version and model data. Points of attention:
    • Select the version to export
    • Specify the name and path of the dump file
    • Click Yes on All Tabs
    • Click Yes in any questions that are displayed during the export process
Fase 9. Import version and model data

Import version and model data into company 600 (the target central DEM company).

Take the following steps:

  1. Switch to company 600.
  2. Run the Importar volcado de versión (tgbrg1245m000) session to import the version and model data. Points of attention:
    • Specify the name and path of the dump file that was created by the export process.
    • Click Yes on All Tabs
    • Click Yes in any questions that are displayed during the import process
Fase 10. Correct financial company number for enterprise units

Correct the financial company number for enterprise units in the target multicompany structure.

  1. Switch to one of the target companies.
  2. Run the Modelos de estructura empresarial (tgbrg0512m000) session.
  3. Specify the current version (the version that was imported in step 9). The imported Enterprise Structure Model is displayed.
  4. Select the model and subsequently, on the Specific menu, click Enterprise Structure Model Browser. The enterprise units are displayed in a graphical browser.
  5. Repeat the following steps for each enterprise unit:
    • Select the enterprise unit.
    • On the Specific menu, click Details. A dialog is started.
    • Replace 403 (the original financial source company) by 603 (the financial target company).
Fase 11. Specify operational enterprise structure model and version

Specify the operational enterprise structure model and version for the target multicompany structure.

  1. Switch to company 600.
  2. Run the Parámetros de DEM (tgbrg0135s000) session
  3. Specify the operational enterprise structure model and the version (the model and the version that were imported in step 9).
Fase 12. Reorganize tables and repair reference counters

Reorganize tables and repair reference counters for companies 600, 601, 602 and 603

Run the Reorganizar tablas (ttaad4225m000) session to reorganize the tables and to repair the reference counters for the companies 600, 601, 602 and 603.

Specify the following settings:

Reorganize Tables (ttaad4225m000)
FieldValue
Company600 - 603
Package<Empty> - zz
Table<Empty> - zzz999
Data and IndicesNo
Reference IntegrityYes
Check Validity of ReferenceNo
Repair Reference CounterYes
All other check boxesNo