Skip to Content

Topic:

The purpose of these articles is to

  • Create a custom hierarchy in BW- using a DSO or Master data(Part 1)
  • Debug a Custom Hierarchy.(Part 2)

Back ground :

  1. More often we encounter issues which can only be dealt using custom hierarchy in BW , but unfortunately/fortunately BW requires a very specific set of keys to generate a hierarchies, being it a time dependent or independent.

          this article will help developer to build Hierarchy within BW for data coming from

  • Non SAP source system.
  • Within BW from one hierarchy to another hierarchy( one MD to another MD).
  • Within BW combining 2 or more hierarchy and uploading it in another hierarchy.

    2.  Debugging a custom hierarchy.

System:

SAP BI 7.x.

General Concept:

The target Info object has to be made as Export DS and reconnect the info object as self loop.

In self loop:  Look up has to be done on DSO/Provider  and update the Hierarchy with DSO/provider Data.

Data Flow Diagram:

HIERARCHY DATA FLOW.JPG

Requirement   Specification 1 : Data coming from NON SAP System and stored in Transaction DSO

  • As above Fig. create a DSO with Field which are needed for BW Hierarchy

Key fields

    1. NODEID (Node ID)

Data Fields

    1. IOBJNM ( Info Object)
    2. NODENAME(Node Name)
    3. TLEVEL(level)
    4. LINK(Link)
    5. PARENTID(Parent ID)
    6. CHILDID(Child ID)
    7. NEXTID(Next ID)
    8. 0DATEFROM(Valid from)
    9. 0VALIDTO(Valid To)
    10. LANGU(LANGU)
    11. Short Description for Hierarchy
    12. Medium Desc for Hierarchy
    13. Description for Hierarchy.
  • Create transformation for DSO to get data from Non SAP Data Source (if the data is not being populated in above format, logic has to be written to               generate/populate data in above format).
  • Right click and create export Data source for the target master data(ZTEST_IO) within the system and reconnect it for the same hierarchy DS as 8ZTEST_IOH.
  • IO Export DS.JPG
  • Now since the data has been loaded in DSO it has to be load to Master Data
    1. Create Implementation on BADI .
  1. SE18.JPG        
  2. Create an implementation on BADI.
  3. Implementation.JPG
  4. Activate the Implementation.
  5. Class has been created now Double click on the Implementing class( for below example ZCL_IM_TEST1)
  6. Class Details.JPG
  7. It will direct you to methods for same Implementing class :There are 2 type of methods in the Implementing class :
    1. IF_EX_RSU5_SAPI_BADI~DATA_TRANSFORM
    2. IF_EX_RSU5_SAPI_BADI~HIER_TRANSFORM
  8. Implementating Class.JPG
  9. Double click on IF_EX_RSU5_SAPI_BADI~HIER_TRANSFORM
  10. It will direct you to enhance the method source code.
  11. Hierarchy Enhancement.JPG
  12. Enhancement code:
  13. Enhancement code.JPG

  • Run Hierarchy info package no special setting required, the above code will allow developer to pick up records from the DSO.
  • Code :

Info object : ZTEST_IO

IO Data Source: 8ZTEST_IOHHierarchy DSO: TESTHIER   CASE I_DATASOURCE.WHEN ‘8ZTEST_IOH’.
FIELD-SYMBOLS:
<ZFS_T_HIENODE>
TYPE ROSHIENODE.
TYPES: BEGIN OF TY_TESTHIER,
/BIC/ZNODEID
TYPE  /BIC/OIZNODEID,
/BIC/ZIOBJNM 
TYPE /BIC/OIZIOBJNM,
/BIC/ZNODENAME 
TYPE /BIC/OIZNODENAME,
/BIC/ZTLEVEL 
TYPE /BIC/OIZTLEVEL,
/BIC/ZLINK 
TYPE /BIC/OIZLINK,
/BIC/ZPARENTID 
TYPE /BIC/OIZPARENTID,
/BIC/ZCHILDID 
TYPE /BIC/OIZCHILDID,
/BIC/ZNEXTID 
TYPE /BIC/OIZNEXTID,
DATEFROM 
TYPE /BI0/OIDATEFROM,
DATETO 
TYPE /BI0/OIDATETO,
/BIC/ZLANGU 
TYPE /BIC/OIZLANGU,
/BIC/ZTXTSH 
TYPE /BIC/OIZTXTSH,
/BIC/ZTXTMD 
TYPE /BIC/OIZTXTMD,
/BIC/ZTXTLG 
TYPE /BIC/OIZTXTLG,END OF TY_TESTHIER.
DATA: WA_T_HIENODE TYPE ROSHIENODE,
IT_T_HIENODE
TYPE STANDARD TABLE OF ROSHIENODE,
IT_TESTHIER
TYPE STANDARD TABLE OF TY_TESTHIER,
WA_TESTHIER
TYPE TY_TESTHIER.
SELECT /BIC/ZNODEID
/BIC/ZIOBJNM
/BIC/ZNODENAME
/BIC/ZTLEVEL
/BIC/ZLINK
/BIC/ZPARENTID
/BIC/ZCHILDID
/BIC/ZNEXTID
DATEFROM
DATETO
/BIC/ZLANGU
/BIC/ZTXTSH
/BIC/ZTXTMD
/BIC/ZTXTLG
FROM /BIC/ATESTHIER00INTO TABLE IT_TESTHIER.
CLEAR WA_T_HIENODE.
LOOP AT IT_TESTHIER INTO WA_TESTHIER.

WA_T_HIENODENODEID = WA_TESTHIER/BIC/MNODEID.
WA_T_HIENODE
IOBJNM = WA_TESTHIER/BIC/MIOBJNM.
WA_T_HIENODE
TLEVEL = WA_TESTHIER/BIC/MTLEVEL.
WA_T_HIENODE
LINK = WA_TESTHIER/BIC/MLINK.
WA_T_HIENODE
PARENTID = WA_TESTHIER/BIC/MPARENTID.
WA_T_HIENODE
CHILDID = WA_TESTHIER/BIC/MCHILDID.
WA_T_HIENODE
NEXTID = WA_TESTHIER/BIC/MNEXTID.
WA_T_HIENODE
DATEFROM = WA_TESTHIERDATEFROM.
WA_T_HIENODE
DATETO = WA_TESTHIERDATETO.
APPEND  WA_T_HIENODE TO IT_T_HIENODE.
ENDLOOP.
SORT IT_T_HIENODE BY NODEID.
REFRESH C_T_HIENODE[].

C_T_HIENODE[] = IT_T_HIENODE[].
REFRESH IT_T_HIENODE[].ENDCASE.

Requirement   Specification 2 :  Hierarchy Data coming from SAP / NON SAP System and stored in Master Data. Info Object look up.JPG

  1. All will be same as above except look up will be from Hierarchy table of Info Object 2(H table)

          SELECT * FROM /BIC/HINFOOBJ2


Part 2 will explain how to debug this code at run time.


To report this post you need to login first.

2 Comments

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

Leave a Reply