Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data...

18
SAP Data Services 4.2 July 2014 English Extension Guide for rapid data migration to cloud solutions from SAP SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany Extension Guide

Transcript of Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data...

Page 1: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

SAP Data Services 4.2

July 2014

English

Extension Guide for rapid data migration to cloud solutions from SAP

SAP AG Dietmar-Hopp-Allee 16 69190 Walldorf Germany

Extension Guide

Page 2: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 2 of 18

Copyright

© 2014 SAP AG or an SAP affiliate company. 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 or an SAP affiliate company.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG (or an SAP affiliate company) in Germany and other countries. Please see http://global.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

National product specifications may vary.

These materials are provided by SAP AG or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP AG or its affiliated companies shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP AG or SAP affiliate company 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.

In particular, SAP AG or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document, or any related presentation, and SAP AG’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP AG or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, which speak only as of their dates, and they should not be relied upon in making purchasing decisions.

Page 3: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 3 of 18

Icons

Icon Meaning

Caution

Example

Note

Recommendation

Syntax

Query Transform

Validate Transform

Merge Transform

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.

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

Page 4: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 4 of 18

Content

Extension Guide for rapid data migration to cloud solutions from SAP ........................................... 5

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

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

3 Overview of Date Splits Logic .................................................................................................. 5

4 Extending DS content ............................................................................................................. 10

4.1 Replicating the Data Splits Dataflow 1 ......................................................................... 10

4.2 Adding template Job .................................................................................................... 11

4.3 Replicating the Data Splits Dataflow 2 ......................................................................... 12

4.4 Enhancing the existing Map Dataflow .......................................................................... 16

Page 5: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 5 of 18

Extension Guide for rapid data migration to cloud solutions from SAP

1 Purpose This guide provides the information you need to extend and modify the pre-defined data migration Data Services contents that is an integral part of the rapid data migration to cloud solutions from SAP.

The pre-defined content has been built for the SAP HCM and SF EC and contains all of the data fields required for a standard implementation of the SF EC, also we have completed the field mapping from SAP HCM to SF EC in the pre-defined DS content, including the transform logic for the loading the employee historic data from SAP HCM to SF for object Job Information because the multiple SAP info type tables with the different start and end dates have to be mapped to one SF object.

Since partners or customers may want to load the employee historic data from SAP HCM to other SF objects, this guide provides the information on how to perform this work, the following sections describes the Date Splits logic dataflow for SF object Job Information and detail the process of adding/enhancing the Data Services content for SF object Emp Employment as example.

2 Prerequisites Complete all steps from Package Configuration Guide, Build Block Configuration Guide and Test Script for all objects you require to modify and enhance.

3 Overview of Date Splits Logic Since in the SAP HCM system every info type table include the start date and end date as primary key to store the employee historic data, there are the multiple records with the different start date and end date for the each personal number, if we map the multiple info type tables with different start date and end date into one SF object, we have to consider how to split the dates and load the historic data into SF system, this section describe how the data splits logic works using SF object Job Information as example.

There are two Dataflows DF_DM_EmployeeData_04_JobInformation_SplitDates1 and DF_DM_EmployeeData_04_JobInformation_SplitDates2 added for the date splits logic for SF object Job Information, which have been included in the DS condition object EmployeeData_04_JobInformation_Map, if the value of global variable $G_EmployeeData_SAP2SF is Y, both Dataflows are executed prior to dataflow DF_DM_EmployeeData_04_JobInformation_SAP_Map, because the target table of dataflow DF_DM_EmployeeData_04_JobInformation_SplitDates2 will be used as source data in the dataflow DF_DM_EmployeeData_04_JobInformation_SAP_Map.

Page 6: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 6 of 18

The following 5 info type tables have been added into DF_DM_EmployeeData_04_JobInformation_SplitDates1 as source table.

The key fields MANDT, PERNR, SUBTY, BEGDA, ENDDA and SEQNR from each info type table have been mapped to Merge transform, the expectation is that all records will be merged to the target table EMPLOYEEDATA_04_SPLIT_DATES without any changes.

Page 7: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 7 of 18

For example, these info type tables contain the different start date and end date.

Table PA0000 for info type 0000(Actions)

Table PA0001 for info type 0001(Organizational Assignment)

Table PA0007 for info type 0007(Planned Working Time)

Table PA0008 for info type 0008(Basic Pay)

Page 8: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 8 of 18

Table PA0041 for info type 0041(Date Specifications)

The dataflow DF_DM_EmployeeData_04_JobInformation_SplitDates2 include the several query transforms for splitting date and outputs the final date result into table EMPLOYEEDATA_04_STARTDATE_ENDDATE with different start date and end dater like below.

In the dataflow DF_DM_EmployeeData_04_JobInformation_SAP_Map the table EMPLOYEEDATA_04_STARTDATE_ENDDATE is added as source.

Page 9: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 9 of 18

