dm bpd lookup content

74
SAP BusinessObjects Data Services 4.0 Sept 2011 English Lookup Content for Data Migration SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Business Process Documentation

Upload: talk2parimi

Post on 07-Nov-2014

313 views

Category:

Documents


12 download

TRANSCRIPT

Page 1: DM BPD Lookup Content

SAP BusinessObjects Data Services 4.0

Sept 2011

English

Lookup Content for Data Migration

SAP AGDietmar-Hopp-Allee 1669190 WalldorfGermany

Business Process Documentation

Page 2: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Copyright

© 2011 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the

express permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software

components of other software vendors.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft

Corporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z,

System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390,

OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+,

POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System

Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA,

AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks

of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks

of Adobe Systems Incorporated in the United States and/or other countries.

Oracle and Java are registered trademarks of Oracle.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks

or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web

Consortium, Massachusetts Institute of Technology.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer,

StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their

respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions,

Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well

as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd.

Business Objects is an SAP company.

Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and

services mentioned herein as well as their respective logos are trademarks or registered trademarks of

Sybase, Inc. Sybase is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data

contained in this document serves informational purposes only. National product specifications may

vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated

companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and

© SAP AGPage 2 of 37

Page 3: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP

Group products and services are those that are set forth in the express warranty statements accompanying such

products and services, if any. Nothing herein should be construed as constituting an additional warranty.

© SAP AGPage 3 of 37

Page 4: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Icons

Icon Meaning

Caution

Example

Note

Recommendation

Syntax

External Process

Business Process Alternative/Decision Choice

Typographic Conventions

Type Style Description

Example text Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options.

Cross-references to other documentation.

Example text Emphasized words or phrases in body text, titles of graphics, and tables.

EXAMPLE TEXT Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example, SELECT and INCLUDE.

Example text Screen output. This includes file and directory names and their paths, messages, source code, names of variables and parameters, as well as names of installation, upgrade, and database tools.

EXAMPLE TEXT Keys on the keyboard, for example, function keys (such as F2) or the ENTER key.

Example text Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation.

© SAP AGPage 4 of 37

Page 5: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

<Example text> Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries.

© SAP AGPage 5 of 37

Page 6: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Contents

1 Purpose............................................................................................................................. 5

2 Prerequisites...................................................................................................................... 5

3 Overview............................................................................................................................ 5

3.1 Job_DM_Lookups_Initialise........................................................................................6

3.2 Job_DM_Lookups_FileToApp....................................................................................6

3.3 Job_DM_Lookups_SAPToApp...................................................................................6

3.4 Job_DM_Lookups_SAPToFile....................................................................................6

4 Files used by the lookup jobs............................................................................................7

4.1.1 File structure........................................................................................................7

5 Specifying which lookup tables are populated.................................................................11

5.1 Load all lookup tables for specified objects based on values in a file.......................11

5.2 Load individual lookup tables based on values in a file............................................12

5.3 Load lookup tables based on values passed in at runtime.......................................13

6 Execution Steps...............................................................................................................13

6.1 Initialize SAP BPDM environment............................................................................14

6.2 SAP to File Lookup process.....................................................................................16

6.3 File to Application Lookup process...........................................................................18

6.4 SAP to Application Lookup process..........................................................................19

7 Re-executing jobs if an error occurs................................................................................22

7.1 Job_DM_Lookups_Initialise......................................................................................22

7.2 Job_DM_Lookups_FileToApp..................................................................................22

7.3 Job_DM_Lookups_SAPToApp and Job_DM_Lookups_SAPToFile.........................23

8 Troubleshooting...............................................................................................................24

9 Appendix.......................................................................................................................... 25

9.1 Overview of logic within lookup jobs.........................................................................25

9.1.1 Job_DM_Lookups_Initialise...............................................................................25

9.1.2 Job_DM_Lookups_FileToApp...........................................................................26

9.1.3 Job_DM_Lookups_SAPToApp..........................................................................28

9.1.4 Job_DM_Lookups_SAPToFile..........................................................................30

9.2 Frequently Asked Questions.....................................................................................32

9.3 Management Tables.................................................................................................33

© SAP AGPage 6 of 37

Page 7: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Lookup Content for Data Migration

1 PurposeThis document provides information on the Data Services jobs that are supplied with the Best Practices for Data Migration for the purposes of populating the lookup content (LKP_... tables). The lookup functionality is common to all Best Practices Data Migration solutions including; ERP, CRM and HCM.

2 Prerequisites1. Ensure that you have completed all steps specified in the relevant Data Migration Quick

Guide to set up the Data Services, BusinessObjects Enterprise and SAP environments for migration.

2. Open Data Services Designer. Open the project DM_BPFDM_Lookups and confirm that the following jobs exist:

Job_DM_Lookups_Initialise

Job_DM_Lookups_FileToApp

Job_DM_Lookups_SAPToApp

Job_DM_Lookups_SAPToFile

3 OverviewThe migration process involves moving data from legacy systems to the target SAP system. For some of the fields that are migrated, the target SAP system requires that the values transferred exist within a corresponding SAP configuration tables that is, loading Country Keys would require that the value exists in the Countries (T005) table. These fields are noted with a plus sign “+” in the IDOC mapping templates and within the Data Services object migration jobs. The BPDM process validates these columns to ensure that data is able to be loaded properly once transferred to SAP.

The existing legacy values may not be valid values in the target. To remedy the situation, you must map the existing legacy values to acceptable SAP values. BPDM facilitates this process by providing the web based Migration Services tool to manage the mapping of legacy values to their SAP equivalent. The Migration Services tool uses staged lookup tables that start with LKP_ as the basis for the mapping interface. These same lookup tables are used by Data Services at runtime to obtain the appropriate value for a given legacy value. The tables are used in the validation phase to ensure a mapping between legacy and SAP has been recorded and in the enrichment phase to actually convert the legacy value to the corresponding SAP value.

The Data Services jobs in the project DM_BPFDM_Lookups are utilized to create the framework for maintaining the lookup tables, load data into the tables, and update them as necessary. The management and lookup tables must be populated before you run the jobs that validate and migrate the object data.

© SAP AGPage 7 of 37

Page 8: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

The following are brief descriptions of the Data Services jobs:

3.1 Job_DM_Lookups_InitialiseJob_DM_Lookups_Initialise creates the lookup tables and imports the metadata for these tables into Data Services. It also creates auxiliary tables used to manage the process. This job does not load data into the staged lookup tables.

This is the first of the lookup jobs that should be executed. This job must be executed at least once for a migration project.

Note: All lookup tables (LKP_*) would be dropped and re-created if this job is executed. If you have already prepared data mappings in the Migration Services application, then these would be lost.

3.2 Job_DM_Lookups_FileToAppJob_DM_Lookups_FileToApp reads source files shipped with the BPDM content, and loads the data into the staged lookup tables created in Job_DM_Lookups_Initialise. The source files provided with BPDM contain the standard best practice content for each lookup table.

This is typically the second lookup job that is executed in a migration project. If no customization to the target SAP configuration tables has taken place, it is the only lookup job other than Job_DM_Lookups_Initialise that needs to be run.

3.3 Job_DM_Lookups_SAPToAppJob_DM_Lookups_SAPToApp is used to update the staged lookup tables with values from the target SAP system.

If customizations to the target SAP system’s configuration tables have been made, that is, new values added, then this job should be executed to update the lookup tables with the values in the SAP target system. The existing legacy value mapping in the lookup table would be maintained (that is, not removed) when this job is executed.

