Skip to Content

Summary

Retraction of master data is one of the main concerns during the implementation of SAP Business Objects Planning and Consolidation (BPC) in Net weaver Landscape. This paper presents a detailed investigation of the customized methods that can be employed while writing back BPC master data into BW Master Data (Info Object). Best practice can be determined and implemented based on data volume and other variables dependent on the customer system

Authors:  Arulmurugan S, Kanchana Subbiah

Author Bio

Arul.png

Arulmurugan is a Consultant at Deloitte Consulting LLP with an experience of 7 years. He has specialized in SAP Business warehouse 3.5, 7.0 and 7.3 version of Net Weaver. He has worked on multiple implementation projects for various industry sector.

Kanchana.png

Kanchana is a Consultant at Deloitte Consulting LLP with an experience of 7 years. She has specialized in SAP Business Objects Planning and Consolidation, 7.5 and 10 version of Net Weaver. She has worked on multiple implementation projects for various industry sector.


Detailed Description

Retraction of data from SAP BPC to SAP BW can be achieved through write-back of data methodology using the BPC standard method by setting parameter WRITE equal to ON in the BPC script-logic. The write back can also be handled within the BADI by setting parameter WRITE to OFF. The method CL_UJR_WRITE_BACK-> WRITE_BACK_INT called in the BADI, passing the appropriate parameters serves the purpose of data write-back. The coding within the BADI can be designed to write back the data at once or in batches. Batch write-back improves performance for large volumes of data while sequential write-back works better for smaller volumes.

However in case master data load like Hierarchy we still face many challenges while retracting data from BPC to BW landscape since the hierarchy stores data in different format in both places. This document will show you how to load the master data using some customized methodologies


BW Hierarchy Master Data

A hierarchy is a method of displaying a characteristic structured and grouped according to individual evaluation criteria.

Structure of a Hierarchy

  • Nodes – A hierarchy is created from nodes. The uppermost node is the root
  • Roots – A hierarchy can have several roots. They do not have superior nodes
  • Leaves – The leaves of a hierarchy consist of characteristic values for the basic characteristic and therefore can also have entries in the fact table. A leaf cannot have any sub nodes

Basic Characteristic – Hierarchies can be created only for those characteristics that do not reference other characteristics.


Structure of Hierarchy in BW Landscape


   Image1.PNG

BPC Hierarchy Master Data

Dimension in BPC is structured as Member (Parent) and Children relationship in the format of Hierarchy structure, the relationships includes member only, ascendants, descendants, siblings and base level. Data in BPC is always stored at the (Base) leaf node level.


Structure of a Hierarchy


  • Parent Member – Specified parent at the top most of all the hierarchy, more than one hierarchy could be defined.

Parent Member – 2012.TOTAL

  • Children Member – Child of the Parent specified. Children are also descendants.

Child Member – 2012.Q1, 2012.Q2, 2012.Q3, 2012.Q4

  • Descendants – Child Nodes of Level1 parent member.

Descendant Member – 2012. TOTAL at the top then 2013.Q1 as Level1 child then Jan, Feb, Mar.

  • Ascendants  (Same level) – Member at same level, or Current Level +1

Ascendant Member – 2012.TOTAL for 2012.Q1

  • Siblings  – Members Sharing a Common Parent Member

Siblings Member – 2012.Q1, 2012.Q2, 2012.Q3, 2012.Q4 which share the common parent of 2012.TOTAL

  • Base level ( Base cannot have any sub base children to it)

Base Member – 2012.Jan to 2012.Dec.

Structure of Hierarchy in BPC Landscape


Image2.PNG

Difference in BPC and BW Hierarchy Master Data

Top level node will have always only one characteristic in BW but whereas BPC can have multiple top level node and branch out still further in tree structure

Implication of this difference

We need to rearrange the format of the BPC Hierarchy master data into BW format only then it would allow you to load the data without any error

Program to Change the format of Master data




*&———————————————————————*
*& Report ZBPC_COPY_MASTER_HIERDATA
*&
*&———————————————————————*
*&
*&
*&———————————————————————*

REPORT ZBPC_COPY_MASTER_HIERDATA.

TYPES: BEGIN OF ty_pc_keyop,
id TYPE uj_dim_member,
parent
TYPE uj_dim_member,
END OF ty_pc_keyop,
BEGIN OF ty_member,
dim_member
TYPE uj_dim_member,
END OF ty_member.

TYPES: BEGIN OF s_fieldname,
field(20) TYPE c,
END OF s_fieldname.

TYPES : BEGIN OF GS_OUTPUT,
NODEID    
TYPE i,
INFOOBJECT
(20) TYPE C,
NODENAME
(20)   TYPE C,
LINK
(1)       TYPE  C,
PARENTID 
TYPE I,
LANGU
(2) TYPE C,
TXTSH
(20) TYPE C,
TXTMD
(40) TYPE C,
TXTLG
(60) TYPE C,
END OF GS_OUTPUT.

