Você está na página 1de 21

BI Delta Update Extractor for Changeable Documents

Applies to:
SAP BI 7.0. For more information, visit the EDW homepage.

Summary
The article presents how to create extractors for delta update of documents that are changeable after creation, such document as sales order, sales delivery, and purchasing orders and other. Author: Sergiu Iatco

Company: ALRO Created on: 01 June 2010

Author Bio
Sergiu Iatco works with SAP since 1999. He has experience in SAP ERP Logistics in Oil industry and in Metal Industry. Knowledge gained from ERP experience helped him to extend successfully to SAP BI. He is a hands on manager and likes simplified, but valuable approaches to issues.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 1

BI Delta Update Extractor for Changeable Documents

Table of Contents
Introduction ................................................................................................................................................... 3 Updating of created documents ..................................................................................................................... 3 Updating of changed documents ................................................................................................................... 7 Updating of deleted sales documents .......................................................................................................... 11 DataSources ............................................................................................................................................... 15 DataSources in ERP................................................................................................................................ 15 DataSources in BI.................................................................................................................................... 18 Weaknesses ............................................................................................................................................... 19 Related Content .......................................................................................................................................... 20 Disclaimer and Liability Notice ..................................................................................................................... 21

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 2

BI Delta Update Extractor for Changeable Documents

Introduction
The article describes how to provide delta update for documents without special developed delta program and also how to ensure update for documents that can be changed. For instance, material documents can not be changed, excepting some descriptive fields in header and item. Therefore once the material document has been updated all data are final and do not need any further update. On the contrary sales order, sales billing document, purchase order and a lot of other documents can be changed, therefore changes has to be updated. Changes can be tracked usually using field [Change on]. However there are cases when field is not changed if a BAPI is used and sometimes is not changed even when standard transaction is used. Additionally to changes a document can be deleted, consequently deletion also has to be updated. The following method describes sales order update, which could be suitable also for other documents. Data in sales order are defined uniquely by [Document] and [Item], consequently an ODS with these Key fields is created with technical name ZSD_O01. The data source is based on InfoSet(Logical Database VAV), because InfoSet is accessible as a standard tool, programming is used only for some additional calculations.

Updating of created documents


Selection of created sale documents can be done using field ERDAT, because it is always filled by ERP and is never changed after document creation. Process chain is scheduled to run daily and to update all documents that have been created at least last 2 days from current date. Sales Orders ODS: ZSD_O01

Data flow that updates created sale documents

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 3

BI Delta Update Extractor for Changeable Documents

Transformation

Routine ZORD_CL01 aggregated characteristic for document and item

Data Transfer Process is Full

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 4

BI Delta Update Extractor for Changeable Documents

InfoPackage with calculated selection on ERDAT

Filling of field [ERDAT] with interval of last 7 days (at least 2 days required) More then 2 days could provide an overwriting of missing days, even when update errors occurs sometimes. However that means more time for data update.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 5

BI Delta Update Extractor for Changeable Documents

Routine ERDAT

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 6

BI Delta Update Extractor for Changeable Documents

Updating of changed documents


To update changed documents same method can be used as for Updating of created documents, however as has been described at the beginning there are cases when field [Changed on] is not updated. The method described uses track changes from cross functionality Documents changes. Documents changes are stored in tables CDHDR and CDPOS. Most of documents provide changes log, though not all documents have these functionality, but it can be custom developed in ERP when required, reference transaction SCDO, report SE38/RSSCD200. The method requires: To collect in an ODS (ZSD_O07) changes of last 2 days. Last 2 days are calculated automatically based on current day. To select for update in sales orders ODS (ZSD_O01) documents that has been changed. Changed sale documents ODS: ZSD_O07

Data flow ZSD_O07

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 7

BI Delta Update Extractor for Changeable Documents

Transformation

Routine in transformation for aggregated characteristic of document number and item

Routine transformation for document number

Routing transformation for item

Data transfer process is Full

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 8

BI Delta Update Extractor for Changeable Documents

InfoPackage for changed documents

Routine UDATE

Data flow Delta Changed

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 9

BI Delta Update Extractor for Changeable Documents

InfoPackage Delta Change

Routine SELECT_DD_VBELN with data upload from ZSD_O07. Because selection is only by document number, when a changes occur the sales document is updated with all items.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 10

BI Delta Update Extractor for Changeable Documents

Updating of deleted sales documents


To track deletion of sales orders in analytical systems is enough to mark the data as deleted, and not mandatory to delete them physically. In presented below method when a sales order item is deleted quantity is changed to 0. Process chain for deleted sales orders

Data flow: collection of deleted sales orders

Transformation Is the same as in chapter Updating of changed documents. Data Transfer Process Is the same as in chapter Updating of changed documents.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 11

BI Delta Update Extractor for Changeable Documents

InfoPackage deleted documents

Routine for Creation date of change logs

Data flow to update ZSD_O01

Note: DataSource 8ZSD_O01 extracts data from BI, not from ERP.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 12

BI Delta Update Extractor for Changeable Documents

Data Transfer Process

Transformation

Routine for 0ORDER_QUAN, when an item is deleted quantity is filled with 0. Notice that if one day an item is deleted and then next day is inserted in sales order in ERP, then in analytical system document quantity is filled with 0 and then is updated with all characteristics because ZSD_O01 has unique keys document and item.

InfoPackage

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 13

BI Delta Update Extractor for Changeable Documents

Routine for Sales Order aggregated characteristic ZORD_CL01. ZORD_CL01 is used to update only the deleted item of a sales order.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 14

BI Delta Update Extractor for Changeable Documents

DataSources
DataSources in ERP DataSource for ZSD_O01

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 15

BI Delta Update Extractor for Changeable Documents

DataSource for ZSD_O07

Join of CDPOS table

Calculation of items status deleted or not deleted (only changed)

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 16

BI Delta Update Extractor for Changeable Documents

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 17

BI Delta Update Extractor for Changeable Documents

DataSources in BI Notice that DataSource 8ZSD_O01 extracts data from BI, not from ERP.
Note: DataSource 8ZSD_O01 extracts data from BI, not from ERP.

Extracted data are updated back to ZSD_O01 but with quantity changed to 0.

Generation of Export DataSource from ZSD_O01:

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 18

BI Delta Update Extractor for Changeable Documents

Weaknesses
The overwritten of last 2 days (7 days) works successfully with daily RSPC that is monitored properly with alerts. However if is necessary to calculate exact period to be updated, beginning date of the period has to be read from ODS by adding a field timestamp. That will provide a dynamic period calculation, instead of a fixed period of 2 days (7days). With fixed period of overwriting, the constant value from routine could be replaced with selection from a customer maintenance table (transaction SM30) in order to avoid modification of routines. There is a limit of rows that can be filled into fields of DataSelection of InfoPackage. I monitored daily updates with less then 20000 rows and it works fine. Limitation can be overcome by developing of tracking of change log on ERP side, but that means more ABAP programming. If you want to develop updates as in standard SAP you have to develop function modules based on provided samples: RSAX_BIW_GET_DATA_SIMPLE for full upload and RSVD_BW_GET_DELTA_DATA for delta upload.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 19

BI Delta Update Extractor for Changeable Documents

Related Content
http://help.sap.com/saphelp_nw04/helpdata/en/f9/45503c242b4a67e10000000a114084/frameset.htm http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8134 https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/84bf4d68-0601-0010-13b5b062adbb3e33 For more information, visit the EDW homepage.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 20

BI Delta Update Extractor for Changeable Documents

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 conte nt of this document.

SAP COMMUNITY NETWORK 2010 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com 21

Você também pode gostar