If ongoing customizations to the target are being made, this job should be executed to pull the changes into the staging tables on a regular basis, for example, nightly, weekly.

3.4 Job_DM_Lookups_SAPToFileJob_DM_Lookups_SAPToFile reads the values from the target SAP system configuration tables and stages the data in files on disk.

You can run this job if there is a need to extract customizations in the SAP target system to a file. If you do so and then want to get the data loaded to the staged lookup tables required for the BPDM process, then you would need to execute Job_DM_Lookups_FileToApp after this job.

In a typical scenario, you would not need to run this job even if you have customizations to the SAP configuration tables. You can execute Job_DM_Lookups_SAPToApp to directly update the staging tables.

This job is specifically designed for partners / customers that have created their own version of SAP configuration tables that would be reused on multiple project deployments. This job

© SAP AGPage 8 of 37

Page 9: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

allows for the creation of the lookup files to be used as a starting point for the data migration project rather than using the pre-delivered BPDM file set.

4 Files used by the lookup jobsThe following section details the use of files required or generated by the lookup content jobs.

All of these files are user-configurable, that is, they can be updated by the user to drive certain behavior of the lookup jobs (for example,: if you only wanted to load a subset of the Lookup tables). It is recommended you keep a backup of the original files.

File Name Usage Comment

LOOKUPS.csvJob_DM_Lookups_Initialise

Job_DM_Lookups_SAPToApp

Job_DM_Lookups_SAPToFile

Input files for Management tables

VIEW_TO_DF_NAME.csv

LOOKUP_WHERE_USED.csv

LOOKUP_TAB_STRUCTURE.csv

OBJECTS_RUNTIME.csv Job_DM_Lookups_FileToApp

Job_DM_Lookups_SAPToApp

Job_DM_Lookups_SAPToFile

The input files for generating runtime data in jobs

LOOKUPS_RUNTIME.csv

Log_<Job Name>_YYYYMMDDHHMISS.csv

Job_DM_Lookups_FileToApp

Job_DM_Lookups_SAPToApp

Job_DM_Lookups_SAPToFile

The output log files within folder Lookup_Log

Error_<Job Name>_YYYYMMDDHHMISS.csv

LKP_*.txt Job_DM_Lookups_FileToApp

Job_DM_Lookups_SAPToFile

Source data for the lookup tables (contains standard best practice content)

4.1.1 File structure

1. LOOKUPS.csv

LOOKUPS.csv provides source data for management tables and is utilized in Job_DM_Lookups_Initialise. The file describes general information about lookup tables and is a source for tables MGMT_LOOKUP_LIST and MGMT_LOOKUPS tables.

Field Name Data Type Comment

LKPTAB_NAME Varchar(255) Lookup table name

LKPTAB_DESCRIPTION Varchar(255) Description

CHKTAB_NAME Varchar(255) Check table from SAP system

TXTTAB_NAME Varchar(255) Text table from SAP system

© SAP AGPage 9 of 37

Page 10: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Field Name Data Type Comment

LKPTAB_MAINKEY Varchar(255) Main field in lookup table

LKPTAB_LEGACY_FIELD Varchar(255) Legacy field

DOMAIN Varchar(255) Domain name if lookup table for domain

STATUS Varchar(255)

PACKAGE Varchar(255)

COMMENTS Varchar(255)

RELEASED_ON Varchar(255) Release date

2. VIEW_TO_DF_NAME.csv

VIEW_TO_DF_NAME.csv provides source data for management tables and is utilized in Job_DM_Lookups_Initialise. This file describes the hierarchy mapping relationship between business contents and IDoc jobs. The file correlates Data Services Jobs and Data Flows that validate the data to the associated IDoc segments for each object that can be migrated. This information is required for the data profiling facilities in the jobs, whereas the incoming data in the mapping tables is profiled to aid the mapping exercise in the Migration Services application. Note that if you make changes to the job, workflow, or dataflow names, you would need to update this table and rerun some sections of the job.

Field Name Data Type Comment

ID Varchar(255) Sequencial number

VIEW_NAME Varchar(255) IDOC Segment name (for example, Customer Basic Data)

DF_NAME Varchar(255) Related data flow name in Data Services (for example, DF_DM_CustomerMasterBasicData_Validate)

OBJECT_NAME Varchar(255) Object name (for example, CUSTOMER)

JOB_NAME Varchar(255) Job name (for example, Job_DM_CustomerMaster_IDOC)

3. LOOKUP_WHERE_USED.csv

LOOKUP_WHERE_USED.csv provides source data for management tables MGMT_LOOKUP_WHERE_USED and MGMT_VIEWS_LOOKUPS in Job_DM_Lookups_Initialise. For each lookup table, it lists the associated Object and validation Data Flow.

© SAP AGPage 10 of 37

Page 11: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Field Name Data Type Comment

OBJECT_NAME Varchar(255) Object name

DF_NAME Varchar(255) Data flow name

LKPTAB_NAME Varchar(255) Lookup table name

COMMENTS Varchar(255)

RELEASED_ON Varchar(255) Release date

4. LOOKUP_TAB_STRUCTURE.csv

LOOKUP_TAB_STRUCTURE.csv provides source data for management table MGMT_LOOKUP_TAB_STRUCTURE in Job_DM_Lookups_Initialise. The file details the structure of the lookup tables.

Field Name Data Type Comment

LKPTAB_NAME Varchar(255) Lookup table name

LKPTAB_FIELD_POSITION Int Field position in lookup table

LKPTAB_FIELD_NAME Varchar(255) Field name

LKPTAB_FIELD_DATATYPE

Varchar(255) Data type

LKPTAB_FIELD_LENGTH Varchar(255) Length

LKPTAB_FIELD_DESC Varchar(255) Description

LKPTAB_KEY_IND Varchar(255) key in the lookup table name

LKPTAB_MAINKEY_IND Varchar(255) Main field flag

CHKTAB_NAME Varchar(255) Check table name from SAP system

CHKTAB_FIELD_NAME Varchar(255) Field name in check table

CHKTAB_KEY_IND Varchar(255) Whether key in check table

TXTTAB_NAME Varchar(255) Text table name from SAP system

TXTTAB_FIELD_NAME Varchar(255) Field name in text table

TXTTAB_LANG_FIELD Varchar(255) Language key in text table

TXTTAB_KEY_IND Varchar(255) Whether key in text table

DOMAIN Varchar(255) Domain name

FLAG Varchar(255) Flag for lookup table fields

CHK_TAB_CONDITIONS Varchar(255) Conditions when extracting data from check table

© SAP AGPage 11 of 37

Page 12: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Field Name Data Type Comment

TXT_TAB_CONDITIONS Varchar(255) Conditions when extracting data from text table

STATUS Varchar(255) Released or not

PACKAGE Varchar(255) Project package

COMMENTS Varchar(255) Comments

RELEASED_ON Varchar(255) Release date

5. OBJECTS_RUNTIME.csv

OBJECTS_RUNTIME.csv is a source in jobs Job_DM_Lookups_FileToApp, Job_DM_Lookups_SAPToApp, and Job_DM_Lookups_SAPToFile. It lists all migration objects and a flag for each of the above jobs, indicating if the lookup tables/files for that object should be considered for loading when the job is executed.

Field Name Data Type Comment

PACKAGE Varchar(255) Project package

OBJECT_NAME Varchar(255) Object name