TYPES : BEGIN OF GS_INPUT,
id TYPE uj_dim_member,
parent
TYPE uj_dim_member,
END OF GS_INPUT.

DATAlm_id TYPE uj_dim_member VALUE ‘ID’,
lm_RLI
TYPE uj_dim_member VALUE ‘RLI’,
lm_profit_center
TYPE uj_dim_member VALUE ‘PROFIT_CENTER’,
lm_func_area
TYPE uj_dim_member VALUE ‘FUNC_AREA’.

DATA : GT_INPUT TYPE STANDARD TABLE OF GS_INPUT,
gt_med
TYPE STANDARD TABLE OF gs_input,
gt_med1
TYPE STANDARD TABLE OF gs_input,
gw_med1
TYPE gs_input,
gw_med
TYPE gs_input,
GW_INPUT1
TYPE GS_INPUT,
GT_OUTPUT
TYPE STANDARD TABLE OF GS_OUTPUT,
GW_OUTPUT
TYPE GS_OUTPUT,
GW_OUTPUT1
TYPE GS_OUTPUT,
it_fieldname
TYPE STANDARD TABLE OF s_fieldname,
wa_fieldname
TYPE s_fieldname.

DATA: l_packagesize TYPE i,
lv_tabix
TYPE i,
lt_attr_name
TYPE uja_t_attr_name,
lt_sel
TYPE uj0_t_sel,
ls_sel
TYPE uj0_s_sel,
lo_dim
TYPE REF TO cl_uja_dim,
lr_dim_data
TYPE REF TO if_uja_dim_data,
lr_data
TYPE REF TO data,
ls_data
TYPE REF TO data.

DATA : LV_NODEID TYPE I,
LV_IOBJNAME
TYPE STRING,
LV_DIM
TYPE uj_dim_name,
lv_appset
TYPE uj_appset_id,
lv_tablename
TYPE string,
lv_filename
TYPE STRING,
lv_extn
TYPE STRING VALUE ‘.xls’,
lv_time
TYPE string.
CONSTANTS: lv_path TYPE STRING VALUE ‘C:\End_Output_’.

FIELD-SYMBOLS: <lt_data> TYPE STANDARD TABLE,
<ls_RLI_data>
TYPE ANY,
<ls_RLI>
TYPE ANY,
<gw_input>
TYPE gs_input.

* Selection screen for getting dimension input from the user.

selection-screen begin of block a with frame.
parameters : p_appset type uj_appset_id obligatory default ‘IPM_NA’,
p_dim   
type uj_dim_name obligatory.

selection-screen end of block a.