In the transform query Qry_Join the table EMPLOYEEDATA_04_STARTDATE_ENDDATE is used in the left and other info type tables are used in the right for the Left out join Type, also the Join Condition was maintained like below, for example for info type PA0001.

EMPLOYEEDATA_04_STARTDATE_ENDDATE.MANDT = PA0001.MANDT

and EMPLOYEEDATA_04_STARTDATE_ENDDATE.PERNR = PA0001.PERNR

and (EMPLOYEEDATA_04_STARTDATE_ENDDATE.BEGDA >= PA0001.BEGDA

and EMPLOYEEDATA_04_STARTDATE_ENDDATE.ENDDA <= PA0001.ENDDA)

Page 10: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 10 of 18

4 Extending DS content

Use

The following section describes the process required to add new Dataflow and modify existing Dataflow for SF object Emp Employment as example in the data migration job Job_DM_EmployeeData_SFSF.

In this section:

1. The Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates1 is created.

2. The Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates2 is created.

3. The table EMPLOYEEDATA_03_SPLIT_DATES is created in datastore DS_STG_OBJ_INIT, which is imported into datastore DS_STG_OBJ.

4. The table EMPLOYEEDATA_03_STARTDATE_ENDDATE is created in datastore DS_STG_OBJ_INIT.

5. Two above Dataflows are added into DS condition object EmployeeData_04_JobInformation_Map of the DS Job Job_DM_EmployeeData_SFSF.

6. The Dataflow DF_DM_EmployeeData_03_EmpEmployment_SAP_Map is enhanced.

4.1 Replicating the Data Splits Dataflow 1

1. Log on the repository DM_REPO_SFSF using the Data Services Designer.

2. In the Local Object Library, select the Dataflows tab and expand the Dataflows sections and find the DF_DM_EmployeeData_04_JobInformation_SplitDates1 Dataflow object.

3. Right-click the object and choose Replicate. This would create a new object called Copy_1_DF_DM_EmployeeData_04_JobInformation_SplitDates1, rename this to be DF_DM_EmployeeData_<Segment Name>_SplitDates1, for example DF_DM_EmployeeData_03_EmpEmployment_SplitDates1.

4. Double-Click to open the Dataflow, remove all of the source tables and Query transforms Qry_<Info Type table> if the tables are not required for Emp Employment in the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates1, then add the required info type table and create the query Qry_<Info Type Table> between Info type table and Merge Transform, the query Qry_<Info Type Table> contain the same columns MANDT, PERNR, SUBTY, BEGDA, ENDDA and SEQNR.

All of the required info type tables can be found in the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SAP_Map, for example for Emp Employment, the info type table PA0000, PA0001, PA0041 and PA0105 are required and which are mapped to SF Emp Employment.

5. Delete the target template table EMPLOYEEDATA_04_SPLIT_DATES and then choose the template table icon in the Tool Palette to place a target template table on the Dataflow. Name the Template table EMPLOYEEDATA_<Segment Number>_SPLIT_DATES (e.g., EMPLOYEEDATA_03_SPLIT_DATES) and ensure that it is associated with the DS_STG_OBJ_INIT Datastore.

6. Choose Validation – Validate – All objects in view from the menu. If you have any errors, resolve these now and then save all objects from the Project menu.

7. The Dataflow should look like the screen below.

Page 11: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 11 of 18

4.2 Adding template Job

1. Open the project DM_BPDM_SFSF so that all of the object Jobs are available in the Project Area of the Data Services Designer interface.

2. Right-Click on the project DM_BPDM_SFSF, and Choose New – Batch Job…from the menu, and rename Job Name to Job_DM_SF_Test.

3. Double-Click the Job Job_DM_SF_Test, drag the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates1 into Job Job_DM_SF_Test.

4. Choose Validation – Validate – All objects in view from the menu. If you have any errors, resolve these now and then save all objects from the Project menu.

5. Right-Click on Job Job_DM_SF_Test and Choose Execute.

6. On the Execution Properties screen, choose OK.

7. Once the DS Job is completed successfully, all of records from Info Type Tables are merged into table EMPLOYEEDATA_03_SPLIT_DATES.

8. Go to the Datastore tab of the Local Object Library, and right-click the DS_STG_OBJ Datastore, select Import By Name and enter EMPLOYEEDATA_03_SPLIT_DATES, Choose Import.

9. Finally the Job and Dataflow should look like the screen below.

Page 12: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 12 of 18

4.3 Replicating the Data Splits Dataflow 2

1. In the Local Object Library, select the Dataflows tab and expand the Dataflows sections and find the DF_DM_EmployeeData_04_JobInformation_SplitDates2 Dataflow object.

2. Right-click the object and choose Replicate. This would create a new object called Copy_1_DF_DM_EmployeeData_04_JobInformation_SplitDates2, rename this to be DF_DM_EmployeeData_<Segment Name>_SplitDates2, for example DF_DM_EmployeeData_03_EmpEmployment_SplitDates2.