RUN_FileToAPP Varchar(255) Flag to run Job_DM_Lookups_FileToApp

RUN_SAPtoFile Varchar(255) Flag to run Job_DM_Lookups_SAPToFile

RUN_SAPtoAPP_Delta Varchar(255) Flag to run Job_DM_Lookups_SAPToApp

6. LOOKUPS_RUNTIME.csv

LOOKUPS_RUNTIME.csv is a source in jobs Job_DM_Lookups_FileToApp, Job_DM_Lookups_SAPToApp, and Job_DM_Lookups_SAPToFile. It lists all lookup tables and a flag for each of the above jobs, indicating if the lookup tables/files for that object should be considered for loading when the job is executed.

Field Name Data Type Comment

LKP_TABLE_NAME Varchar(255) Lookup table name

RUN_FileToAPP Varchar(255) Flag to run Job_DM_Lookups_FileToApp

RUN_SAPtoFile Varchar(255) Flag to run Job_DM_Lookups_SAPToFile

RUN_SAPtoAPP_Delta Varchar(255) Flag to run Job_DM_Lookups_SAPToApp

7. Log_<Job Name>_YYYYMMDDHHMISS.csv

Log file would be generated when job is complete successfully.

© SAP AGPage 12 of 37

Page 13: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Field Name Data Type Comment

JOB_NAME Varchar(255) Lookup content job

OBJECT_NAME Varchar(255) Object name

VIEW_NAME Varchar(255) Segment name

LKP_TABLE_NAME Varchar(255) Lookup table name

START_TIME Varchar(24) Start time of lookup table

FINISH_TIME Varchar(24) Finish time of lookup table

STATUS Varchar(255) comment

8. Error_<Job Name>_YYYYMMDDHHMISS.csv

Error log would be generated when job dumps.

Field Name Data Type Comment

LKP_TABLE_NAME Varchar(255) Lookup table name

RUN_FileToAPP Varchar(255) Flag to run Job_DM_Lookups_FileToApp

RUN_SAPtoFile Varchar(255) Flag to run Job_DM_Lookups_SAPToFile

RUN_SAPtoAPP_Delta Varchar(255) Flag to run Job_DM_Lookups_SAPToApp

START_TIME Varchar(24) Start time of lookup table

FINISH_TIME Varchar(24) Finish time of lookup table

STATUS Varchar(255) comment

ERROR_MESSAGE Varchar(512) Error message

5 Specifying which lookup tables are

populatedJobs Job_DM_Lookups_FileToApp and Job_DM_Lookups_SAPToApp load data to the lookup tables in the staging area. Job Job_DM_Lookups_SAPToFile extracts data from SAP and loads it to files on disk. For each of the jobs, you could load all lookup tables/files or you could choose to extract / load a subset. Each of the jobs above contains the same set of global variables that you can utilize to determine which lookup tables or files are populated.

5.1 Load all lookup tables for specified objects based

on values in a file$G_GetDataFromObjectList

Indicates whether or not you want to process lookup tables/files based upon migration objects. If you set the value for this global variable to ’Y‘, it would utilize the file defined for

© SAP AGPage 13 of 37

Page 14: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

$G_Runtime_ObjectListFile_Name and load all lookup tables associated with the objects that have the flag set to ‘Y‘.

$G_Runtime_ObjectListFile_Name

Set this to the file that contains the list of objects that should be processed. The file contains an entry for each object and whether or not the object should be processed. The default value is OBJECTS_RUNTIME.csv. The file you select for this global variable must exist in the directory that global variable $G_Path is initialized to.

Example:

You are going to migrate the CUSTOMER object. If you were only interested in populating the lookup tables/files required for this object.

1) Modify OBJECTS_RUNTIME.csv and set the flag for object CUSTOMER to ‘Y’. All other objects should be set to ‘N’. Set the flag in the column for the job you are

going to execute.

2) Set $G_GetDataFromTXTFile and $G_GetDataFromVariable to ‘N’

3) Set $G_GetDataFromObjectList to ‘Y’

4) Ensure the value of $G_Runtime_ObjectListFile_Name is set to ‘OBJECTS_RUNTIME.csv‘

5.2 Load individual lookup tables based on values in a

file

$G_GetDataFromTXTFile

Indicates whether or not you want to process lookup tables/files based upon a flag in a file. If you set the value for this global variable to ’Y‘, it would utilize the file defined for $G_Runtime_TxtFile_Name and load all lookup tables that have the flag set to ’Y‘.

$G_Runtime_TxtFile_Name

Set this to the file that contains the list of lookup tables that should be processed. The file contains an entry for each lookup table and whether or not the object should be processed. The default value is LOOKUPS_RUNTIME.csv. LOOKUPS_RUNTIME.csv contains an entry for all lookup tables required for BPDM and by default flags are set to ’Y‘. The file you select

for this global variable must exist in the directory that global variable $G_Path is initialized to.

Example:

You are going to migrate many objects and would need to load most if not all of the lookup tables.

© SAP AGPage 14 of 37

Page 15: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

1) If necessary, Modify LOOKUPS_RUNTIME.csv and set the flag for lookup tables that are not required to ‘N’. All other lookup tables should be set to ‘Y’, their default

value. Set the flag in the column for the job you are going to execute.

2) Set $G_GetDataFromObjectList and $G_GetDataFromVariable to ‘N’

3) Set $G_GetDataFromTXTFile to ‘Y’

4) Ensure the value of $G_Runtime_TxtFile_Name is set to ‘LOOKUPS_RUNTIME.csv‘

5.3 Load lookup tables based on values passed in at

runtime

$G_GetDataFromVariable

Indicates whether or not you want to process lookup tables/files based upon values passed in through a global variable. If you set the value for this global variable to ’Y‘, it would utilize

the value defined for $G_ObjectAndLookupAndChkTable.

$G_ObjectAndLookupAndChkTable

Specifies the object or lookup tables you want to load. If you enter an object, all associated lookup tables are loaded. You may enter more than one object or lookup table by separating the values with commas.

Example:

You are migrating multiple objects and have populated most of the lookup staging tables using the job Job_DM_Lookups_FileToApp. However, there was an error while loading the data for the lookup table LKP_ACTIVITY_TYPE. You want to execute the job again, but only load the data for LKP_ACIVITY_TYPE.

1) Set $G_GetDataFromTXTFile and $G_GetDataFromObjectList to ‘N’

2) Set the variable $G_GetDataFromVariable to ‘Y’

3) Set $G_ObjectAndLookupAndChkTable to ‘LKP_ACTIVITY_TYPE’

6 Execution StepsThis section reviews the steps for executing each of the lookup jobs.

You can increase the flexibility and reusability of Jobs, Work Flows, and Data Flows by using local and global variables when you design your jobs. Variables are symbolic placeholders for values. The data type of a variable can be any supported by the software such as integers, decimals, dates, or text strings. Each of the lookup jobs makes use of global variables. The default values are listed for each job and they may be adjusted to meet your needs.

© SAP AGPage 15 of 37

Page 16: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

6.1 Initialize SAP BPDM environment

Objective

In this activity, you would initialize all tables associated with lookup jobs and upload the prerequisite data to the management tables by executing Job_DM_Lookups_Initialise. The job also creates the lookup tables and imports them into Data Services.

This job would delete any existing lookup tables, re-create them and then import them into Data Services.

Prerequisites

The following files must be ready in the path <$G_Path>.

1. LOOKUPS.csv

2. VIEW_TO_DF_NAME.csv

