Professional Documents
Culture Documents
Applies to:
BI/BW and ABAP Developers working in SAP BW 3.x, SAP BI 7.x.For more information, visit the EDW homepage..
Summary
This article encompasses the usage of Infopackage routines that can be implemented to put dynamic filters for extraction purposes. The nature of the filter can vary based on type of Data (i.e. Master Data Hierarchy or Transactional). Two types of filters will be demonstrated here with sample codes. Author: Company: Akashdeep Banerjee IBM India Pvt. Ltd.
Author Bio
The author is working in SAP BI for a period of 4 years. He has worked in both Implementation & Support projects with his current as well as previous organization (Pricewaterhouse Coopers). Besides BI, he has knowledge on BI security and basic SAP security.
Table of Contents
Business Scenario .............................................................................................................................................. 3 Scenario 1: Automatically selecting the latest available hierarchy from source system & loading it in BI ..... 3
Step-by-Step Procedure .............................................................................................................................................. 3
Business Scenario
Many-a-time, business has requirement to restrict the volume of data inflow from source system to save space in database to accelerate DB time in reporting. Another scenario is to have updated values only whenever they are launched in the source system (like latest hierarchies or data for the latest posting dates). Here two such scenarios are mentioned: A number of time-based or name-based hierarchies exist in source system. But requirement is to bring in the latest available hierarchy to the BI system, ignoring any dummy hierarchy created as a test object for the future periods. Restrict transactional records while those are flowing into BI system (like to restrict the infopackage with the some conditional values in Info Object Master Data). We are calling it dynamic as the number of Master Data entries may get changed in the next month or anytime in the future.
Scenario 1: Automatically selecting the latest available hierarchy from source system & loading it in BI Lets us assume that we have many hierarchies created in the source system to load the business content Info Object Consolidation Unit (0CS_UNIT). They are named as BPBU, BPCB, BPS2 etc and each of them is time-dependent i.e. they get changed monthly. One can see all of them in the infopackage view by clicking Available hierarchies from OLTP. Then we need to select the latest hierarchy by scrolling & searching manually (radio button). After that we run the infopackage.
Imagine the degree of manual intervention when there are hierarchies for last 5 years i.e. say 12 types of hierarchies each one having 60 monthly hierarchies for last 60 months (12 years). Requirement is to load these hierarchies everyday and to start loading the new hierarchy for each one of them automatically from the day they are created in the source system. In this way, no manual intervention or delay is expected. Also, no one supporting the BI system needs to know when the new hierarchy was created in source system. Step-by-Step Procedure This describes how to load one hierarchy (BPBU) dynamically. For other hierarchies, one needs to repeat it within a different infopackages i.e. if 6 different hierarchies are needed to be loaded, we need to create 6 infopackages. 1. Create an Infopackage under Hierarchy Datasource & go to tab Hierarchy Selection & press Dynamic Hierarchy Selections.
8. Schedule the infopackage normally & run. In the monitor screen it shows which hierarchy got loaded
Notes: For automation, we need to schedule it in a process chain & need as many infopackages as the number of different hierarchy names. A process named Save Hierarchy (3.x) may be needed after Infopackage in the Process Chain (sometimes loaded hierarchy needs this to get activated)
Scenario 2: Dynamic Filter on Infopackage for Transactional Data Lets now take the situation where we are having a transactional datasource to load a DSO. The loading frequency and the data volume may be high and also customer only needs the data for the Consolidation Units which are appearing in the master data table with Country US. Master Data for Consolidation Unit
Step-by-Step Procedure 1. Create an infopackage on the datasource. Go-to Data Selection tab. Identify Consolidation Unit.
4. An automatically generated code will appear. Change the code as below & run a syntax check with button
5. Save the code & get back to the Infopackage screen. Test the outcome of the code via Test Routine button as shown below in Red circle
6. The outcome
7. Go-to Extras Restrict No of Selection Values, uncheck the following screen & save.
8. Run the infopackage & re-validate the filter & incoming records
Note: Always raise an Error message in the Infopackage code to terminate processing for undesired condition. Else, filter logic will be ignored e.g. in the example above, if no US consolidation unit is found, system will load data for all Consolidation Units. Advantage of this code is this can be edited even in Productive system if Infopackages are set as Everything Changeable in Object Changeability. One can even introduce file upload/download function modules inside the code to load filter values from Application server/local workstation.
Related Content
http://forums.sdn.sap.com/message.jspa?messageID=6710556 http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a05ac9fa-f44c-2c10-dbb8ef54c102707c?QuickLink=index&overridelayout=true www.bi-expertonline.com/downloads/InfoPackage%20Selection%20Condition.doc