13
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com © 2011 SAP AG 1 Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable Applies to: This article applies to SAP BI 7.0 and SAP BW 3.X. For more information visit EDW Homepage . Summary This article explains the steps to create ALE Delta for Custom Datasource which is created using a ZTABLE. And also explains steps to create change document for created ZTABLE. Author: Venu Gopal. K Company: YASH Technologies Pvt Ltd Created on: 15 th Sep 2011 Author Bio Venu Gopal K is working for YASH Technologies Pvt Ltd, India as SAP BI ABAP consultant.

Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Embed Size (px)

Citation preview

Page 1: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 1

Steps to Activate ALE Delta for

Custom Master Datasource

Created on ZTable

Applies to:

This article applies to SAP BI 7.0 and SAP BW 3.X. For more information visit EDW Homepage.

Summary

This article explains the steps to create ALE Delta for Custom Datasource which is created using a ZTABLE.

And also explains steps to create change document for created ZTABLE.

Author: Venu Gopal. K

Company: YASH Technologies Pvt Ltd

Created on: 15th Sep 2011

Author Bio

Venu Gopal K is working for YASH Technologies Pvt Ltd, India as SAP BI ABAP consultant.

Page 2: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 2

Table of Contents

Introduction ......................................................................................................................................................... 3

Prerequisites to use delta ................................................................................................................................... 3

Steps to create ZTable ....................................................................................................................................... 3

Steps to create Change Document .................................................................................................................... 5

Steps to create Data Source............................................................................................................................... 8

Data Reconciliation ............................................................................................................................................. 9

Sample Code: ................................................................................................................................................... 11

Related Content ................................................................................................................................................ 12

Disclaimer and Liability Notice .......................................................................................................................... 13

Page 3: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 3

Introduction

There are different ways to extract data for R3 to BI system. The following update modes are available in BI:

Full Update

A full update requests all data that meets the selection criteria you set in the scheduler.

Delta Update

A delta update only requests data that has appeared in the source system since the last load.

Initializing the delta process

We need to initialize a delta process before it can work. The initialization selections are copied to load the delta records.

Among the above the updates depending upon the business we choose the proper UPDATE mode. With the large amounts of data created everyday in the business process, data to extract from source system will increase. We can have to ensure for a performance optimized extraction from source system if we use Delta Process. If it is transaction datasource we set GENERIC DELTA for the datasource using a delta relevant field with monotonically increasing value. In case of Master Datasource we have to set up ALE DELTA.

Prerequisites to use delta

Master data attributes or texts for which you want to use a delta transfer have to fulfill two prerequisites

1. Data must be extracted generically using a transparent table or a database view. 2. A change document object must be available that can update the complete key of the table

(or view) used for data extraction in combination with one of the tables on which the change document object is based.

Below are the steps to create ZTable and Change document

Steps to create ZTable

Navigate to “Data dictionary” using Tcode SE11 and enter the table name and click on create button as shown below.

Give the description and add the fields in the field‟s column. Save, check and activate the datasource.

Page 4: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 4

Note: To maintain ALE Delta the data element should be a „Change Document Object‟ that has to be declared as such at Data Element level itself by checking the check box beside „Change Document‟.

The below screen shot shows where to make a data element as a change document object.

Page 5: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 5

Steps to create Change Document

Goto “Change Document Object Overview” using tcode SCDO. Click on Create button as shown below.

Enter the change document name and click on Continue. A popup window will be opened asking for change document is not in name space, just click YES as shown below.

Page 6: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 6

Give the description for change document and enter the ZTable name for which change document has to be created. Also check the check box copy as internal table and click on Insert Entries.

Note: The check box „copy as internal table‟ has to be checked when more than one change document is present in the ZTable and if there is only one change document no need to check it.

The below screen will be displayed and click on save button and then back button.

Place the cursor on created (MAKTX) object and click on Generate update program as shown below.

Page 7: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 7