3. LOOKUP_WHERE_USED.csv

4. LOOKUP_TAB_STRUCTURE.csv

Procedure

1. Logon in Data Services Designer, from the Project Area, right-click on job Job_DM_Lookups_Initialise and choose Execute. If you get a prompt whether you would like to save all changes and execute, choose OK.

2. On the Execution Properties dialog box, choose the Global Variable tab to review the existing values and make changes if required.

Note that if you are not using Windows Authentication then you must supply the correct username for $G_Repo_Username and password for $G_Repo_Password.

Name Data Type Description Default Value

$G_Path Varchar(255) The directory where the lookup text files are held.

‘C:\\Migration’

$G_MGMTtables_Create Varchar(1) Initialize all the tables ‘Y’

$G_PopulateLookups Varchar(1) Populate table MGMT_LOOKUPS, MGMT_LOOKUP_LIST

‘Y’

$G_PopulateViewToDF Varchar(1) Populate table MGMT_VIEWS, MGMT_VIEW_TO_DF_NAME

‘Y’

© SAP AGPage 16 of 37

Page 17: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Name Data Type Description Default Value

$G_PopulateLookupWhereUsed Varchar(1) Populate tables MGMT_LOOKUP_WHERE_USED and MGMT_VIEWS_LOOKUPS

‘Y’

$G_PopulateLookupTableStructure

Varchar(1) Populate table MGMT_LOOKUP_TAB_STRUCTURE

‘Y’

$G_Lookuptable_CreateImport Varchar(1) Create lookup table and import into Data Service

‘Y’

$G_LookuptableName_RecreateReimport

Varchar(1024)

The lookup tables you want to create and import. Separate multiple entries using a comma as the delimiter

$G_MigrationServices_ProfilingConfig

Varchar(1) Populate the data profiling tables used by Migration Services

‘Y’

$G_Repo_Server Varchar(128) Name of the repository server

$G_Repo_Username Varchar(128) Name of repository username

$G_Repo_Password Varchar(128) Repository password which would be used for importing lookup table

Uses the repository user name as password if it is NULL.

$G_Repo_Name Varchar(128) Name of the repository database

$G_Table_Count Int SAP Internal Variable

If global variable $G_Lookuptable_CreateImport is set to ‘Y’ and $G_LookuptableName_RecreateReimport is null, all the lookup tables which have their structure in the file LOOKUP_TAB_STRUCTURE.csv would be created in the DB and imported into Data Services.

3. Choose OK.

© SAP AGPage 17 of 37

Page 18: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Result

The management tables are created and populated. The lookup tables are created in the staging database and their definitions imported into Data Services.

6.2 SAP to File Lookup process

Use

In this activity, you would extract lookup table data from the SAP target system and load it to text files by executing job Job_DM_Lookups_SAPToFile.

Prerequisites

The Data Services datastore definition for DS_SAP must be configured to point to your SAP target system.

You would have to decide which lookup tables you want to create files for.

Procedure

1. Log on in Data Services Designer. From the Project Area, right-click on job Job_DM_Lookups_SAPToFile and choose Execute. If you get a prompt whether you would like to save all changes and execute, choose OK.

2. On the Execution Properties dialog box, choose the Global Variable tab to review the existing values and make changes if required.

You would need to ensure that $G_Path is set to the directory where you would write out the lookup files.

You would need to set the global variables to extract and load data for the lookup files you require. Review the section Specifying which lookup tables are populated for additional information.

Name Data Type Description Default Value

$G_Path Varchar(255) The directory you work in

$G_Global_Language Varchar(1) Global language key ‘E’

$G_Local_Language Varchar(1) Local language key ‘D’

$G_Default_String Varchar(1) Legacy field default value

‘K’

$G_GetDataFromObjectList Varchar(1) Indicator whether to load lookups based on objects in a file.

‘N’

$G_Runtime_ObjectListFile_Name

Varchar(255) Object list file name 'OBJECTS_RUNTIME.csv'

© SAP AGPage 18 of 37

Page 19: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Name Data Type Description Default Value

$G_GetDataFromTXTFile Varchar(1) Indicator whether to load lookups based on lookup table name in a file.

‘Y’

$G_Runtime_TxtFile_Name Varchar(255) Lookup table list file name

'LOOKUPS_RUNTIME.csv'

$G_GetDataFromVariable Varchar(1) Indicator whether get data from global variable

‘N’

$G_ObjectAndLookupAndChkTable

Varchar(1024)

Object or lookup table name (separate with comma)

$G_CompanyCode Varchar(255) Company code ‘1000,1010’

$G_ChartOfAccounts Varchar(255) Chart of accounts ‘0010’

$G_ControllingArea Varchar(255) Control area ‘1000’

$G_RunTimeData_Delete Varchar(1) Indicator to delete run time data

‘N’

$G_ExtNumberRangeSetup Varchar(1) Indicator whether to create file DEFAULT_NUMBER_RANGES.TXT.

Set to 'Y' if you are using ERP package,otherwise set to 'N'

‘N’

$G_IdocStatusLookup Varchar(1) Indicator whether to create file LKP_MGMT_IDOCSTATUS.TXT.

‘Y’

Others – SAP Internal use only

Global variables $G_Runtime_ObjectListFile_Name, $G_Runtime_TxtFile_Name, $G_ObjectAndLookupAndChkTable work only when the corresponding indicator is set to ‘Y’.

3. Choose OK.

Result

Lookup text files are created in the path <$G_Path>.

© SAP AGPage 19 of 37

Page 20: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Log file Log_Job_DM_Lookups_SAPToFile_YYYYMMDDHHMISS.csv would be generated in folder <$G_Path>\Lookup_Log if the job is completed successfully.

6.3 File to Application Lookup process

Use

In this activity, you would upload the data in the lookup text files to the lookup tables in the staging database by executing job Job_DM_Lookups_FileToApp.

Prerequisites

Job Job_DM_Lookups_Initialise must be run prior to executing this job.

You would have to decide which lookup tables you want to populate.

Procedure

1. Log on in Data Services Designer. From the Project Area, right-click on job Job_DM_Lookups_FileToApp and choose Execute. If you get a prompt whether you would like to save all changes and execute, choose OK.

2. On the Execution Properties dialog box, choose the Global Variable tab to review the existing values and make changes if required.

You would need to ensure that $G_Path is set to the directory that contains the source lookup files.

You would need to set the global variables to extract and load data for the lookup tables you want to populate. Review the section Specifying which lookup tables are populated for additional information.

Name Data Type Description Default Value

$G_Path Varchar(255) The directory you work in

‘C\\Migration’

$G_GetDataFromObjectList Varchar(1) Indicator whether to load lookups based on objects in a file.

‘N’

$G_Runtime_ObjectListFile_Name

Varchar(255) Object list file name ‘'OBJECTS_RUNTIME.csv' ‘

© SAP AGPage 20 of 37

Page 21: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Name Data Type Description Default Value

$G_GetDataFromTXTFile Varchar(1) Indicator whether to load lookups based on lookup table name in a file.

‘Y’

$G_Runtime_TxtFile_Name Varchar(255) Lookup table list file name

'LOOKUPS_RUNTIME.csv'

$G_GetDataFromVariable Varchar(1) Indicator whether get data from global variable

‘N’

$G_ObjectAndLookupAndChkTable

Varchar(1024)

Object or lookup table name (separate with comma)

$G_Resume_Flag Varchar(1) Resume loading indicator

‘N’