* Selection screen validation
at selection-screen.
translate p_appset to upper case.
translate p_dim to upper case.
select single appset_id from uja_dimension into lv_appset
where appset_id = p_appset.
if sysubrc <> 0.
message s001(bldisplay like ‘E’ with ‘Appset – ‘ p_appset ‘ not found’.
ENDIF.
select single dimension from uja_dimension into lv_dim
where dimension = p_dim.
if sysubrc <> 0.
message s001(bl) display like ‘E’ with ‘Dimension – ‘ p_dim ‘ not found’.
endif.

REFRESH: lt_attr_name, lt_sel.
CLEAR: ls_sel.

start-of-selection.
TRY .

CREATE OBJECT lo_dim
EXPORTING
i_appset_id
= p_appset
i_dimension
= p_dim.

CATCH cx_uja_admin_error .

ENDTRY.

lr_dim_data = lo_dim.

APPEND: ‘ID’ TO lt_attr_name.

TRY.
CALL METHOD lr_dim_data->read_mbr_data
EXPORTING
it_attr_list
= lt_attr_name

IMPORTING
er_data     
= lr_data.

CATCH cx_uja_admin_error .

ENDTRY.
ASSIGN lr_data->* TO <lt_data>.

gt_input[] = <lt_data>[].

CASE p_dim.
WHEN ‘RLI’.
MODIFY ZRLI_HIER FROM TABLE GT_INPUT.
WHEN ‘TIME’.
MODIFY ZTIME_HIER FROM TABLE GT_INPUT.

ENDCASE.

LOOP at gt_input ASSIGNING <gw_input>.

IF <gw_input>parent = space.
<gw_input>
parent = ‘TOP_HIER’.
ENDIF.
endloop.
gw_input1
id = ‘TOP_HIER’.
gw_input1
parent = space.
append gw_input1 to gt_input.

read table gt_input into gw_input1 with key parent = space.
gw_med
parent = gw_input1parent.
gw_med
id = gw_input1id.
append gw_med to gt_med.
delete gt_input where parent = space.

sort gt_input by parent.
Loop at gt_med INTO gw_med.

read table gt_input into gw_input1 with key parent = gw_medid binary search.
if sysubrc = 0.
lv_tabix
= sytabix.

loop at gt_input INTO gw_input1 from lv_tabix.

if gw_input1parent <> gw_medid.
exit.
endif.
gw_med1
id = gw_input1id.
gw_med1
parent = gw_input1parent.
append gw_med1 to gt_med1.

endloop.
LOOP AT gt_med1 INTO gw_med1.
APPEND gw_med1 to gt_med.
ENDLOOP.

endif.

clear : gw_med,gt_med1,gw_med1.
endloop.

CASE p_dim.
WHEN ‘RLI’.
lv_iobjname
= ‘ZSS_RLI’.
WHEN ‘TIME’.
lv_iobjname
= ‘ZSS_TIME’.

ENDCASE.

IF GT_MED[] IS NOT INITIAL.
LOOP AT GT_MED INTO GW_MED.
IF SYTABIX = 1.
LV_NODEID
= LV_NODEID + 1.
GW_OUTPUT
NODEID = LV_NODEID.
GW_OUTPUT
INFOOBJECT = lv_iobjname.
GW_OUTPUT
NODENAME = GW_MEDID.
GW_OUTPUT
LINK = .
GW_OUTPUT
PARENTID = 0.
GW_OUTPUT
LANGU = ‘EN’.
GW_OUTPUT
TXTSH = .
GW_OUTPUT
TXTMD = .
GW_OUTPUT
TXTLG = .
APPEND GW_OUTPUT TO GT_OUTPUT.
eLSE.
LV_NODEID
= LV_NODEID + 1.
GW_OUTPUT
NODEID = LV_NODEID.
GW_OUTPUT
INFOOBJECT = lv_iobjname.
GW_OUTPUT
NODENAME = GW_MEDID.
GW_OUTPUT
LINK = .
READ TABLE GT_OUTPUT INTO GW_OUTPUT1 WITH KEY NODENAME = GW_MEDPARENT.
IF SYSUBRC = 0.
GW_OUTPUT
PARENTID = GW_OUTPUT1NODEID.
ENDIF.
GW_OUTPUT
LANGU = ‘EN’.
GW_OUTPUT
TXTSH = .
GW_OUTPUT
TXTMD = .
GW_OUTPUT
TXTLG = .
APPEND GW_OUTPUT TO GT_OUTPUT.
ENDIF.
CLEAR : GW_OUTPUT.
CLEAR : GW_MED.
ENDLOOP.
ENDIF.

lv_time = sytimlo.
CONCATENATE lv_path lv_time lv_extn INTO lv_filename.

wa_fieldnamefield = ‘NODEID’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘INFOOBJECT’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘NODENAME’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘LINK’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘PARENTID’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘LANGU’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘TXTSH’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘TXTMD’.
APPEND wa_fieldname TO it_fieldname.
wa_fieldname
field = ‘TXTLG’.
APPEND wa_fieldname TO it_fieldname.

CALL FUNCTION ‘GUI_DOWNLOAD’
EXPORTING
FILENAME                       
= lv_filename
*    FILETYPE                        = ”
WRITE_FIELD_SEPARATOR          
= ‘X’
TABLES
DATA_TAB                       
= GT_OUTPUT
FIELDNAMES                     
= it_fieldname.
IF SYSUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

WRITE : ‘Hierarchies loaded successfully’.

How to modify above code according to your requirement

  CASE p_dim.
WHEN ‘RLI’.
lv_iobjname
= ‘ZSS_RLI’.
WHEN ‘TIME’.
lv_iobjname
= ‘ZSS_TIME’.

ENDCASE.

Please make changes to this case statement to accommodate all property in BPC are covered

CASE p_dim.
WHEN ‘BPCMASTERDATA’.
lv_iobjname
= ‘CORRESPONDINGBWINFOOBJECT’.
ENDCASE.


Steps

  • Create a program in SE38

Step1.png

  •   Execute the program
  • In Selection screen give the BPC Master data name to be loaded to BW Info object

Step2.png

  • Hierarchy loaded successfully from BPC Master data into BW Info object

Step3.png

  • BPC MASTER DATA – Entity

Step4.png

Step5.png

  • BW Info Object – ZSS_RLI


Step6.png


Step7.png

/wp-content/uploads/2014/03/step8_401669.png


How to modify this program according to your requirement


1)      Change the Appset Name in selection screen option


* Selection screen for getting dimension input from the user.

selection-screen begin of block a with frame.
parameters : p_appset type uj_appset_id obligatory default ‘Appsetname’,
p_dim   
type uj_dim_name obligatory.

selection-screen end of block a.

2) Include the BPC Dimension name and its corresponding BW info object name inside the case statement in the program

  CASE p_dim.


    WHEN ‘RLI’. – BPC MASTER DATA DIMENSION NAME               

      lv_iobjname = ‘ZSS_RLI’. – CORRESPONDING BW INFOOBJECT NAME

    WHEN ‘TIME’.

      lv_iobjname = ‘ZSS_TIME’.

  ENDCASE.


Related Content


Help documentation for SAP BPC 7.5 NW can be found in the following location:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c029accf-6d95-2d10-79aa-cc291180bf73?QuickLink=index&overridelayout=true&48842368318534





To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply