How to find direct & indirect BW hierarchy nodes?

Hi Group,
Is there a class or function module that would allow me to find the direct and indirect sub-nodes in a hierarchy?
For example, I have a time and version dependent hierarchy for company (coming from SEM-BCS).
I would like to pick a node (node A) and find out all the direct and indirect nodes beneath node A.
HIEID
+ Node A
+ + Node B
+ + Node C
+ + + Node D
+ Node E.
So if I input node A, I would get back Nodes B, C and D but not E (E is at same level as A).
I can loop through the hierarchy tables and find this, but I'm curious if there is an existing FM or method to do this already.  No sense in re-writing existing code.
Thanks in advance,
- Chris

Thanks, that FM is very useful.
Because the hierarchy I was working with originates in SEM-BCS, I was able to use the BCS master data factory to ultimately get what I needed. 
The BCS delivered logic can be viewed in CL_UC_SSCR_GENERATE_GUI and method PROCESS_USER_SELECTION.  It uses the BCS selection context + the consolidation group (aka Hierarchy Node) to determine the lower level consolidation groups which must also be provided in the selection criteria when querying data. 
It's more complex than seems necessary, but it's using the BCS hierarchy data rather than the BW hierarchy data, which is probably a good thing.
Thanks,
Chris

Similar Messages

  • How to provide a list of Hierarchy-nodes for selections?

    Hi specialists,
    some of our users often want to use some hierarchy-node-values from one report as filter of a 2nd report.
    For all non-hieararhy-values it is possible to do that using the clipboard.
    But there seems not to be a way to do the same with hierarchy-nodes.
    Is there any workaround to reach that target?
    Btw: I'm talking about users using the BEx 3.5 Analyzer.

    Hello,
    was this problem resolved?
    can you please temm me how you resolved this issue?
    Actually I also am having similar requirements in the project.
    Thank you.

  • How to find tech nodename based on node description (text) from hierarchy

    Hi Friends,
    There is a 0ACCOUNT hierarchy. If you open the hierarchy thru info objects maitenance screen using "Maintain Hierarchies", it is displayed in hierarchical arrangement.
    Here we give text description to 0HIER_NODE object to denote the title of group/category; a technical name is also assigned in NODENAME column in /BI0/HACCOUNT table for each 0HIER_NODE description. And child node contains actual values of 0ACCOUNT.
    My question is, I want to find out the technical name (NODENAME) from the title text description (0HIER_NODE) of group/category. where is the relation between text descripion  (0HIER_NODE) and technical name (NODENAME) is stored?
    Any help will be appriciated.
    Regards,
    Purvang

    Hi,
    Go to se11 check the contents of the table RSTHIERNODE with the parameters LANGU (your language) HIEID = A and NODENAME the technical node name of a hierarchy.
    There you go.
    Diogo.

  • How to find the id of the node given the path using connect by?

    I have a table like this:
    CREATE TABLE tab1 (Id INTEGER, Name VARCHAR2(100), ParentId INTEGER)
    Let's say I have the following rows:
    Id name ParentId
    1 X NULL
    2 Y 1
    3 Z 2
    4 A 3
    Now, given the path /X/Y/Z/A, I need to return 4
    Is it possible to achieve this using CONNECT BY?
    If it helps, I have over simplified the scenario - that a node has only one child. In reality, a node can have many children.
    Thanks.

    Hi,
    user2888313 wrote:
    Thanks for the suggestions - will follow from now on. Here's one way to post the sample data, given the CREATE TABLE statement you posted earlier:
    -- Basic data:
    INSERT INTO tab1 (id, name, parentid) VALUES (1,  'X', NULL);
    INSERT INTO tab1 (id, name, parentid) VALUES (2,  'Y', 1);
    INSERT INTO tab1 (id, name, parentid) VALUES (3,  'Z', 2);
    INSERT INTO tab1 (id, name, parentid) VALUES (4,  'A', 3);
    -- To test branching (i.e., multiple children for the same parent):
    INSERT INTO tab1 (id, name, parentid) VALUES (11, 'P', 1);
    INSERT INTO tab1 (id, name, parentid) VALUES (12, 'Q', 1);
    INSERT INTO tab1 (id, name, parentid) VALUES (13, 'R', 12);Alternatively, you could post a WITH clause, as someone did above.
    I am not clear how to use the LEVEL pseudo column. Should I just start from the root, find all paths up to the level I am looking for? Could you please give me the syntax? Sorry, I'm still not clear what you want, or why you want it.
    Do you want 4 because 'A' is the 4th generation in this family tree (that is, because 'A' has 3 ancestors), or do you want 4 because id=4 is on the same row as name='A'? In the former case, use LEVEL; in the latter, use the id column.
    This query shows both:
    SELECT  SYS_CONNECT_BY_PATH (name, '/')          AS name_path
    ,     LEVEL                                AS lvl
    ,     id
    FROM     tab1
    START WITH     parentid     IS NULL
    CONNECT BY     parentid     = PRIOR id
    ;Output from the expanded sample data:
    NAME_PATH                   LVL         ID
    /X                            1          1
    /X/Y                          2          2
    /X/Y/Z                        3          3
    /X/Y/Z/A                      4          4
    /X/P                          2         11
    /X/Q                          2         12
    /X/Q/R                        3         13

  • WEB: How to filter a Dataprovider by hierarchy nodes

    Hello All.
    We have in our web template 2 dataproviders, one to show a table with different ratios for a PRODUCT, and another to show one Ratio by product but USING HIerarchy.
    I am tring to create an HTTP url to filter by characteristic product (which is not a problem) and also to filter the hierarchy but a node.
    Right now I am using the following commandad:
    http://psigue-mad1.elmundo.int:8002/sap/bw/BEx?sap-language=ES&bsplanguage=ES&CMD=LDOC&TEMPLATE_ID=Z_PRODUCTO_AR_PRUEBA_ESTADO_SE&FILTER_IOBJNM=CPRODUCTO&FILTER_VALUE=PERIODICO&FILTER_NODE_IOBJNM=0HIER_NODE
    The problem is that the query which uses the hierachy doesn´t show the subnodes of the selected one.
    I hope any of the experts arround here can help me with this.

    ¿No ideas for this?
    Bassicly, what we want to do is to filter a Hierrachy textnodes and its subnodes.
    Regards,.

  • How set up visualization attributes for Hierarchy nodes?

    I have a hierarchy for 0ACCOUNT and i see in the report the hierarchy totally expanded but in the Query Designer i can
    set the values for 0ACCOUNT to show the ID only for every account but the hierarchy have more nodes (text nodes in addition to accounts) i need that ONLY TEXT NODES show the Description of Text Nodes instead of Technical Node ID........in query designer you could set for accounts that show Text, ID or both but in for text nodes there´s no way to do this.......in Query execution you could set up this with extended menu....and you could set up that only shows Text for Hierechy nodes.....I hope somebody could help me with this...
    Regards

    You are right, the only way to do that is save the query as workbook, then setup the description, text, etc in the workbook , and finally save the workbook in the way you want to view.
    Regards

  • How do we create variable for hierarchy node selection

    hello all,
    I have to create a variable as to where the user ca input the node of hierarchy in his selection at the start. Do we have to create a new variable ?
    I have the hierarchy loaded for that infoobject. I tried creating a new variable but the when I select from drop down as varaibles and name of the hierarchy no variables shows up.
    Thanks

    Hi Raj,
    Please see this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/83/096d399bd2046fe10000000a114084/content.htm
    It has complete details.
    Hope this helps...

  • How to find if a particular context node attribute is changed.

    Hi,
    When a screen is opened, the context node attribs has some values.  On some event, i wanted to check if one particular attribute in the context node has changed.  Is it possible to figure this out.
    (ps note that I need not find if any change has happened to the entire table but only one column (attribute) of the node.  Note that the node has cardinality 0...n.  So there are multiple possible values)
    Thanks in advance.
    regards,
    suresh.

    Hi,
    If you use the [Context change log|http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/f95e42ff93c153e10000000a1550b0/frameset.htm]
    and loop over the result table, looking for a certain attribute name and node name,
    you'll get all the changes of that attribute, for all elements in that node.
    grtz,
    Koen

  • How to switch ON/OFF Unassigned Hierarchy Nodes during Query Runtime?

    We have a GL Account Hierarchy based on an FSV that we use in BW reports.
    All our reports are web reports accessible via BW Portal.
    This hierarchy has an Unassigned Node also that we have suppressed (switched off) for display via Hierarchy Attributes Settings.
    When you check the Suppress Unassigned Node box the unassigned nodes do not show on the report.
    This has been working fine so far until we have this one requirement where user would like to see unassigned GL Accounts also.
    We would like to check/uncheck this flag (Supress Unassigned Node) during the query run time.
    Is there a way to control showing/hiding of unassigned node of a hierarchy during query runtime?

    Hi Ram,
    If you have set hierarchy attribute as display unassigned node, then you can simply select the root as filter in order not to display the unassignd node.
    However if you have set hierarchy attribute as suppress unassigned node, then you can't choose the unassigned node by the filter.
    So if users want both, you need to set hierarchy attribute as display unassigned node. You cannot really change this setting at runtime by user.
    Regards,
    Patricia

  • How to find direction for address using google map

    Hi all,
    Please help me solve this .
    i want to see the (way)direction from office to account address in google map below each each contact details.
    i created a Account Web Applet, it is showing account address correctly
    http://maps.google.com/?q=%%%Bill_To_ADDR_Address1%%%,+%%%Bill_To_CITY_City%%%,+%%%Bill_To_COUNTRY_Country%%%
    But i want to see the direction from office, ..
    Thanks in Advance.
    [email protected]
    Uthaya.

    Hello,
    This is what you have to use as an example
    http://maps.google.com/maps?f=d&source=s_d&saddr=Collins+Street,+Melbourne,+Victoria,+Australia&daddr=Elizabeth+Street,+Melbourne,+Victoria,+Australia
    h5. This is the from address
    Collins+Street,+Melbourne,+Victoria,+Australia
    h5. This is the end location
    Elizabeth+Street,+Melbourne,+Victoria,+Australia
    What you will need to do is relace these values with %%%Bill_To_Addr_Address1%%% and so on

  • Create CRM customer/account hierarchy node thru abap code

    Hi,
    Any one can help me on how to Create CRM customer/account hierarchy node thru abap code?
    Is there any Class/methods, FMs that I can use to create node in customer/account hierarchy?
    Sample codes will greatly help me.
    I hope someone can help me on this since this is my urgent requirements on my project.
    Thanks,
    james

    James,
    You can find the FM, Class Lib and APIs under the package BUPA_HIERARCHY.

  • Retrieving value of a Hierarchy Node Varaible in Web Template

    Could somebody tell me, is it possible to retrieve the value of a variable when the characteristic is in free characteristics,
    if possible how to Retrieve value of a Hierarchy Node Varaible.
    -Shashi

    Hi Kim,
    you can use command for expand/collapse hierarchy nodes "SET_DRILL_STATE" for your DataProvider together with the print command "EXPORT". For a button group webitem you can build a command sequence in WAD.
    SET_DRILL_STATE
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/7b5f0a95ce12d0e10000000a422035/frameset.htm
    Export Web Application
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/85de4943af5919e10000000a1553f7/frameset.htm
    Regards
    Andreas

  • How to find out the descendants of one node that has a nameplace

    hello
    i got a littile trouble when i try to find out the
    descendants of node which has a nameplace,check this sample code
    below please.
    no matter i try to use the node's local name,name,i still got
    a blank.i am confused about that.
    do u people know how to solove that? i really want get that
    descendants of node with nameplace.
    hope u can help me,thx vv much.

    though i have a vicarious solution,but i don't want use it
    right now,i think there would be exist a direct way.
    attach my vicarious solution:
    function getDescendants(xml:XML,des:String="*") {
    var list:XMLList=xml.descendants("*");
    var rlist:XMLList=new XMLList();
    for each (var node:XML in list) {
    if (node.localName()==des || des=="*") {
    rlist+=node;
    return rlist;
    var xl:XMLList=getDescendants(xx,"b");
    trace(xl.length());//output:1
    trace(xl[0].toXMLString());//output:<bb:b
    xmlns:bb="bb.*"/>
    and yes,the final result is what i want,but i don't like its
    course.

  • How can i find out the table hierarchy

    Hi experts,
    I have one doubt. how can i find out the table hierarchy in the particular schema.
    Let me explain my requirement in detail.. In my Database i have nearly 250 table each table have it's own temporary table(for authorization purpose we are maintaining the temporary tables) for each day i have to clear the temporary table data.
    All temporary table connected with each other. i mean all the table having foreign key relationship.. while i attempt the delete the data from the temporary table it showed ORA-02292: integrity constraint  violated - child record found.
    So can any one please tell how can i delete the child table record first and then parent record table record.
    Thanks in advance
    Arun

    CREATE OR REPLACE FUNCTION get_child_tables (
    ptable VARCHAR2,
    powner VARCHAR2 DEFAULT 'SCOTT',
    plevel NUMBER DEFAULT 10
    RETURN stringarray
    -- -- create this ON SQL*PLUS "CREATE OR REPLACE TYPE STRINGARRAY AS TABLE OF VARCHAR2(50);"
    -- AUTHID CURRENT_USER
    PIPELINED
    AUTHOR DATE VERSION COMMENTS
    ======================================================================================
    [email protected] 26-OCT-2009 1.0 Developed to ease developers effort to find Nth level of Referential integrity
    ======================================================================================
    -- PURPOSE -> To find PARENT=> CHILD relational TABLE(S) in Oracle upto a depth max N Level.
    --SYNTAX TO USE
    SELECT * FROM TABLE( get_child_tables('DEPT','SCOTT',3)); Store this query in a file for your use
    SELECT * FROM TABLE( get_child_tables('EMPLOYEE')); Store this query in a file for your use
    -- RESULTS looks as below
    --1 => DEPT
    --2 => EMP
    --2 => EMP2
    --3 => EMP_CHILD
    --3 => EMP2_CHILD
    -- and so on
    --This can be leveraged to use in any oracle database REGION 10g having and above.
    --This FUNCTION gives formatted result of the Oracle 10g Hierarchical query result coded in the cursor
    --to find MASTER => CHILD relational TABLE(S) upto a depth max 10 Level.
    --The result of the PIPELINED function can be retrieved using Oracle new operator
    --TABLE(array name) in SQL query.
    --Due to the AUTHID CURRENT_USER compiler directive any user can use based on his/her access privileges on the database.
    --GRANT EXECUTE ON SCOTT.get_child_tables TO PUBLIC;
    --CREATE OR REPLACE PUBLIC SYNONYM get_child_tables FOR SCOTT.get_child_tables;
    IS
    atname stringarray := stringarray ();
    -- create this ON SQL*PLUS CREATE OR REPLACE TYPE STRINGARRAY AS TABLE OF VARCHAR2(50);
    vlevel NUMBER;
    vtname VARCHAR2 (50);
    nindex NUMBER := 0;
    bprocessed BOOLEAN := FALSE;
    CURSOR c1 (powner_in IN VARCHAR2, ptable_in VARCHAR2, plevel_in NUMBER)
    IS
    SELECT LEVEL, LPAD (' ', (LEVEL - 1) * 2, ' ') || pt AS "TNAME"
    FROM (SELECT a.owner w1, a.table_name pt, a.constraint_name c1,
    a.r_constraint_name r1, b.owner w2, b.table_name ct,
    b.constraint_name c2, b.r_constraint_name r2
    FROM all_constraints a, all_constraints b
    WHERE a.constraint_name = b.r_constraint_name(+)
    AND a.owner = b.owner(+)
    AND a.owner =
    UPPER (powner)
    -- Change Owner here while testing
    --AND A.r_constraint_name IS NULL
    AND a.constraint_type IN ('P', 'R')) v1
    START WITH pt =
    UPPER
    (ptable)
    -- Change your master table here while testing the QUERY
    CONNECT BY PRIOR ct = pt AND LEVEL <= plevel;
    -- Change lavel here while testing
    BEGIN
    atname.EXTEND;
    atname (1) := 'NOTHING';
    OPEN c1 (powner, ptable, plevel);
    LOOP
    bprocessed := FALSE;
    FETCH c1
    INTO vlevel, vtname;
    IF nindex > 1 AND atname (atname.LAST - 1) = vtname
    THEN
    --DBMS_OUTPUT.PUT_LINE('2 ==== vtname  ' ||vtname || '   '|| atname.count|| '   '||atname.last ||  '   '||atname( atname.last-1));
    bprocessed := TRUE;
    END IF;
    IF NOT bprocessed
    THEN
    nindex := nindex + 1;
    atname.EXTEND;
    atname (nindex) := vtname;
    PIPE ROW (vlevel || ' => ' || vtname);
    DBMS_OUTPUT.put_line ( ' **** nindex - atname( nindex) '
    || nindex
    || ' - '
    || atname (nindex)
    DLOG('ADDING ',vTname); A LOGGING ATONOMUS PROCEDURE FOR DEBUG PURPOSE
    END IF;
    EXIT WHEN c1%NOTFOUND;
    END LOOP;
    CLOSE c1;
    FOR i IN 1 .. atname.COUNT
    LOOP
    DBMS_OUTPUT.PUT_LINE('atname (i) ' ||atname (i));
    END LOOP;
    RETURN;
    EXCEPTION
    WHEN no_data_needed
    THEN -- THIS EXCEPTION HAS TO BE THERE TO GET THE FUCTION WORKABLE
    DBMS_OUTPUT.put_line (SQLERRM);
    RETURN;
    --SELECT * FROM TABLE( get_child_tables('TB_XOP_LETR_TEMPLATE','OPS$CMS',5));
    END get_child_tables;
    Edited by: user3066657 on Jul 21, 2011 8:42 AM
    Edited by: user3066657 on Jul 21, 2011 11:26 AM

  • Hierarchy Node Variable search (find) option not working

    Hi Experts - I have created a hierarchy node varibale on a fixed hierarchy. When user run the report and click on hierarchy node variable selection option , A new window will pop up which has all the nodes.
    As the list is quite big and has many levels , On the same pop up , we have find option , when we enter any node in the find box , its always give a ABAP Dump , It never works for me...
    Is node find/search in not working in Bi 7.0 .
    Thanks
    R

    Hi Rohan,
    We can restrict the hierchey level at property of of the hiearchey enabled characteristic.
    Hope this hels...let me know if u require any further info on this..
    Best Regards,
    Maruthi

Maybe you are looking for