$G_ExtNumberRangeSetup Varchar(1) Indicator whether to populate table MGMT_NUMBER_RANGES.

Set to 'Y' if you are using ERP package,otherwise set to 'N'

‘Y’

$G_IdocStatusLookup Varchar(1) Indicator whether to populate table LKP_MGMT_IDOCSTATUS.

‘Y’

Others – SAP Internal use only

Global variables $G_Runtime_ObjectListFile_Name, $G_Runtime_TxtFile_Name, $G_ObjectAndLookupAndChkTable work only when the corresponding indicator is set to ‘Y’.

3. Choose OK.

Result

Lookup table data is uploaded to the database.

Log file Log_Job_DM_Lookups_FileToApp_YYYYMMDDHHMISS.csv would be generated in folder <$G_Path>\Lookup_Log if the job is completed successfully.

© SAP AGPage 21 of 37

Page 22: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

6.4 SAP to Application Lookup process

Use

The job Job_DM_Lookups_SAPToApp provides logic to import any changes to the configuration data in the SAP application. This job is only required once the target SAP application is installed and configured with changes (either new code or text changes) to the standard delivered SAP Best Practices Baseline configuration. The job extracts the latest configuration table contents from the SAP system and joins it back to the already populated lookup mapping tables in the lookup maintenance application and underlying database structure.

Prerequisites

Job Job_DM_Lookups_Initialise must be run prior to executing this job.

The Data Services datastore definition for DS_SAP must be configured to point to your SAP target system.

You would have to decide which lookup tables you want to populate.

Procedure

1. Log on in Data Services Designer. From the Project Area, right-click on job Job_DM_Lookups_SAPToApp and choose Execute. If you get a prompt whether you would like to save all changes and execute, choose OK.

2. On the Execution Properties dialog box, choose the Global Variable tab to review the existing values and make changes if required.

You would need to ensure that $G_Path is set to the directory that contains the source lookup files.

You would need to set the global variables to extract and load data for the lookup tables you want to populate. Review the section Specifying which lookup tables are populated for additional information.

Name Data Type Description Default Value

$G_Path Varchar(255) The directory you work in

$G_Global_Language Varchar(1) Global language key ‘E’

$G_Local_Language Varchar(1) Local language key ‘D’

$G_Default_String Varchar(1) Legacy field default value

‘K’

© SAP AGPage 22 of 37

Page 23: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Name Data Type Description Default Value

$G_GetDataFromObjectList Varchar(1) Indicator whether to load lookups based on objects in a file.

‘N’

$G_Runtime_ObjectListFile_Name

Varchar(255) Object list file name ‘'OBJECTS_RUNTIME.csv' ‘

$G_GetDataFromTXTFile Varchar(1) Indicator whether to load lookups based on lookup table name in a file.

‘Y’

$G_Runtime_TxtFile_Name Varchar(255) Lookup table list file name

'LOOKUPS_RUNTIME.csv'

$G_GetDataFromVariable Varchar(1) Indicator whether get data from global variable

‘N’

$G_ObjectAndLookupAndChkTable

Varchar(1024)

Object or lookup table name (separate with comma)

$G_CompanyCode Varchar(255) Company code ‘1000,1010’

$G_ChartOfAccounts Varchar(255) Chart of accounts ‘0010’

$G_ControllingArea Varchar(255) Control area ‘1000’

$G_RunTimeData_Delete Varchar(1) Indicator to delete run time data

‘N’

$G_ExtNumberRangeSetup Varchar(1) Indicator whether populate table MGMT_NUMBER_RANGES.

Set to 'Y' if you are using ERP package,otherwise set to 'N'

‘N’

$G_IdocStatusLookup Varchar(1) Indicator whether populate table LKP_MGMT_IDOCSTATUS.

‘Y’

Others – SAP Internal use only

© SAP AGPage 23 of 37

Page 24: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Global variables $G_Runtime_ObjectListFile_Name, $G_Runtime_TxtFile_Name, $G_ObjectAndLookupAndChkTable work only when the corresponding indicator is set to ‘Y’.

3. Choose OK.

Result

Lookup table data in the database is synchronized with the SAP target system.

Log file Log_Job_DM_Lookups_SAPToApp_YYYYMMDDHHMISS.csv would be generated in folder <$G_Path>\Lookup_Log if the job is completed successfully.

7 Re-executing jobs if an error occursWhen you execute a lookup job and everything runs smoothly you simply move on to the next step in the migration process. However, there are times when errors occur while Data Services is processing a job. For example, a job may be executing fine and then you run out of table space in the database or there may be a communication error.

This section would go through each of the jobs and give you insight on how to re-execute the jobs once the error is corrected.

7.1 Job_DM_Lookups_InitialiseThis job either re-creates tables or deletes any existing data in the tables when it is executed. If you run into an error while executing this job correct the root cause of the error. On the next run, simply re-execute the job. You would not have to worry about causing any data related issues from a previous partial run.

7.2 Job_DM_Lookups_FileToAppThe job starts off by loading the list of lookup tables that need to be loaded to the staging table LOOKUP_RUNTIME_FILETOAPP. The bulk of the processing in this job is loading the data from the source files to the lookup tables. This processing takes place in a loop that processes each lookup table one at a time. The above processing occurs within a Try/Catch block in Data Services.

If an error occurs while Data Services is looping through the loading of the lookup tables you can re-execute the job and pick up where the job left off once the issue that caused the error is resolved.

© SAP AGPage 24 of 37

Page 25: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

There are two options for re-executing the job in this manner:

1) On the next execution, set the global variable $G_Resume_Flag = 'Y'. With this setting, Data Services would continue loading the lookup tables where it left off in the previous execution. If the lookup table was partially loaded in the previous run it would be truncated before data is sent to it in the current execution.

2) Error_<Job Name>_YYYYMMDDHHMISS.csv would be generated in folder <$G_Path>\Lookup_Log if the job is terminated due to an error. This error log file can be used to resume the job for the lookups which are not completed by performing the following steps:

1. Copy the error log file Error_<Job Name>_YYYYMMDDHHMISS.csv from <$G_Path>\Lookup_Log to <$G_Path>

2. Set $G_GetDataFromObjectList and $G_GetDataFromVariable to ‘N’

3. Set $G_GetDataFromTXTFile to ‘Y’

4. Ensure the value of $G_Runtime_TxtFile_Name is set to ‘Error_<Job Name>_YYYYMMDDHHMISS.csv ‘

After the lookup tables are processed an optional component to process external number ranges would be executed if you set the global variable $G_ExtNumberRangeSetup = 'Y'. This processing step can be re-executed without data concerns as it truncates the target table before each run.

7.3 Job_DM_Lookups_SAPToApp and

Job_DM_Lookups_SAPToFileThe processing in these jobs is similar and the recovery framework is the same. One job loads data to staging lookup tables and the other to staged lookup files.

The processing to load the data occurs within a loop and is enclosed in a Try/Catch block.. There are multiple management tables that are used to control the loading process. If an error occurs and is caught by Data Services the Catch block would delete the entries in these management tables from that run. In this scenario you simply execute the job again once the root cause of the error is corrected.

If Data Services is unable to catch the error, then you need to set the global variable $G_RunTimeData_Delete = 'Y'. This would ensure that processing to delete the data from the management tables occurs.

In either scenario above, the target lookup table or file has the data deleted before loading so partial loads from a previous run are not a concern.

© SAP AGPage 25 of 37

Page 26: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