Soon after clicking on Generate update program a popup window is opened asking for change document is not in your namespace, just click on Yes.

After clicking on yes a popup window is appeared here mention the Function Group and choose the processing type as immediate update and click on Generate.

Note: To create function group go to tcode SE37 and form menu bar choose Goto -> Function Group -> Create Group. Activate the function group in tcode SE80.

Note: After clicking on Generate some crucial Data is generated and which has three types of Includes and One Function Module. The three types of includes are F<Object ID>CDT, F<Object ID>CDF and F<Object ID>CDV. The Function Module created is <Object ID>_WRITE_DOCUMENT.

Below are the INCLUDES and FM generated.

Page 8: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 8

Steps to create Data Source

Goto RSO2 transaction and give the data source name and click on create.

Enter the application component name, description and view/table name as show below.

To set ALE Delta choose DataSource ALE Delta form the menu bar as shown below.

Enter the table name; change document created above and click on apply.

Page 9: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 9

Data Reconciliation

Now the master datasource with ALE delta is generated successfully in R3 system. Replicate it to BI system and create Init InfoPackage to initialize delta process.

After executing init InfoPackage we can the same data present in R3 and BI systems as shown in fig1 and fig 2 respectively.

Fig 1: Records in R3 Table.

Page 10: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 10

Fig 2: Records in PSA of BI system.

Now Create the Delta InfoPackage and Execute it.

Now we see the changed and created records after execution of delta infopackage which can be seen in fig 3 and fig 4.

Fig 3: New and Modified records in R3 system.

Fig 4: Same new and modified records in BI System.

Page 11: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 11

Sample Code:

Call the function module which is generated at creation of change document, while you‟re creating and changing the entries into the ZTable.

Note: If you create or change entries into the ZTable manually the changes will not be captured. For the changes to capture we need to create a Transaction program which creates or modifies the existing records.

Here the sample code for calling the function module while you are creating records into ZTable.

CALL FUNCTION 'MAKTX_WRITE_DOCUMENT'

EXPORTING

objectid = 'MAKTX'

tcode = 'Z100'

utime = sy-uzeit

udate = sy-datum

username = sy-uname

* PLANNED_CHANGE_NUMBER = ' '

* OBJECT_CHANGE_INDICATOR = ' '

* PLANNED_OR_REAL_CHANGES = ' '

* NO_CHANGE_POINTERS = ' '

upd_icdtxt_maktx = 'I'

upd_zchg_doc = 'I'

TABLES

icdtxt_maktx = it_cdtxt

xzchg_doc = it_new

yzchg_doc = it_old

.

Below is the sample code of calling FM while changing existing record.

CALL FUNCTION 'MAKTX_WRITE_DOCUMENT'

EXPORTING

objectid = 'MAKTX'

tcode = 'Z100'

utime = sy-uzeit

udate = sy-datum

username = sy-uname

* PLANNED_CHANGE_NUMBER = ' '

object_change_indicator = 'U'

* PLANNED_OR_REAL_CHANGES = ' '

* NO_CHANGE_POINTERS = ' '

upd_icdtxt_maktx = 'U'

upd_zchg_doc = 'U'

TABLES

icdtxt_maktx = it_cdtxt

xzchg_doc = it_new "New Values

yzchg_doc = it_old "Old Values

.

It_new and it_old should be filled with new and old values respectively while you are updating the existing record in ZTable.

Give the object id and tcode which you have created and fill the it_new and it_old tables with the new records values which you are going to insert in the custom database table.

Page 12: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 12

Related Content

Change Document

ALE Delta for Master Data

Link to sample code to change records

Steps to create transparent table

For more information visit EDW Homepage

Page 13: Steps to Activate ALE Delta for Custom Master Datasource ... · Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable ... Steps to Activate ALE Delta for Custom

Steps to Activate ALE Delta for Custom Master Datasource Created on ZTable

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 13

Disclaimer and Liability Notice

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.