3. Double-Click to open the Dataflow, remove the source table EMPLOYEEDATA_04_SPLIT_DATES and drag the table EMPLOYEEDATA_03_SPLIT_DATES from DS_STG_OBJ Datastore into Dataflow as source table and connect it to Query Qry_LookupEndDate1.

4. Delete the target template table EMPLOYEEDATA_04_STARTDATE_ENDDATE and then choose the template table icon in the Tool Palette to place a target template table on the Dataflow. Name the Template table EMPLOYEEDATA_<Segment Number>_STARTDATE_ENDDATE (e.g., EMPLOYEEDATA_03_STARTDATE_ENDDATE) and ensure that it is associated with the DS_STG_OBJ_INIT Datastore.

5. In the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates2, Double-Click Query Qry_LookupEndDate1.

6. In the Qry_LookupEndDate1-Query Editor screen, Right-click the Lookup_ext in the schema out area, choose Modify Function Call.

7. In the Lookup_ext-Select Parameters screen, change the lookup table name to EMPLOYEEDATA_03_SPLIT_DATES and change the table name to EMPLOYEEDATA_03_SPLIT_DATES for all of Expressions, it should look like the screen below, choose Finish.

Page 13: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 13 of 18

8. Choose Back to previous window.

9. In the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates2, Double-Click Query Qry_LookupEndDate2.

10. In the Qry_LookupEndDate2-Query Editor screen, Right-click the Lookup_ext in the schema out area, choose Modify Function Call.

11. In the Lookup_ext-Select Parameters screen, change the lookup table name to EMPLOYEEDATA_03_SPLIT_DATES, it should look like the screen below, choose Finish.

Page 14: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 14 of 18

12. Choose Validation – Validate – All objects in view from the menu. If you have any errors, resolve these now and then save all objects from the Project menu.

13. Double-Click the Job Job_DM_SF_Test, drag the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates2 into Job Job_DM_SF_Test and then connect two Dataflow.

14. The Job and Dataflow should look like the screen below.

Page 15: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 15 of 18

15. Right-Click on Job Job_DM_SF_Test and Choose Execute. 16. On the Execution Properties screen, choose OK. 17. One the DS Job is completed successfully, 4 records with different start date and end dates

from the table EMPLOYEEDATA_03_SPLIT_DATES was processed to 3 records into EMPLOYEEDATA_03_STARTDATE_ENDDATE for employee 101 as example.

Page 16: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 16 of 18

4.4 Enhancing the existing Map Dataflow

1. Double-Click the Job Job_DM_EmployeeData_SFSF, and expand the DS condition object EmployeeData_03_EmpEmployment_Map under DS condition object EmployeeData_03_EmpEmployment_Required.

2. In the EmployeeData_03_EmpEmployment_Map-Condional Editor screen, drag the Dataflow DF_DM_EmployeeData_03_EmpEmployment_SplitDates1 and DF_DM_EmployeeData_03_EmpEmployment_SplitDates2 into the conditional area.

3. The Job and Conditional should look like the screen below.

Page 17: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 17 of 18

4. Double-Click on the Dataflow EmployeeData_03_EmpEmployment_Map

5. Drag the table EMPLOYEEDATA_03_STARTDATE_ENDDATE from DS_STG_OBJ_INIT Datastore into Dataflow as source table and connect it to Query Qry_Join.

6. The Dataflow should look like the screen below.

7. Double-Click on Query Qry_Join.

Page 18: Extension Guide for rapid data migration to cloud …sapidp/...Extension Guide for Rapid Data Migration © SAP AG Page 4 of 18 Content Extension Guide for rapid data migration to cloud

Extension Guide for Rapid Data Migration

© SAP AG Page 18 of 18

8. In the Qry_Join Query-Editor screen, go the tab From to edit the Join condition, the table EMPLOYEEDATA_03_STARTDATE_ENDDATE is used in the left and other info type tables are used in the right for the Left out join Type, the Join Condition was maintained like below, for example for info type PA0001.

EMPLOYEEDATA_03_STARTDATE_ENDDATE.MANDT = PA0001.MANDT

and EMPLOYEEDATA_03_STARTDATE_ENDDATE.PERNR = PA0001.PERNR

and (EMPLOYEEDATA_03_STARTDATE_ENDDATE.BEGDA >= PA0001.BEGDA

and EMPLOYEEDATA_03_STARTDATE_ENDDATE.ENDDA <= PA0001.ENDDA)

The completed join condition below from Dataflow DF_DM_EmployeeData_04_JobInformation_SAP_Map can be referred.

9. Once completed the join condition for all info type tables, choose Validation – Validate – All objects in view from the menu. If you have any errors, resolve these now and then save all objects from the Project menu.

10. Configurations you have already completed all steps to enhance the DS content for loading the historic data from SAP HCM system to SF object Emp Employment.