For these jobs if you re-execute them they would try to process all of the lookup tables or files again. The re-execution of the job does not pick up where the previous execution left off. If you want to selectively load lookup tables or files, then you should adjust the candidate list of lookup tables/files to process. Review the section Specifying which lookup tables are populated for further information.

After the lookup tables are processed an optional component to process external number ranges would be executed if you set the global variable $G_ExtNumberRangeSetup = 'Y'. This processing step can be re-executed without data concerns as it truncates the target table before each run.

Error_<Job Name>_YYYYMMDDHHMISS.csv would be generated in folder <$G_Path>\Lookup_Log if the job is terminated due to the error,

This error log file can be used to resume the job for the lookups which are not completed by performing the following steps:

1. Copy the error log file Error_<Job Name>_YYYYMMDDHHMISS.csv from <$G_Path>\Lookup_Log to <$G_Path>

2. Set $G_GetDataFromObjectList and $G_GetDataFromVariable to ‘N’

3. Set $G_GetDataFromTXTFile to ‘Y’

4. Ensure the value of $G_Runtime_TxtFile_Name is set to ‘Error_<Job Name>_YYYYMMDDHHMISS.csv ‘

8 Troubleshooting Error information and solutions

When error occurs, error log would be created in the folder <$G_Path>\Lookup_Log, and named Error_<Job Name>_<YYYYMMDDHHMISS>.csv.

Some errors as follows:

1. ODBC data source <SERVER NAME> error message for operation <SQLExecute>: <[Microsoft][ODBC SQL Server Driver][SQL Server]Transaction (Process ID xx) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.>

We may get this error when too much parallel jobs run in the same time. You can make the log file name as the value of variable $G_Runtime_TxtFile_Name to rerun the job.

2. Lookup table <Lookup Table> has no structure data in table MGMT_LOOKUP_TAB_STRUCTURE.

Check and update lookup table structure.

3. The job is terminated due to the wrong RFC function call, check the structure of lookup table <Lookup Table> in table MGMT_LOOKUP_TAB_STRUCTURE.

Check and update lookup table structure.

© SAP AGPage 26 of 37

Page 27: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

9 Appendix

9.1 Overview of logic within lookup jobsThe descriptions below are not meant to be all inclusive, additional functionality may be included in the objects. These descriptions are provided to give an overview of the main processing that takes place.

9.1.1 Job_DM_Lookups_Initialise

Job_DM_Lookups_Initialise creates the lookup tables and imports them into Data Services. It also creates auxiliary tables used to manage the process. It is mandatory that this be the first lookup job that is executed because it creates the table structures required for all other lookup jobs.

There are 7 sections of the job which are enclosed in conditionals. The default would be to set the global variables so that each conditional is run.

Conditional MGMTtables_Create

Creates the most of the MGMT tables using template tables and row generation. It does not load data to the tables.

Conditional PopulateLookups

Loads data into MGMT_LOOKUP_LIST and MGMT_LOOKUPS using LOOKUPS.csv. MGMT_LOOKUP_LIST is direct mapping from the values in LOOKUPS.csv.

Conditional PopulateViewToDF

Loads tables MGMT_VIEW_TO_DF_NAME and MGMT_VIEWS.

MGMT_VIEW_TO_DF_NAME is a direct mapping from the values in VIEW_TO_DF_NAME.csv

Conditional PopulateLookupWhereUsed

Loads tables MGMT_LOOKUP_WHERE_USED and MGMT_VIEWS_LOOKUPS using LOOKUP_WHERE_USED.csv as the source.

Conditional PopulateLookupTableStructure

Loads table MGMT_LOOKUP_TAB_STRUCTURE

MGMT_LOOKUP_TAB_STRUCTURE is a direct mapping from the values in LOOKUP_TAB_STRUCTURE.csv.

Conditional Lookuptable_CreateImport

Data Flow DF_DM_Lookups_Lookuptable_CreateImport_SQL

© SAP AGPage 27 of 37

Page 28: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Creates table LOOKUP_TAB_CREATION from MGMT_LOOKUP_TAB_STRUCTURE.

Data Flow DF_DM_Lookups_Lookuptable_ToBeCreatedImported

Loads table LOOKUP_CREATED_AND_IMPORTED with distinct table names from MGMT_LOOKUPS.

Data Flow DF_DM_Lookups_Created_Imported

Creates the lookup tables by using custom functions Tool_Create_Lookup_Table and XML_Return_Concatenated_value. Reads from LOOKUP_CREATED_AND_IMPORTED.

Imports tables into Data Services using custom function Tool_Import_Lookup_Table.

Note: it does not load data into the tables, just creates them.

Conditional MigrationServicesProfilingConfig

Script SCR_Force_CalculateColumnMappings

Sets Data Services repository tables to indicate calculate column mappings has not been completed and then it executes the Data Services al_engine command to calculate the column mappings.

Data Flow DF_DM_Autopop_MGMT_PROFILE_MAP

Creates table MGMT_PROFILE_MAP which is a direct mapping from the values in View_to_DF_Name.csv.

Data Flow DF_DM_Populate_TEMP_PROFILE_HDR

Backup data from table MGMT_PROFILE_HDR to TEMP_PROFILE_HDR before overwrite it.

Data Flow DF_DM_Autopop_MGMT_PROFILE_HDR

Creates table MGMT_PROFILE_HDR from various management tables and Data Services repository tables.

9.1.2 Job_DM_Lookups_FileToApp

This job loads the staging lookup tables (all starting with LKP_) utilizing data in lookup files (all starting with LKP_).

Script SCR_Initialise

Initializes global variables to default values

Includes LKP_MGMT_IDOCSTATUS as a table to load if $G_IDocStatusLookup = ‘Y’

Prints out messages to the Data Services log file

Creates $G_PATH\ Lookup_Log if it does not exist.

© SAP AGPage 28 of 37

Page 29: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Conditional Con_RunTime_FileToApp

A conditional that executes DF_DM_Lookups_RunTime_FileToApp if $G_Resume_Flag <> 'Y'

Data Flow DF_DM_Lookups_RunTime_FileToApp

Loads data to the staging table LOOKUP_RUNTIME_FILETOAPP. LOOKUP_RUNTIME_FILETOAPP contains a list of LKP_ tables to populate based on the settings of $G_GetDataFromObjectList, $G_GetDataFromVariable and $G_GetDataFromTXTFile

Script SCR_Loop_Initial

Initializes global variables that are utilized to loop through the loading of the lookup tables.

Raises an exception if no entries exist in LOOKUP_RUNTIME_FILETOAPP.

Checks to ensure that MGMT_LOOKUP_TAB_STRUCTURE has an entry for the lookup table and throws an error if it does not.

Loop_FileToApp

A conditional that loops through every table in LOOKUP_RUNTIME_FILETOAPP

Script SCR_Init_And_Log

Initializes the source file so that it is in synch with the target lookup table.

Performs some error checking and prints statements to the Data Services log file.

Data Flow DF_DM_Lookup_FileToTemp

Loads the data in the source file to the staging table LOOKUP_TABLE_TEMP.

Script SCR_DataPop_And_Ressign

Deletes any data in the target lookup table

Loads the lookup table by reading from LOOKUP_TABLE_TEMP

Resets variables to the next value by increasing the row number and getting values from LOOKUP_RUNTIME_FILETOAPP

$L_LKP_Table_Name

$L_Object_Name

$L_View_Name

Data Flow DF_DM_Lookups_Log_FileToApp

Writes logging information to the log file

