Show TOC Entering content frame

Procedure documentation Generating Table Scripts Locate the document in its SAP Library structure

Use

You use this procedure to generate:

·        Table scripts to maintain IDES tables in synchronization with the CDB tables in the CRM server.

This graphic is explained in the accompanying text

You can generate table scripts for a set of tables or all the tables mapped to business document types in the CRM server.

·        Indexes, defined for the CDB tables in the CRM server, on the user database.

In addition, you can:

·        Save the scripts executed on the IDES database.

·        Preview the scripts before executing them on the IDES database.

This graphic is explained in the accompanying text

To preview the scripts, read access to the IDES database is sufficient.

Prerequisites

You must have:

·        A user ID with access rights of the system administrator on Microsoft SQL Server and DBOwner on the IDES database. You must also know the DSN name of the IDES database you want to connect to.

·        Read and write access to the registry. Set the user database login parameters in the registry.

·        A user ID and a password for the CRM server you want to connect to.

You must know the details of the CRM server you want to connect to.

This graphic is explained in the accompanying text

You can get the server details in the SAP Logon screen.

Procedure

...

       1.      On the Client Console screen, choose Action à Client Administration à Table Script Generation.

The Table Script Generation - CRM Middleware Connection screen appears.

This graphic is explained in the accompanying text

On the Customize Client Console screen, if you have selected the option Reuse Middleware Login and have already logged on to the server once in this session, the Table Script Generation screen appears. Continue with step 3.

       2.      Enter server details and login parameters and choose Connect.

The Table Script Generation screen appears.

       3.      Specify the table(s) for which you want to generate scripts.

If you select:

Then:

Append selections

You can select tables from more than one selection mode.

Selected Tables

You must manually select tables.

All Tables

All the tables are selected. You cannot deselect any table from the list.

From File

You must choose the file in which you have entered the list of table names.

This graphic is explained in the accompanying text

If you frequently generate scripts for a set of tables, enter the list of table names in a text file to reuse the list.

Advance Selection Criteria

You can specify advance selection conditions for selecting tables. For information on selection conditions, see Advance Selection Criteria for Tables.

       4.      Under Generate Scripts, select the required generate option.

If you select:

Then:

Tables and Indexes

Client Console generates scripts for the CDB tables and indexes (defined for the CDB tables).

Tables Only

Client Console generates scripts only for the CDB tables.

Indexes Only

Client Console generates scripts only for the indexes defined for the CDB tables.

This graphic is explained in the accompanying text

If you select Tables and Indexes or Indexes only option, you can specify further generation options for indexes under Index Option.

       5.      Under Index Option, select the required index generation option.

If you select:

Then:

All Indexes

Client Console generates scripts for all the indexes.

Delta Indexes

Client Console generates scripts to synchronize the indexes in the user database with the index definitions in the CRM server.

Modified Between

Client Console generates scripts for the indexes that are modified in the CRM server between the specified dates.

       6.      To create stored procedures in the mobile client, select Include Helper Scripts. These stored procedures are required to execute the table scripts on the IDES database.

       7.      To generate middleware tables, defined in the CDB, on the IDES database, select Generate Middleware Tables. These tables are used by ConnTrans for configuration, data transfer, and logging purposes.

This graphic is explained in the accompanying text

When you generate table scripts for the first time, you must select the options specified in steps 6 and 7.

       8.      To save the scripts on your system, select Log Scripts to File.

This graphic is explained in the accompanying text

By default, the scripts are logged in the TableIndexScripts.txtfile. To specify a different file name or path, enter the path of the file along with the file name or choose Ellipsis (next to the field) to select the log file.

       9.      To preview the scripts before executing them on the IDES database, choose Preview.

   10.      To execute the scripts on the user (IDES) database:

...

                            a.      Select Execute on user database (IDES).

                            b.      Enter the DSN, User ID, and Password to connect to the IDES database.

This graphic is explained in the accompanying text

The default DSN, user ID, and password of the IDES database is fetched from the registry.

                            c.      Choose Generate.

This graphic is explained in the accompanying text

You can generate table scripts only if you select Log Scripts to File or Execute on user database (IDES).

Result

If there was any change in a table in the CDB, Client Console first checks if the same table exists in the IDES database.

·        If the table exists, the changes are imposed on the IDES table.

This graphic is explained in the accompanying text

In case there are any incompatible changes, for example, change in data type, the column is dropped and newly created. In this case, the user data in that column is lost.

·        If the table does not exist, a new table is created in the user database with details as specified in the CDB.

Leaving content frame