This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
Document is applicable to all SAP BPC 7.0 NW versions. For more information, visit the Enterprise Performance Management homepage.
Summary
This document provides an overview of data integration between BPC NW with BI 7.0. SAP Net weaver 7.0 BI is used as the backend server to hold BPC data. Since BPC tool is used for planning and reporting purposes, it typically needs to references other BPC Application data. This guide will provide reusable FMs to access those data at ease.
Prerequisite(s):
(1) Foundational understanding of BPC Concepts and Terminologies
(2) Basic understanding of ABAP <field-symbols>
(3) Reading and appreciation of How to Pass Parameters to Custom Logic BADI using START_BADI
Author: Benedict Yong Teng Xiang
Company: Accenture Consulting
Created on: 1 November 2010
Author Bio
Benedict Yong is a Certified SAP BI Consultant with 5 years SAP experience. He holds a
Bachelor of Management (Australia) and a Diploma in Business InfoTech (Singapore). Prior to his current employment at Accenture Consulting, he was with Hypercube Consulting, practicing SAP Analytics and Business Intelligence. He is situated in Singapore and is bilingual in English and Mandarin.
Main Section for FM ............................................................................................................................................ 4
Main Section for Program ................................................................................................................................... 9
Related Content ................................................................................................................................................ 18
Disclaimer and Liability Notice .......................................................................................................................... 19
How to Integrate BPC NW to BI7x Technically – using ABAP?
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
The goal of this how-to guide is to create a set of FM that can easily access BPC Applications’ Transactional and Master Data. Hence, reducing development time, project cost and creating business value – with a methodology in place.
Scenario
One sample scenario that may be applicable is that you have a core Sales/Transaction Application that needs to read Pricing/Rate from another Application to do cross-Application computation.
Or simply, you may just want to access the Master Data of the Dimensions easily with a common approach.
Cross-Application Integration, Standardized Methodology, Reusable Function Modules are some of the desired development needs for any application platform.
Approach
The scope of this paper will only be restricted to technical level discussions.
We will be creating 2 FM and one driver program. (Do note that you may use the FM directly without going through the driver program. The program is there to just demonstrate how to use the FM)
ZBPC_GET_ATTR_BY_DIM – For Master Data Access
ZBPC_GET_APPL_API_FOR_UJQ – For Transactional Data Access
ZBPC_API_DRIVER – To Test Functionality of FM
How to Integrate BPC NW to BI7x Technically – using ABAP?
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
FM ‘ZBPC_GET_ATTR_BY_DIM’ will be used for Master Data Access.
FM ‘ZBPC_GET_APPL_API_FOR_UJQ’ will be used for Transactional Data Access.
ZBPC_GET_ATTR_BY_DIM
This FM reads from multiple BPC system tables (e.g. UJA_DIMENSION, UJA_DIM_ATTR) to gather the mapping of the field names between BPC and BI.
This FM can be used independently. It reads out an internal table that has two columns, the first column will be the dimension field and the second column will be the selected attribute field. You also have the option to just get the text in place of an attribute field by flagging ‘I_TEXT_ONLY’ = abap_true.
Typical FM 'ZBPC_GET_ATTR_BY_DIM’ can be used as below:
TYPES: BEGIN OF ty_acct_type,
col1 TYPE string,
col2 TYPE string,
END OF ty_acct_type.
TYPES: ty_t_acct_type TYPE STANDARD TABLE OF ty_acct_type.
DATA: lt_dim_acct TYPE ty_t_acct_type,
ls_dim_acct LIKE LINE OF lt_dim_acct.
DATA: lr_dim_acct TYPE REF TO data.
FIELD-SYMBOLS: <lt_acct_type> TYPE STANDARD TABLE.
CREATE DATA lr_dim_acct TYPE ty_t_acct_type.
ASSIGN lr_dim_acct->* TO <lt_acct_type>.
CALL FUNCTION 'ZBPC_GET_ATTR_BY_DIM'
EXPORTING
i_appset = 'YOUR_APPSET'
i_dim = 'P_ACCT'
i_attr = 'ACCTYPE'
IMPORTING
er_data = lr_dim_acct.
ASSIGN lr_dim_acct->* TO <lt_acct_type>.
"DO whatever you want with the data (i.e. <lt_acct_type>)
….
How to Integrate BPC NW to BI7x Technically – using ABAP?
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
This FM has to be used in-conjunction with the standard SAP FM ‘UJQ_RUN_RSDRI_QUERY’.
The rationale for doing so is that, you will not know the actual structure of the BPC equivalent InfoCubes for sure all the time. This is because during Full Optimization, the BPC InfoCubes are deleted from SAP BI and new replica InfoCube containing the migrated data are linked back to the BPC Application. Either way, we need to leverage on ABAP/4 RTTS Classes.
From a BPC perspective, Applications are permanent but InfoCubes are just data storage containers. There is a mapping table in SAP that holds the relationships between individual Application and Infocube (i.e. UJA_APPL). However, after determining that mapping between the Infocubes and the Applications through UJA_APPL, you need to get the names of the individual fields of the underlying tables that form the SAP BI Infocubes from UJA_DIMENSION. And more linkages need to be determined for further integration.
It is best that we use the standard SAP API to access the data from the BPC Application – without too much of a hassle.
"DO whatever you want with the data (i.e. <lt_final>)
….
However, the standard BPC API uses OO ABAP for processing. It might be too awkward for us who are accustomed to the old FM paradigm. So why not just create a FM to encapsulate the complexity? Pass in simple strings of requirements and get back the data required.
Typical FM ‘ZBPC_GET_APPL_API_FOR_UJQ’ should be used as below:
* MAKE the TABLE first
CALL FUNCTION 'ZBPC_GET_APPL_API_FOR_UJQ'
EXPORTING
i_appset_id = 'YOUR_APPSET'
i_appl_id = 'YOUR_APPLICATION'
if_inc_measure = abap_true
IMPORTING
er_data = lo_metadata.
ASSIGN lo_metadata->* TO <lt_final>.
* FILL the TABLE later
CALL FUNCTION 'UJQ_RUN_RSDRI_QUERY'
EXPORTING
i_appset_id = 'YOUR_APPSET'
i_appl_id = 'YOUR_APPLICATION'
it_dim_name = lt_column
if_check_security = abap_false
IMPORTING
et_data = <lt_final>.
"DO whatever you want with the data (i.e. <lt_final>)
….
In summary, there are will always be two-step in accessing data from SAP BPC NW Application using ABAP (whether through the API or through encapsulation): (1) Dynamically create an internal table that match the current Application database structure; and (2) Fill the generated table structure with actual data from BPC.
How to Integrate BPC NW to BI7x Technically – using ABAP?
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
ABAP program ‘ZBPC_API_DRIVER’ basically utilizes the mentioned APIs to demonstrate their functionalities.
Prerequisite: ensure the Application used have the following 6 Dimensions:
(1) CATEGORY, (2) P_ACCT, (3) TIME, (4) FLOW, (5) P_DATASRC, and (6) RPTCURRENCY.
As we are using <field-symbols>, short dumps will happen, if the structures do not match during runtime.
ZBPC_API_DRIVER
Typically in BPC planning, it will also be great to gain access to the Master Data. To do that, we can call the FM 'ZBPC_GET_ATTR_BY_DIM'. By using the mentioned BAdI, we will have the main structure ct_data based on the Current View Application, but we would also like to access the data of another ‘Rate’ Application for further computation. To do that, we can call the FM 'ZBPC_GET_APPL_API_FOR_UJQ' & 'UJQ_RUN_RSDRI_QUERY'.
How to Integrate BPC NW to BI7x Technically – using ABAP?
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com
Above are some of the functionalities that I have managed to emulate. There are more. One for instance, is accessing the hierarchy grouping of the TIME dimension. So on and so forth. Most of SAP BPC NW functionalities are pretty much exposed; with an astute mind, you can probably pick into the locks of BPC. My personal advice is to explore the object class CL_UJ_MODEL & CL_UJQ_QUERY_UTIL.
The value of this paper is not just in creating a set of usable APIs, but at a more conceptual level it opens up our minds to more possibilities.
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.