Conditional ExtNumberRangeSetup

If $G_ExtNumberRangeSetup = 'Y' executes DF_DM_ObjectNumbering_FileToApp

Data Flow DF_DM_ObjectNumbering_FileToApp

© SAP AGPage 29 of 37

Page 30: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Loads the data from DEFAULT_NUMBER_RANGES.txt to MGMT_NUMBER_RANGES

Script SCR_Terminate

Truncates the data in LOOKUP_RUNTIME_FILETOAPP

9.1.3 Job_DM_Lookups_SAPToApp

This job updates the lookup tables by obtaining values from the target SAP ECC server.

SCR_Initialise

Initializes global variables to default values

Includes LKP_MGMT_IDOCSTATUS as a table to load if $G_IDocStatusLookup = ‘Y’

Prints out messages to the Data Services log file

Creates $G_PATH\ Lookup_Log if it does not exist.

If $G_RunTimeData_Delete = 'Y' it would truncate the management staging tables that are used in this job to control the processing of the lookup tables.

Data Flow DF_DM_Lookups_RunTime_SAPToApp

Loads data to the staging table LOOKUP_RUNTIME_SAPTOAPP. LOOKUP_RUNTIME_SAPTOAPP contains a list of LKP_ tables to populate based on the settings of $G_GetDataFromObjectList, $G_GetDataFromVariable and $G_GetDataFromTXTFile.

Script SCR_Loop_Initial

Initializes global variables that are utilized to loop through the loading of the lookup tables.

Raises an exception if no entries exist in LOOKUP_RUNTIME_SAPTOAPP.

Checks to see if another execution of the job is processing the current lookup table and if so, obtains the next record from LOOKUP_RUNTIME_SAPTOAPP.

Loop_SAPToApp

A conditional that loops through every table in LOOKUP_RUNTIME_SAPTOAPP

Script SCR_Init_And_Log

Ensures an entry exists in MGMT_LOOKUP_TAB_STRUCTURE for the lookup table being processed and raises an exception if it does not.

Sets a flag in LOOKUP_RUNTIME_SAPTOAPP to indicate the lookup table is being processed.

Initializes global variables related to the lookup table being processed by obtaining them from MGMT_LOOKUP_TAB_STRUCTURE.

Prints statements to the Data Services log file.

Data Flow DF_DM_Get_R3_Lookup_Data_RFC_SAPToApp

© SAP AGPage 30 of 37

Page 31: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Extract data from both SAP Check table and SAP text table and loads data into tables LOOKUP_CHKTAB_DATA_RFC and LOOKUP_TXTTAB_DATA_RFC

Extract data from both SAP Check table and SAP text table and load data into table LOOKUP_CHKTAB_RFC_SAPTOFILE and LOOKUP_TXTTAB_RFC_SAPTOFILE

This Data Flow is written to allow for all lookup tables and their respective text table entries to be read from the target SAP system. We use the SAP function RFC_READ_TABLE to extract the data rather than individually creating ABAP Data Flows for each lookup table. This allows us to reduce the amount of code required to populate the lookups and also to make it more efficient for the developers who wish to add additional lookup tables to support new objects / segments, by making this a process of updating the respective csv files defined earlier in the document.

Script SCR_Set_JoinKey

Data Flow DF_DM_Get_R3_Lookup_Data_RFC_SAPToApp makes calls utilizing RFC function RFC_READ_TABLE to obtain information from the configuration tables and configuration text tables and writes any errors while calling the functions to staging tables. If there was an error returned when calling the function RFC_READ_TABLE an exception is raised. An error is also raised if the language value returned by the function is not the same as $G_Global_Language or $G_Local_Language.

If a text configuration table is associated with the lookup table then values are added to intermediate staging tables LOOKUP_CHKTAB_RFC and LOOKUP_TXTTAB_RFC so they can be joined properly in Data Flow DF_DM_Merge_Text_Data_SAPToApp.

Data Flow DF_DM_Merge_Text_Data_SAPToApp

Loads intermediate staging table LOOKUP_CHK_TXT_DATA_RFC based off of values in table LOOKUP_CHKTAB_DATA_RFC. For those lookup tables with text values it uses a lookup_ext() call to obtain the values from LOOKUP_TXTTAB_RFC.

Script SCR_Data_To_TempTab

Loads data into LOOKUP_CHK_TXT_DATA_RFC from source table LOOKUP_CHK_TXT_DATA_RFC and LOOKUP_CHK_TXT_DATA_RFC

Data Flow DF_DM_Lookup_Data_SAPToApp

Loads data into LOOKUP_DATA_UPDATE_SAPTOAPP based on data in table LOOKUP_DATA_ORIGINAL and LOOKUP_TAB_TEMP_SAPTOAPP

Script SCR_DataPop_And_Reassign

Deletes existing data from the lookup table

Loads data to the lookup table

Updates the flag in LOOKUP_RUNTIME_SAPTOAPP indicating that the load is complete

Initializes global variables that are utilized to loop through the loading of the lookup tables to values corresponding to the next lookup table.

© SAP AGPage 31 of 37

Page 32: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Data Flow DF_DM_Lookups_Log_SAPToApp

Writes an entry for each lookup table to the log file indicating if the lookup tables are processed successfully.

Conditional ExtNumberRangeSetup

If $G_ExtNumberRangeSetup = 'Y' it populates table MGMT_NUMBER_RANGES

Script SCR_Terminate

Truncate the management staging tables that are used in this job to control the processing of the lookup tables.

9.1.4 Job_DM_Lookups_SAPToFile

This job creates lookup text files by obtaining the values from the SAP ECC target.

SCR_Initialise

Initializes global variables to default values

Includes LKP_MGMT_IDOCSTATUS as a table to load if $G_IDocStatusLookup = ‘Y’

Prints out messages to the Data Services log file

Creates $G_PATH\ Lookup_Log if it does not exist.

If $G_RunTimeData_Delete = 'Y' it would truncate the management staging tables that are used in this job to control the processing of the lookup tables.

Data Flow DF_DM_Lookups_RunTime_SAPToFile

Loads data to the staging table LOOKUP_RUNTIME_SAPTOFILE. LOOKUP_RUNTIME_SAPTOFILEcontains a list of LKP_ files to populate based on the settings of $G_GetDataFromObjectList, $G_GetDataFromVariable and $G_GetDataFromTXTFile.

Script SCR_Loop_Initial

Initializes global variables that are utilized to loop through the loading of the lookup files.

Raises an exception if no entries exist in LOOKUP_RUNTIME_SAPTOFILE.

Checks to see if another execution of the job is processing the current lookup file and if so, obtains the next record from LOOKUP_RUNTIME_SAPTOFILE.

Loop_SAPToFILE

A conditional that loops through every file in LOOKUP_RUNTIME_SAPTOAPP

Script SCR_Init_And_Log

© SAP AGPage 32 of 37

Page 33: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Ensures an entry exists in MGMT_LOOKUP_TAB_STRUCTURE for the lookup table being processed and raises an exception if it does not.

Sets a flag in LOOKUP_RUNTIME_SAPTOFILE to indicate the lookup table is being processed.

Initializes global variables related to the lookup file being processed by obtaining them from MGMT_LOOKUP_TAB_STRUCTURE.

Prints statements to the Data Services log file.

Data Flow DF_DM_Get_R3_Lookup_Data_RFC_SAPToFile

Extract data from both SAP Check table and SAP text table and load data into table LOOKUP_CHKTAB_RFC_SAPTOFILE and LOOKUP_TXTTAB_RFC_SAPTOFILE

