Skip to Content
Author's profile photo Former Member

Understanding how to Preserve Manually maintained Alternate Hierarchies with the new BPC Data Manager Package to Load from BW Hierarchies

With the release of SAP Business Objects Planning and Consolidations (BPC) 7.5, version for SAP NetWeaver into Ramp Up this past December one of the key improvements was the additional BW master data integration.  Specifically BPC 7.5, version for SAP NetWeaver has two new Data Manager Packages / BW Process chains that represent this new set of functionality.  For a detailed look into this functionality you can also reference the excellent {code:html}How-To Guide{code} authored by Jeffrey Holdeman.      0.1. /CPMB/IMPORT_IOBJ_MASTER – BPC Import BW InfoObject Master Data 0.2. /CPMB/IMPORT_IOBJ_HIER – BPC Import BW InfoObject Hierarchy Data _This blog is going to highlight and explain the behavior of the latter of the two new Data Manager Packages listed above. Specifically this blog will highlight the way that hierarchies are mapped from BW InfoObjects to BPC Dimensions and how to “work around” some potentially unfavorable features that are standard with this package._ When running the newly delivered Data Manager Package as the end user you are prompted to select the following fields; your InfoObject Source, The format (external or internal), as well as the name of the transformation file, this is all fairly straight forward as most data manager packages are.    Once the InfoObject Source is selected, the format as well as the transformation file, the next critical step in using this package is to click on the “Set Selection” button and choose the hierarchies you wish to load from your chosen InfoObject.    The end user will be prompted to choose the Hierarchies they want to load into BPC, the hierarchy version (if relevant), the Member ID (the top node in from the hierarchy you wish to load), and the Level (if relevant). One thing that is not extremely clear that I wanted to make crystal is the way that the source and target hierarchies are mapped to one another when using this Data Manager Package. Within this Data Manager Package the first line in the “Set Selection” prompt will load PARENTH1 in the target dimension; the second line will load PARENTH2 and so on.  The standard behavior of this package is to completely blow away / delete all pre-existing hierarchies in your target dimension. There is currently no way to preserve pre-existing hierarchies that you have manually maintained in BPC directly (i.e. PARENTH3) using the standard functionality. To make this package behavior very clear I will outline the behavior step by step: * The hierarchies selected in the data manager prompt interface are matched to the target BPC dimension hierarchies based on their position in the prompt: (using the above screenshot as an example) 0.1. STDHIER will map to and overwrite PARENTH1 0.2. ALTHIER2 will map to and overwrite PARENTH2  *NOTE:* If for example, the end user wanted to reload PARENTH2 by itself from SAP BW this would not be possible as the target hierarchy that is mapped to is determined by the position of the entry on the prompt whereas the source by the contents of the prompt itself; without the first line in the prompt there can be no second.   Once the specifications for the source infoObject and hierarchy have been made, select the “Next” button in the data manager package prompt.    You will then be asked to choose the target dimension you wish to load into. Once you have chosen your target dimension you can simply click the “Finish” button to execute the package.  Multiple customers that I have recently spoken with have communicated a business requirement to *preserve pre-existing hierarchies that are not being loaded into from BW*. For example, if there is an alternate cost center hierarchy that is manually maintained in BPC NW as PARENTH3 the business wants this hierarchy preserved even when loading PARENTH1 and PARENTH2. To achieve this goal we can leverage another recently introduced feature within BPC 7.5 NW; _the data manager package end routine_.   +The following part of this blog will explain how to preserve manually maintained hierarchies in your target dimension that are *NOT BEING LOADED INTO* from BW.+  The _ROUTINE BADI_ was introduced in BPC 7.5 NW which allows you to create an ABAP transformation prior to the execution of the transformation and conversion file (STARTROUTINE) or after the execution of the transformation and conversion file (ENDROUTINE). To create a BADI of type routine, login to the backend NetWeaver BW 7.01 system that your BPC NW system is installed on top of. Once you have logged in to your backend system, navigate to transaction SE19.    Under Create Implementation choose the Enhancement Spot “UJD_ROUTINE” and click Create. Name your Enhancement Implementation.    Select the name of your BADI Implementation, the ABAP Class which will hold the code implementing the routine, and make sure the BADI definition name is BADI_UJD_ROUTINE. Once you have populated these fields click the Green Check Mark to continue. Within the ABAP Class named above (Z_CL_BPC_HIER_UPDATE)  you will have the standard IF_UJD_ROUTINE~RUNROUTINE method which will contain the main portion of code your start or end routine will leverage. For the purposes of our END ROUTINE you will create two other methods as well. 0.1. ADD_TO_HIERARCHIES_TO_BE_UPDAT 0.2. CONVERT_TO_N_FORMAT I will take you now step by step through the process of adding the code necessary to execute this workaround. First navigate to transaction se24 and modify the newly created class we just created Z_CL_HIER_UPDATE. Now you are going to create the two new methods that were just mentioned above.    Type in the text names for both methods and give them descriptions accordingly. Once you have completed this you can select the “CONVERT_TO_N_FORMAT” method and click on the _Parameters_ button. |  | *Parameter*  |  | *Type*  |  | *Associated Type*  | I_HIE_MBR_NODES | Importing | UJA_T_MBR_NODE | | R_HIE_N_NODES | Returning | UJN_T_HIER_NODE |   Populate the parameter selections with the values outlined in the table above.    Once you have populated the parameter fields accordingly click on the button to take you into the actual code of the CONVERT_TO_N_FORMAT class method.   method convert_to_n_format.  data:        ls_hier_nodes   type uja_s_mbr_node,        lt_hier_nodes   type uja_t_mbr_node,        lsn_hier_nodes  type ujn_s_hier_node,        ltn_hier_nodes  type ujn_t_hier_node,        counter         type i.  counter = 1.  refresh r_hie_n_nodes.  lt_hier_nodes = i_hie_mbr_nodes.  sort lt_hier_nodes by parent member.  loop at lt_hier_nodes into ls_hier_nodes.    at new parent.      counter = 1.    endat.    lsn_hier_nodes-nodename = ls_hier_nodes-member.    lsn_hier_nodes-parent = ls_hier_nodes-parent.    lsn_hier_nodes-hier_name = ls_hier_nodes-hier_name.    lsn_hier_nodes-order = counter.    insert lsn_hier_nodes into table r_hie_n_nodes.    counter = counter + 1.  endloop.endmethod.   Cut and paste the above code into the CONVERT_TO_N_FORMAT method and save your work.Back out to the screen listing the methods select the “ADD_TO_HIERARCHIES_TO_BE_UPDAT” method and click on the _Parameters_ button.   |  | *Parameter*  |  | *Type*|  | *Associated Type*.   1.  break-point. endmethod.    Cut and paste the above code into your method and save.We now need to create the Attributes of our class. Hit the back button until you see list of methods that you have been working with.    Click on the Attributes Tab and create the class attributes detailed in the below matrix: |  | *Attribute*  |  | *Level*|  | *Visibility*|  | *Typing*|  | *Associated Type*ex_no_appset_found                   d_appset = p_appset_id.     exit.   endif.  1.  “Read Target Dimension Data     lo_dim = po_model->get_dim_data( i_dim_name  = p_dim_targ i_appl_id   = p_appl_id ).   lo_dim->get_hier_list( importing et_hier_info = lt_hier_info ).     assign ir_data->* to Notice that the dimension member sheet has *three* hierarchies and only *two* that are to be loaded. The standard behavior of this data manager package will be to delete the third manually maintained hierarchy. By employing our newly created End Routine we will be able to preserve the third hierarchy.   Navigate to the BPC for Excel Client and the transformation file associated with your BW hierarchy load package.    Within the transformation file specify the name of your endroutine as illustrated in the screenshot above.    Run your data manager package and specify the hierarchies that you are going to load into PARENTH1 and PARENTH2. ·         STDHIER = PARENTH1 ·         ALTHIER2 = PARENTH2 Run your data manager package and you will see inside of the Admin Console that your target dimension still has all three hierarchies.  

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Nice work - this appears to be a pretty straightforward work around for these particular issues. 

      We're running the BPC 7.0M version now, with plans to move to NW in the future.  After reading this and Jeff's How-To Guide, I'm excited with the direction things are moving with regards to master data.

      1) Our organizational structure allows for a set up where both Cost Center and Profit Center reside in a single dimension called Entity (Cost Center as a child of Profit Center).  I presume that if we set up the same way in 7.5NW that there is no way to take advantage of the master data and/or hierarchy DM packages since there are two infoobjects pointed to a single dimension?

      2) Forgive me as I'm not terribly technical (and it wasn't obvious to me), but would I need to implement the above steps for each dimension that I'd like to load a hierarchy for?  Or is it done once and then it applies to all dimensions?

      2a) Depending on the response to #2, are there any plans to make the above work around part of standard configuration in future releases?  It would seem to me that if it's set one time for all dimensions that it would be good to just have it in place from the get-go.

      3) I assume that if I left out the "ENDROUTINE=BPCHIEUPD" out of the transformation file that it would remove the manually maintained hierarchy, correct?

      4) Any plans for shared infoobjects in future releases so that we can just skip loading master data into BPC from BW altogether?  That's probably far-fetched given the challenges of separate name spaces, but a guy can dream.

      5) Your last sentence mentions a number of new BADIs and that you recommend becoming familiar with them.  Any particular place you'd recommend to learn more about them?

      Jim Link

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Jim,
      Trying to answer the best I can here...

      1) You are correct you would not be able to use the standard however you COULD build a nice workaround in the ROUTINE badi (similar to this workaround) to merge the hierarchies based on a set of rules (attribute relationships, potentially)

      2) You do this once and then you include the ENDROUTINE in each of the Transformation files for the individual Dimensions. The workaround is generic and should work for all cases.

      2a) Agreed -> this is not my call though, I think this is best taken up in the EPM Customer Council ASUG meetings.

      3) Yes

      4) Good dream, but I believe that is a bit farther off

      5) Sure - the Articles/How To Guides section of the EPM workspace is a good area, also with SP3 of BPC 7.5 NW there are now "SAMPLES" that are delivered. When you create a new BADI implementation it will ask you if you want to inherit from the SAMPLE. Say yes and you have a nice set of code to tinker with and get familiar with.

      Hope this helps...

      Author's profile photo Dalil Khan
      Dalil Khan
      Thanks for the very useful blog. I was wondering if you may be able to help me with my situtation.
      I am importing text hierarchy from BW infoobject into BPC. In my datamanager I specify the top level of the hierarchy = TCTB, Empty & Member ID = TB(the top level). It is rejecting all the records. Following is the error log. All records rejected. Is there any way I can import these records. Thanks

      /CPMB/MODIFY completed in 0 seconds
      /CPMB/BW_IOBJ_HIER_SOURCE completed in 0 seconds
      /CPMB/IOBJ_SOURCE_HD_CONVERT completed in 3 seconds
      /CPMB/BPC_HIER_DATA_TARGET completed in 4 seconds
      /CPMB/CLEAR completed in 0 seconds
      FORMAT= No
      Info: Hierarchy node includes text node or external characteristics
      Record count: 2724
      Task name CONVERT:
      No 1 Round:
      Record count: 2724
      Accept count: 2724
      Reject count: 0
      Skip count: 0
      Hierarchy nodes include dimension members that do not exist
      Submit count: 0
      Application: PLANNING Package status: ERROR

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Dhalil, I would need to see what the actual error was to be able to help more. I am not certain. It seems as if the text nodes in your hierarchy are not being created as real nodes in the BPC hierarchy. That would cause this error, however I am uncertain of the root cause without doing a deeper analysis.
      Cheers, Scott
      Author's profile photo Former Member
      Former Member
      Hi Scott,
      good thing there are workarounds being developped ... One question, we have the problem that for manually created members in BPC, which do not exist in the BW hierarchy, its PARENTH1 column is always deleted when running the load hierachy package. Can we use this workaround to solve this problem as well?
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Dries, I am not 100% certain but I believe this methodology could work for your scenario. Cheers, Scott