Write an ABAP to build a hierarchy

Hi,
I have a table TVBVK that is required to be read off from to create a hierarchy. The fiedl VKBUR is used to create a root node and the field VKGRP is then to be used to create the leaves. Has anyone written a program to read from this table and then create a hierarchy? Would this be possible? How owuld I approach writing a program for this requirement?
Thanks

Hi Will,
Please check this link perhaps it may help.
http://www.sap-img.com/abap/how-to-create-tree-control.htm
Regards,
Ferry Lianto

Similar Messages

  • Building an hierarchy in Universe

    Hi,
    Please help us how to build a Hierarchy based on particular values. i.e we need to create an hierarchy in universe level(for ex: Derived Table) and database is SQL Server.
    hierarchy : Year->Quarter->month-> date
    For date object the query is current date value. (this we can get)
    Month -> It should be last day on of the day value in that particular month(i.e if jan is the month then we should get 31st value as month value)
    Quarter -> It should be last day value of the quarter (i.e if quarter =2 then we should get quarter 2 value as june 30th value)
    Year-> last day of the year as year value.
    Thanks In Advance

    Hi Suresh,
    So you want to create a Hierarchy where you would be combining multiple dimensions such as Year > Quarter > Month > Date.
    Create a new hierarchy from hierarchy editor, Tools > Hierarchies.
    When hierarchy editor opens you will see all available objec in your universe on the left side of the pane.
    You have to add required objects on the right side.
    When you are creating new hierarchy you are creating new new folders in the custom hierarchy pane and then adding required dimensions.
    Here are the steps...
    1. From the Hierarchies editor, click the New button.
    2. Type a name for the hierarchy.
    3. Press RETURN to apply the name.
    4. Select the new hierarchy.
    The hierarchy is highlighted.
    5. Expand a default hierarchy node in the left pane.
    This is the hierarchy that contains dimensions that you want to add to the
    new custom hierarchy.
    6. Click a dimensions you want to add
    Now come to your other issue for selecting last day of the month etc. For this you will have to write down formulas to achieve this functionality.
    Regards,
    Bashir Awan

  • Need ABAP Query Builder Like Ms-SQLQuery Builder for Critical ABAP-Query

    Dear ABAP Friends,
    I Need ABAP Query Builder which is as flexible as Ms-SQLQuery Builder for building Critical ABAP-Queries e.g. "I have 4 master tables , Each master table having self-join with some condition and these 4 Result-Sets have Innser-Join+Left Outer Join " Please Help.

    I have seen TCODE SQ01, But I found that this TCODE may be used to build simple ABAP Query with Selection-screen which can be used for generating simple report. But i think for critical query ??????????
    I have build my Query in MS-SQL and got the right output, Now how do I write this in ABAP Using Join statement. Please Help.....................
    My SQL Query as below(Remember this is a single Query and verified correct in SQL):
    SELECT     P1.PERNR, P1.ENAME, P1.BEGDA AS P1BEGDA, P1.ENDDA AS P1ENDDA, P1.AEDTM AS P1AEDTM, P1.UNAME AS P1UNAME, P1.PERSG, P1.PERSK,
                          P1.PLANS,
           P2.ENDDA AS P2ENDDA, P2.BEGDA AS P2BEGDA, P2.AEDTM AS P2AEDTM, P2.UNAME AS P2UNAME, P2.GESCH, P2.FAMST,
                       P21.ENDDA AS P21ENDDA, P21.BEGDA AS P21BEDDA, P21.AEDTM AS P21AEDTM, P21.UNAME AS P21UNAME, P21.FAMSA, P21.FAVOR, P21.FANAM,
                          P21.FGBDT, P21.FASEX,
                       P0.ENDDA AS P0ENDDA, P0.BEGDA AS P0BEDDA, P0.AEDTM AS P0AEDTM, P0.UNAME AS P0UNAME, P0.MASSN,
                          P0.MASSG
    FROM         (SELECT     TOP (100) PERCENT PA0001_2.PERNR, PA0001_2.ENDDA, PA0001_2.BEGDA, PA0001_2.AEDTM, PA0001_2.UNAME, PA0001_2.PERSG,
                                                  PA0001_2.PERSK, PA0001_2.PLANS, PA0001_2.ENAME
                           FROM          PA0001 AS PA0001_2 INNER JOIN
                                                      (SELECT     PERNR, MAX(ENDDA) AS ENDDA
                                                        FROM          PA0001 AS PA0001_1
                                                        GROUP BY PERNR) AS Pi1
    ON PA0001_2.PERNR = Pi1.PERNR
    AND PA0001_2.ENDDA = Pi1.ENDDA
                                               ORDER BY PA0001_2.PERNR) AS P1 LEFT OUTER JOIN
                              (SELECT     TOP (100) PERCENT PA0000.PERNR, PA0000.ENDDA, PA0000.BEGDA, PA0000.AEDTM, PA0000.UNAME, PA0000.MASSN,
                                                       PA0000.MASSG
                                FROM          PA0000 INNER JOIN
                                                           (SELECT     PERNR, MAX(AEDTM) AS Pi0AEDTM
                                                             FROM          PA0000 AS PA0000_1
                                                             GROUP BY PERNR) AS Pi0 ON PA0000.PERNR = Pi0.PERNR AND PA0000.AEDTM = Pi0.Pi0AEDTM
                                ORDER BY PA0000.PERNR) AS P0 ON P1.PERNR = P0.PERNR LEFT OUTER JOIN
                              (SELECT     TOP (100) PERCENT PA0021.PERNR, PA0021.ENDDA, PA0021.BEGDA, PA0021.AEDTM, PA0021.UNAME, PA0021.FAMSA, PA0021.FAVOR,
                                                       PA0021.FANAM, PA0021.FGBDT, PA0021.FASEX
                                FROM          PA0021 INNER JOIN
                                                           (SELECT     PERNR, MAX(AEDTM) AS Pi21AEDTM
                                                             FROM          PA0021 AS PA0021_1
                                                             GROUP BY PERNR) AS Pi21 ON PA0021.PERNR = Pi21.PERNR AND PA0021.AEDTM = Pi21.Pi21AEDTM
                                ORDER BY PA0021.PERNR) AS P21 ON P1.PERNR = P21.PERNR LEFT OUTER JOIN
                              (SELECT     TOP (100) PERCENT PA0002.PERNR, PA0002.ENDDA, PA0002.BEGDA, PA0002.AEDTM, PA0002.UNAME, PA0002.GESCH,
                                                       PA0002.FAMST
                                FROM          PA0002 INNER JOIN
                                                           (SELECT     PERNR, MAX(ENDDA) AS Pi2ENDDA
                                                             FROM          PA0002 AS PA0002_1
                                                             GROUP BY PERNR) AS Pi2 ON PA0002.PERNR = Pi2.PERNR AND PA0002.ENDDA = Pi2.Pi2ENDDA
                                ORDER BY PA0002.PERNR) AS P2 ON P1.PERNR = P2.PERNR
    xxxxx----
    Edited by: Goutam Roy on May 5, 2009 1:11 PM

  • User Application to build Material Hierarchy

    Hi, I would like to help users to build a hierarchy without having to maintain the hierarchy externally on a spreadsheet and upload it.  So I would like an application that would baskically present a list of materials and allow the user to drag the material to a hierarchy node. 
    1. Do most people just upload their hierarchies to create them?
    2. Is there anything out there that would help the users build a hierarchy like I mentioned?
    3. If I was to build this with Web Dynpro ABAP does anyone know any of the hierarchy tables I would need to populate or any of the standard classes I could use?
    Thanks,

    hi
    there is an application that does what you want, it is BW
    go in transaction rsh1 select 0material and start building.
    nevertheless maintaining a hierarchy on articles could be very long.
    answers to your questions
    1 -in general hierarchies that are loaded are the common ones that are delivered with standard extractors, but you can build it directly in BW, or use sets in ECC and generate the datasource for hierarchy
    2-BW tx rsh1,2 and 3
    3- i don"t remember the names for articles hierarchy (i guess you speak about industry solution) but have a look to table like T161 or T one hundred
    bye
    Boujema

  • What is Report Writer in Abap ?

    What is Report Writer in Abap ?
    How we can write a simple report through report writer .
    It's Tcode , How to proceed ?
    I developed several report through ABAP , but i have no clue about Report Writer .
    What is advantage to using it .
    Plz give some Example .
    Regards : rajneesh

    Hi,
       see the help
    http://help.sap.com/saphelp_47x200/helpdata/en/66/bc7dc143c211d182b30000e829fbfe/frameset.htm
    Regards
    Kiran Sure

  • Logicial Database for FI-CA to write an ABAP Query?

    Does anybody know of a Logicial Database that can be used to write an ABAP Query.
    We are on ERP 6.0, and there does not seem to be one.
    Is there an OSS Note that if applied would activate one?

    no longer required

  • Write an ABAP program in BW which triggers an event in R/3

    Hello People
    Method: I need to create a Process Chain in BW for info package loading. In the PC, after the loading occurs, I need to write an ABAP program which has the FM: RSSM_EVENT _RAISE , which triggers a pre-defined event in R/3.  This event in turn triggers a 'z' program in R/3.
    Now, I know that we can use SM62 in R/3 to create the event. But how and where do i need to write the abap code in BW. And do i just place it in the PC after the loading process? Do i need to inculde the FM in the ABAP code? Does the FM know the server in R/3 ( DEV or QA or PROD ) where it needs to trigger the event? And how do i schedule the 'z' prog, so that it starts after the event?
    Please help.
    Thanks in advance.

    Create and rfc function module in r/3 in which code you trigger the event, created in r/3 too.
    You can, and should to do it, include a report as step in your process chain in order to trigger event at finish of process chain.
    Here a sample
    r/3 side.RFC function (get and trigger event)
    FUNCTION Z_RAISE_EVENT.
    ""Interfase local
    *"  IMPORTING
    *"     VALUE(EVENTID) TYPE  TBTCO-EVENTID
    *"  EXCEPTIONS
    *"      BAD_EVENTID
    *"      EVENTID_DOES_NOT_EXIST
    *"      EVENTID_MISSING
    *"      RAISE_FAILED
    *"      OTHERS
      CALL FUNCTION 'BP_EVENT_RAISE'
        EXPORTING
          EVENTID                      = EVENTID
        EXCEPTIONS
          BAD_EVENTID                  = 1
          EVENTID_DOES_NOT_EXIST       = 2
          EVENTID_MISSING              = 3
          RAISE_FAILED                 = 4
          OTHERS                       = 5
      CASE SY-SUBRC .
        WHEN 1.
          RAISE BAD_EVENTID.
        WHEN 2.
          RAISE EVENTID_DOES_NOT_EXIST.
        WHEN 3.
          RAISE EVENTID_MISSING.
        WHEN 4.
          RAISE RAISE_FAILED.
        WHEN 5.
          RAISE OTHERS.
      endcase.
    ENDFUNCTION..
    BW side.Report to call previous rfc function
    REPORT  Z_RAISE_EVENT                           .
    parameters: EVENTID like TBTCO-EVENTID.
    parameters: destino like RFCDES-RFCDEST.
    parameters: test as checkbox default 'X'.
    IF TEST EQ SPACE.
      CALL FUNCTION 'Z_RAISE_EVENT'
        DESTINATION DESTINO
        EXPORTING
          EVENTID                      = EVENTID
        EXCEPTIONS
          BAD_EVENTID                  = 1
          EVENTID_DOES_NOT_EXIST       = 2
          EVENTID_MISSING              = 3
          RAISE_FAILED                 = 4
          OTHERS                       = 5
      CASE SY-SUBRC .
        WHEN 1.
          RAISE BAD_EVENTID.
        WHEN 2.
          RAISE EVENTID_DOES_NOT_EXIST.
        WHEN 3.
          RAISE EVENTID_MISSING.
        WHEN 4.
          RAISE RAISE_FAILED.
        WHEN 5.
          RAISE OTHERS.
      ENDCASE.
      ENDIF.

  • Is it possible to write an abap code be SAP SQL query.(ECC 6)

    hello guys,
    Is it possible to write an abap code be SAP SQL query.
    Scenario : table A has a field say f1 of length 10 and table B has a field say s1 of lenght 20. in sap sql i am able to link all the other tables but i am not able to link
    table Af1 --->Table Bs1. as the length doesnot match. so is it possibel that using abap code I can pick 10 characters from table A field f1 adjust it to 20 characters using abap and map it to field s1 of table B.
    Please let me know how to accomplish this if possible.
    thanks in advance!!

    Herm,
    Adding code is done in the infoset.
    Please do following:
    > Goto SQ02
    > Type in the infoset that the basis for your query, <change>
    > Press <code> OR <shift><f8>
    > Tou'll see 4 tabs: Extras, Selections, Code, Enhancements.
    > GoTo tab Code
    > Choose the coding section (<f4> gives you an overview)
    > Enter the code.
    You may set a breakpoint to see what the query in SQ01 will do with it.
    Succes!
    Frank

  • Building the Hierarchy in Express Administrator

    Hi,
    I have created few dimentions and Fact using Oracle Express Administrator and have imported the relational table data into them. Now I want to build the hierarchy for my time dimention (Year, Month, Quarter, Date). How to do that efficiently? I have tried "Edit data" option and have created the hierarchy manually by dragging and dropping the data for the "Standard" hierarchy, but it does not seem to be a good way-out as I have more than 5years data (date) in 4 different levels. Can anybody give me a better solution to build the hierarchy?
    Thanx in advance

    Hi Supriyo,
    You have to offer the parent-child relationship information to Express. Your relational table data structure should contain a parent field like this (";" = field separator):
    2000
    2001
    2002
    Q1-00;2000
    Q4-02;2002
    01-00;Q1-00
    12-02;Q4-02
    01-01-00;01-00
    12-31-02;12-02
    Then You can use Import item (I suppose from menu File) or - for dimensions easier way - using wizard but I don't remember where to find it. The result is the same. It will lead You through describing Your input data structure, then it reads the data and updates all appropriate metaobjects. But I'm not sure where the input data can be in a relational table - we used text files.
    Input data are read using self-generated loader (in SPL) - I can offer You it's generalized but simplified version. If You don't know SPL, You can ignore it. Otherwise You can implement it for Your purposes - I think it's possible to read the data directly from relational tables (read doc. & Help).
    The program has three parameters - name of the input file, name of the dimension and name of the hierarchy (You can have more hierarchies in a dimension - then it's the preferable to have each in a separate file).
    We consider 4 fields:
    1. dimension value
    2. long label
    3. short label
    4. parent (as shown in the example above)
    (each column means separate Express object; You can add other columns when You define objects for them first and modify the program)
    define Prg_AktDim program
    "consider Prg_AktDim
    program
    argument jms text
    argument jmDim text
    argument jmHie text
    variable prefixDb text
    variable prefixDim text
    variable f integer
    vrb _Pass integer " current pass or NA if one-pass "
    vrb _tStart text " text start delimiter "
    vrb _TEnd text " text end delimiter "
    vrb _FSep text " field separator "
    prefixDb = extchars (obj(property 'SHORTLABELVAR' jmDim) 1 3) "30.5. joinchars (upcase (extchars (dtb(name) 1 2)) '.')
    if extchars (prefixDb 3 1) ne '.'; then prefixDb = extchars (prefixDb 1 2)
    prefixDim = obj(property 'idcode' jmDim)
    _Pass = 2
    _TStart = '"'
    _TEnd   = '"'
    _FSep   = ';'
    if not isValue (&joinchars (prefixDb prefixDim '.HIERDIM'), jmHie)
    then maintain &joinchars (prefixDb prefixDim '.HIERDIM') add jmHie
    trap on error
    f = fileopen(jms read)
    " FILEREAD SPECIFICATIONS for pass 2 "
    fileread f -
    structured textstart TStart textend TEnd delimiter _FSep -
    FIELD 1 STRIP append &jmDim -
    FIELD 2 STRIP &joinchars (prefixDb prefixDim '.SHORTLABEL') -
    FIELD 3 STRIP &joinchars (prefixDb prefixDim '.LONGLABEL') -
    FIELD 4 STRIP &joinchars (prefixDb prefixDim '.PARENT')(&joinchars (prefixDb prefixDim '.HIERDIM') jmHie) -
    &jmDim = &joinchars (prefixDb prefixDim '.PARENT')(&joinchars (prefixDb prefixDim '.HIERDIM') jmHie)
    call &('xp_dmhiercalc')(jmDim jmHie )
    fileclose f
    return
    error:
    if f ne NA; then fileclose f
    END
    The program doen't update most metaobjects (only 3 of 16:-( so I can't guarantee that the Oracle Express Objects tables (mainly Selector) will work correctly but by us it worked:-)
    Good luck!

  • How to write the ABAP code for Datasource Enhancment

    Hi Team,
                  Can you please help me how to write the code for the enhancement i have made to the standard datasource
    i have added the fields ZZPayer and ZZPayer_access.
    I just wanted to know how to write the ABAP code to populate the data for these fields.
    Regards,
    Pradeep P.

    Hi
    From a performance point of view would like to suggest a few changes :
    WHEN '<DS name>'.
      select zzfields from <table> into itab
      for all entries in c_t_data where <condition>.
      If sy_subrc = 0.
    loop at c_t_data assiging f_c_t_data.
    read itab into wa_itab where key = f_c_t_data-key.
    f_c_t_data-zzfield = wa-itab-zzfield.
    endloop.
    refresh itab.
    regards,
    aparna
    endif.

  • What to write in ABAP program at R/3  to call proxy classes.

    Hi
    I am working on R/3 to File scenario and using ABAP Proxy for outbound.
    I have generated proxy in XI server and have coded the program in R/3 but can one tell me wht code needs to be written in ABAP program at R/3 end to connect to ABAP proxy. How those objects will be available in R/3 side.
    Please help as it's urgent.
    thanks
    Ria

    Hi Rekha,
    Thanks for the link, I did write this code already as follows.
    data prxy type ref to zxico_zproxy_interface_po .     
    create object prxy.                                   
    data it type  zxipurch_order_info_snd.                
    try.                                                  
         it-purchorderinfo_snd-ebeln = '000010'.           
         it-purchorderinfo_snd-werks = '2320'.             
         it-purchorderinfo_snd-bedat = '10/11/2005'.       
         it-purchorderinfo_snd-potype = '0'.               
         call method prxy->execute_asynchronous            
           exporting                                       
             output = it.                                  
          commit work                                      
       catch cx_ai_system_fault .                          
         data fault type ref to cx_ai_system_fault .       
         create object fault.                              
         write :/ fault->errortext.                        
    endtry.          
    When I do syntex check it give me error message:
    The type "ZXICO_ZPROXY_INTERFACE_PO" is unknown.  SInce this object was created in XI client so is not available in the R/3 just wondering do i need to create this in R/3 side.
    Regards
    Ria

  • ABAP-Code Editing classification hierarchy of item

    Hello!
    I try to edit the classification hierarchy of an item with ABAP-coding. unfortunately I haven't found any Function to do so.
    I tried it by using the class CL_RPM_PROJECT and the method assign_to_bucket_hierarchy, but I think the coding of the method is wrong, because it calls the method get_all_relates, which doesn't have any coding and loops over the result-table, which of course is always empty.
    I tried as well the function 'RPM_CREATE_RELATION', but without any success.
    Does any one know how to edit the classification hierarchy with a function?
    Thanks a lot for your help!
    NiNa

    Hello Nina;
    Did you solved this issue?
    I have the same problem, how can I change and assign Item Portfolio to classification hierarchy?
    Best regards,
    Mariano

  • ABAP keyword 'BUILD'

    Hi Guru's,
    I would like to know if ther is any keyword 'BUILD' in ABAP.
    If yes please let me know how it is used.
    regards
    Sunil Kumar P

    Hi,
    The statement has been used in one of the program which has to be upgraded to ECC6.0.
    I could not replace this BUILD statement. Below is the code
    REPORT zghgtmrg .
    merge trkorr-list into a single transport
    TABLES: e070, e070c, e071, e071k.
    PARAMETERS: p_sfile RADIOBUTTON GROUP a,
                p_slist RADIOBUTTON GROUP a.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: p_file                     LIKE rlgrap-filename.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS:  p_list FOR e070-trkorr.
    PARAMETERS: p_trkorr LIKE e070-trkorr DEFAULT 'CD1K90????'.
    DATA: BEGIN OF wk,
                   rec(255),
                   p1(32),
                   p2(32),
                   p3(32),
                   p4(32),
                   p5(32),
                   p6(32),
                   p7(32),
                   p8(32),
                   p9(32),
                   trkorr                  LIKE e070-trkorr,
                   ctr                     TYPE i,
                   as4pos                  LIKE e071-as4pos,
                   errsw,
          END   OF wk.
    DATA: BEGIN OF wk_thiskey,
                     pgmid                 LIKE e071k-pgmid,
                     object                LIKE e071k-object,
                     objname               LIKE e071k-objname,
          END   OF wk_thiskey.
    DATA: BEGIN OF wk_lastkey,
                     pgmid                 LIKE e071k-pgmid,
                     object                LIKE e071k-object,
                     objname               LIKE e071k-objname,
          END   OF wk_lastkey.
    DATA: fe071  LIKE  e071  OCCURS 100  WITH HEADER LINE,
          fe071k LIKE  e071k OCCURS 100  WITH HEADER LINE,
          te071  LIKE  e071  OCCURS 3000 WITH HEADER LINE,
          te071k LIKE  e071k OCCURS 3000 WITH HEADER LINE.
    DATA: BEGIN OF ifile OCCURS 500,
                     rec(255),
          END   OF ifile.
    DATA: x09 TYPE x VALUE '09'.
    *Begin Of Change by v02.01MA3
    DATA L_P_FILE TYPE STRING.
         L_P_FILE = p_list.
    RANGES: i_list FOR e070-trkorr.
    START-OF-SELECTION.
    Check input parameters:
      IF NOT p_slist IS INITIAL.
        DESCRIBE TABLE p_list LINES wk-ctr.
        IF wk-ctr EQ 0.
          MESSAGE i368(00) WITH 'Specify trkorrs in list'.
          EXIT.
        ENDIF.
      ELSE.
        IF p_file IS INITIAL.
          MESSAGE i368(00) WITH 'Specify filename'.
          EXIT.
        ENDIF.
      ENDIF.
      IF NOT p_slist IS INITIAL.
    use p_list from selection screen:
    Check selected transports:
        LOOP AT p_list.
          IF p_list-option NE 'EQ'.
            MESSAGE i368(00) WITH 'Do not use generic selections'.
            MOVE 'X' TO wk-errsw.
            EXIT.
          ENDIF.
        ENDLOOP.
      ELSE.
    Build p_list from (P_FILE).
    This last statement has to be replaced.
    Can anyone guide me on this.
    Regards
    Sunil kumar P

  • Getting a weird error in Report Writer Report(ABAP Reporting tool)

    Hi Guys,
    If anybody has worked on Report Writer Report.Can you help me in this regards?
    There is a peculiar problem for the (Column block) .In the Column block there are 3 key figures(Quantity,Local Currency and Group Currency).
    Of these in the output of the Report Writer Report the Quantity Column is not getting summed up properly.Though the other 2 columns(Local Currency and Group Currency)are reflecting the proper summed up data.
    According to the tables, all of them are reflecting the accurate data.But only for the Quantity column though its reflecting the actual data,but the summation for it is not reflecting the correct data.
    Can anybody tell me if we can attach screen-shots for Questions posted in Forums?
    Please help me in this regards.

    Hi James,
    Thank you for your quick response.
    I checked the report and the remainder functions is not being used.
    The only formulas being used in the report are the following.
    UpperCase ([1])
    + ", " + - This is set to @name
    {@name} + " (" + + ")"
    There are some formatting formulas set on the above values, but other than that, there is a sql query and the "select distinct rows" and "perform grouping on server" is selected.
    Thanks,
    Jayashree

  • Building Tree hierarchy Using nested loops and class cl_gui_column_tree

    Hello gurus,
    I want to create a tree report using custom container and class cl_gui_column_tree. I have read and understood the standard demo report which SAP has provided i.e. SAPCOLUMN_TREE_CONTROL_DEMO. But in this report all the levels nodes are created as constants and hardcoded. I want to create hierarchy using nested loops. For this i took one example of a hierarchy of VBAK-VBELN->VBAP-POSNR Like One sales order has many line items and each line item can have number of line items in billing plan.
    I have done some coding for it.
    FORM build_tree USING node_table TYPE treev_ntab
                                           item_table TYPE zitem_table.              " i created the zitem_table table type of mtreeitm in SE11.
      DATA: node TYPE treev_node,
                 item TYPE mtreeitm.
      node-node_key = root.
      CLEAR node-relatkey.
      CLEAR node-relatship.
      node-hidden = ' '.
      node-disabled = ' '.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      node-isfolder = 'X'.
      node-expander = 'X'.
      APPEND node TO node_table.
      item-node_key = root.
      item-item_name = colm1.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Root'.
      APPEND item TO item_table.
      item-node_key = root.
      item-item_name = colm2.
      item-class = cl_gui_column_tree=>item_class_text.
      item-text = 'Amount'.
      APPEND item TO item_table.
      LOOP AT it_vbeln INTO wa_vbeln.
        node-node_key = wa_vbeln-vbeln.
        node-relatkey = root.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = 'X'.
        node-expander = 'X'.
        APPEND node TO node_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-vbeln.
        APPEND item TO item_table.
        item-node_key = wa_vbeln-vbeln.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_vbeln-netwr.
        APPEND item TO item_table.
        LOOP AT it_posnr INTO wa_posnr.
        node-node_key = wa_posnr-posnr.
        node-relatkey = wa_vbeln-vbeln.
        node-relatship = cl_gui_column_tree=>relat_last_child.
        node-hidden = ' '.
        node-disabled = ' '.
        CLEAR node-n_image.
        CLEAR node-exp_image.
        node-isfolder = ' '.
        node-expander = ' '.
        APPEND node TO node_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-posnr.
        APPEND item TO item_table.
        item-node_key = wa_posnr-posnr.
        item-item_name = colm2.
        item-class = cl_gui_column_tree=>item_class_text.
        item-text = wa_posnr-netpr.
        APPEND item TO item_table.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    Now this program compiles fine and runs till there is only one level. That is root->vbeln. But when i add one more loop of it_posnr it gives me runtime error of message type 'X'. The problem i found was uniqueness of item-item_name as all the sales order have posnr = 0010. What could be done? I tried giving item_name unique hierarchy level using counters just like stufe field in prps eg. 10.10.10, 10.10.20,10.20.10,10.20.20,20.10.10 etc.. etc.. but still i am getting runtime error when i add one more hierarchy using nested loop. Plz guide.
    Edited by: Yayati6260 on Jul 14, 2011 7:25 AM

    Hello all,
    Thanks the issue is solved. The node key was not getting a unique identification as nodekey. I resolved the issue by generating unique identification for each level. Thanks all,
    Regards
    Yayati Ekbote

Maybe you are looking for

  • APC ASSET (cost, payments, debts related to asset)

    Dear sap colleages I need to know these information about an ASSET: Purchased orders, Items from purchase orders, which of these items i've received, i've paid (also date), i've not paid ( amount of debt related to asset) payments in advanced (date),

  • My phone is annoying me.

    I wqas using my Nokia X3 today and The slide keeps stiffening up and not working properly, Also Sometimes when i slide my phone to lock it it turns itself off and sometimes it keeps saying that i either have no signal and that My Sim card isn't in..

  • How to embed an Image onto a Shape?

    I'd like to use Shape.contains() and intersects() functionalities on clipped free-form Images on a custom component. Could we embed an Image into a Shape? If the answe is yes, then, how? If Shape is not usable, then, how could we achieve similar func

  • ITunes Radio cache

    When I listen to the Radio station KQED and come back later to listen live, it starts playing from the place I left off. It will play from exactly the time I left off even a day later. The only solution is to go to KQED website and reload the playlis

  • User Tracking LMS 4.0

    Hello, I can't find all the end user either hostname or IP Address or username but i can see them by MAC address. The switches on which they are connected they are discovered and DATA has been collected for that switch.still the Ip address and hostna