| # 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 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 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. Note 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: Create target companies 600, 601, 602 and 603 Define logical tables for companies 601, 602 and 603 Export data from source companies 400, 401, 402 and 403 Correct company numbers Import data into companies 600, 601, 602 and 603 Create missing tables for companies 600, 601, 602 and 603 Define company 600 as the central DEM company for all target companies. Export version and model data from company 400 (the source central DEM company). Import version and model data into company 600 (the target central DEM company). Correct the financial company number for enterprise units in the target multicompany structure. Specify the operational enterprise structure model and version for the target multicompany structure. Reorganize tables and repair reference counters for companies 600, 601, 602 and 603 See the following section for details. Procedure details Step 1. Create target companies 600, 601, 602 and 603 Create the target companies 600, 601, 602 and 603 through the Companies (ttaad1100m000) session. Convert the changes to runtime and restart your bshell. Step 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 Logical Tables (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. Step 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 Create Sequential Dump of Table (ttaad4226m000) session twice. Use the following settings for the first export:
Create Sequential Dump of Table (ttaad4226m000)
Field | Value
Company | 400-400
Package | aa-tf
Table | <empty> - zzz999
Suppress Error Messages | No
Drop Table after Dump | No
Create Fixed Length Records | No
Specify Field Separator | Yes
| (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. Step 4. Correct company numbers Run the Copy Company Data (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: switch to company 400 run the session with the following settings:
Copy Company Data (tccom0214m000)
Field | Value
Specify Field Separator | | (pipe)
Directory for Table Files | /tmp/400
Companies to Copy | Yes
400>600;401>601;402>602;403>603
Enterprise Units to Copy | No
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. Step 5. Import data into companies 600, 601, 602 and 603 Run the Create Table from Sequential Dump (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)
Field | Value
Create Tables for Different Company | Yes
600
Append if Table Exists | No
Delete Existing Tables | No
Create Rows before Index | Yes
Disable Domain Constraints | No
Ignore Referential Integrity Constraints | Yes
Specify Field Separators of Seq File | Yes
| (pipe)
Directory for Searching Table Files | /tmp/400
Pattern to Match Table Names | *
File to Store Table Names not Created | No
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. Step 6. Create missing tables for companies 600, 601, 602 and 603 Run the Create Tables (ttaad4230m000) session to create missing tables for the companies 600, 601, 602 and 603. Specify the following settings:
Create Tables (ttaad4230m000)
Field | Value
Company | 600 - 603
Package | <Empty> - zz
Table | <Empty> - zzz999
Step 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): Switch to the new target company. Run the Central Company to store Enterprise Modeler Data (tgbrg0100s000) session. Specify company 600 as the central DEM company. Step 8. Export version and model data Export version and model data from company 400 (the source central DEM company). Take the following steps: Switch to company 400. Run the Export Version Dump (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 Step 9. Import version and model data Import version and model data into company 600 (the target central DEM company). Take the following steps: Switch to company 600. Run the Import Version Dump (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 Step 10. Correct financial company number for enterprise units Correct the financial company number for enterprise units in the target multicompany structure. Switch to one of the target companies. Run the Enterprise Structure Models (tgbrg0512m000) session. Specify the current version (the version that was imported in step 9). The imported Enterprise Structure Model is displayed. Select the model and subsequently, on the Specific menu, click Enterprise Structure Model Browser. The enterprise units are displayed in a graphical browser. 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). Step 11. Specify operational enterprise structure model and version Specify the operational enterprise structure model and version for the target multicompany structure. Switch to company 600. Run the DEM Parameters (tgbrg0135s000) session Specify the operational enterprise structure model and the version (the model and the version that were imported in step 9). Step 12. Reorganize tables and repair reference counters Reorganize tables and repair reference counters for companies 600, 601, 602 and 603 Run the Reorganize Tables (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)
Field | Value
Company | 600 - 603
Package | <Empty> - zz
Table | <Empty> - zzz999
Data and Indices | No
Reference Integrity | Yes
Check Validity of Reference | No
Repair Reference Counter | Yes
All other check boxes | No
Related topics To copy a multicompany structure To copy a multicompany structure - Procedure details To set up a company – U8422A US |