This Data Flow is written to allow for all lookup tables and their respective text table entries to be read from the target SAP system. We use the SAP function RFC_READ_TABLE to extract the data rather than individually creating ABAP Data Flows for each lookup table. This allows us to reduce the amount of code required to populate the lookups and also to make it more efficient for the developers who wish to add additional lookup tables to support new objects / segments, by making this a process of updating the respective csv files defined earlier in the document.

Script SCR_Set_JoinKey

Data Flow DF_DM_Get_R3_Lookup_Data_RFC_SAPToFile makes calls utilizing RFC function RFC_READ_TABLE to obtain information from the configuration tables and configuration text tables and writes any errors while calling the functions to staging tables. If there was an error returned when calling the function RFC_READ_TABLE an exception is raised. An error is also raised if the language value returned by the function is not the same as $G_Global_Language or $G_Local_Language.

If a text configuration table is associated with the lookup file then values are added to intermediate staging tables LOOKUP_CHKTAB_RFC_SAPTOFILE and LOOKUP_TXTTAB_RFC_SAPTOFILE so they can be joined properly in Data Flow DF_DM_Merge_Text_Data_SAPToFile.

Data Flow DF_DM_Merge_Text_Data_SAPToFile

Loads intermediate staging table LOOKUP_CHK_TXT_DATA_RFC based off of values in table LOOKUP_CHKTAB_DATA_RFC. For those lookup tables with text values it uses a lookup_ext() call to obtain the values from LOOKUP_TXTTAB_RFC_SAPTOFILE.

Script SCR_Data_To_TempTab

Uses custom function Tool_Get_String_For_SQL to load the data for the lookup file into the intermediate staging table LOOKUP_TAB_TEMP_SAPTOFILE

Data Flow DF_DM_Lookup_Data_SAPToFile

Loads the target lookup file based off of source values in the source table LOOKUP_TAB_TEMP_SAPTOFILE.

© SAP AGPage 33 of 37

Page 34: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Script SCR_Loop_Reassign

Sets the flag to completed in LOOKUP_RUNTIME_SAPTOFILE for the file being processed.

Determines which lookup file is the next to be processed.

Checks to see if another instance of the job is processing the lookup file and if so, obtains the next lookup file to be processed.

Initializes global variables that are utilized to loop through the loading of the lookup tables to values corresponding to the next lookup file.

Data Flow DF_DM_Lookups_Log_SAPToApp

Writes an entry for each lookup table to the log file indicating if the lookup tables are processed successfully.

Conditional ExtNumberRangeSetup

If $G_ExtNumberRangeSetup = 'Y' it populates table MGMT_NUMBER_RANGES

Script SCR_Terminate

Truncate the management staging tables that are used in this job to control the processing of the lookup tables.

9.2 Frequently Asked Questions This section would be maintained with any frequently asked questions related to the lookup contents process, and their related answers, as they are raised by partners and customers.

Questions Answers

Is it possible to run the same job in parallel?

Multiple instances of jobs Job_DM_Lookups_SAPToApp and Job_DM_Lookups_SAPToFile can be run at the same time because there is a status table that indicates if a LKP_ table is being processed. If it is, then the jobs above would skip trying to process it.

Multiple instances of Job Job_DM_Lookups_Initialise and Job_DM_Lookups_FileToApp should not be run at the same time.

When would you set values for the global variables $G_ControllingArea and $G_CompanyCode and $G_ChartOfAccounts?

Use these global variables to restrict the extract of customizations to the SAP configuration tables by setting these global variables in jobs Job_DM_Lookups_SAPToApp and Job_DM_Lookups_SAPToFile.

Another option is to update the table

© SAP AGPage 34 of 37

Page 35: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

Questions Answers

MGMT_LOOKUP_TAB_STRUCTURE for column CHK_TAB_CONDITIONS and TXT_TAB_CONDITIONS for your own conditions as follows:

( KOKRS in ( 'G_ControllingArea' ) ),

( BUKRS in ( 'G_CompanyCode' ) ),

( KTOPL in ( 'G_ChartOfAccounts' ) )

What is the impact if you set $G_ExtNumberRangeSetup to ‘Y’?

In Job Job_DM_Lookups_FileToApp:

Loads MGMT_NUMBER_RANGES with sample data from DEFAULT_NUMBER_RANGES.TXT.

In Job_DM_Lookups_SAPToApp:

Pulls number range data from SAP and overwrites the sample data (if it exists) in MGMT_NUMBER_RANGES.

In Job_DM_Lookups_SAPToFile:

Loads DEFAULT_NUMBER_RANGES.TXT with values from SAP.

What is the impact if you set $G_IDocStatusLookupto to ‘Y’?

In Job_DM_Lookups_FileToApp:

It loads data from LKP_MGMT_IDOCSTATUS.TXT to table LKP_MGMT_IDOCSTATUS.

In Job_DM_Lookups_SAPToApp:

It loads data from SAP to table LKP_MGMT_IDOCSTATUS.

In Job_DM_Lookups_SAPToFile:

It loads data from SAP to file LKP_MGMT_IDOCSTATUS.TXT

LKP_MGMT_IDOCSTATUS is used to hold details of the current status of IDocs sent to SAP, it is populated by the Job Job_DM_CheckIDocStatus.

9.3 Management Tables

MGMT_VIEW_TO_DF_NAME:

© SAP AGPage 35 of 37

Page 36: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

For every object, it lists the IDOC segments (VIEW_NAME) and indicates which jobs and data flows are associated with the segment.

MGMT_LOOKUP_WHERE_USED

For each object, it lists the IDOC segments (VIEW_NAME populated by a lookup to MGMT_VIEW_TO_DF_NAME) and indicates which validation data flows and lookup tables are associated with the segment.

If you are loading lookup tables based on object name, this table is used to find the lookup tables associated with the object.

MGMT_LOOKUP_TAB_STRUCTURE

Contains a row for each field in the lookup tables. For each row, it identifies the lookup table name. If the field requires a lookup to a configuration table, the configuration table is listed.

LOOKUP_TAB_CREATION

A subset of data from MGMT_LOOKUP_TAB_STRUCTURE with the addition of the FIELD_ATTRIBUTE field. FIELD_ATTRIBUTE defines the data definition of the field and would be used when creating the lookup table.

MGMT_LOOKUPS

Lookup table names list from file LOOKUPS.csv,and it is one of the source data in the processing table MGMT_VIEWS_LOOKUPS and MGMT_PROFILE_HDR

MGMT_LOOKUP_LIST

The list of lookup table details from the file LOOKUPS.csv

MGMT_VIEWS

The relationship between the segment and the dataflow

MGMT_VIEWS_LOOKUPS

The relationship between the dataflow and the lookup tables used in, they both replaced by the sequence number from the table MGMT_VIEW_TO_DF_NAME and MGMT_LOOKUPS

MGMT_PROFILE_MAP

The local job name list in your project area

MGMT_PROFILE_HDR

For Migration Service usage,which contains each segment name,lookup_table_name and fields in it,etc.

MGMT_PROFILE_VALUE

© SAP AGPage 36 of 37

Page 37: DM BPD Lookup Content

SAP Best Practices Lookup Content for Data Migration: BPD

The latest running code for the project jobs,used in the Migration Service

MGMT_ROW_COUNTS

Filter the original data in the validation step,and separated them by valid or invalid data

© SAP AGPage 37 of 37