Skip to Content
avatar image
Former Member

getting root data in item node

Hi all,

          i am created 2 nodes . They are root node and item as subnode.

Initially i entered root data then i went to item data ,here i want to read the root data .

How i can read the root data in item node.  ???

ex: root node and item node i am having emp_id field.. here once i enter the root data emp id ,then i go to item node here emp_id filled by default with  emp id entered in root node.

through determination i am trying to read the root data. in item level..

can anyone give me the code to read the root data in item node..?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Dec 26, 2014 at 02:51 AM

    Hello Naveen,

    Every composition subnode ( like your item subnode ) has two default associations. They are "To Parent" and "To Root", since your subnode item is a subnode of the ROOT , executing either of them will get you the ROOT data. Execute a Retrieve By Association, with your item node instance keys , node as ITEM , association as "TO ROOT" or "TO PARENT" and the "IV_FILL_DATA" set to true , to collect the ROOT node data directly from the Retrieve By Association call.

    Regards,

    Indranil.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14, 2015 at 09:01 PM

    Hi Naveen,

    To get RooT data you have to use to_root  association as in your case root is also a parent node you can use to_parent association also.

    io_read->retrieve_by_assocation

           exporting

                          it_key          =  lt_key               " key table  that hold item keys

                          association = item-to_root    " association name (it is created by default)

                          fill_data       = abap_true       "  make it  to fetch data

          Importing

                         et_data =    lt_root_data

    you will get your root data in lt_root_data.

    Regards

    LK

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13, 2015 at 03:41 AM

    Hi Naveen,

    To get the root data create a Determination in item node,

    in the determination do the retrieve with help of parent key

    then the root value will retrieve.

    Then map the root emp_id to item emp_id

    then do_modify and pass item->emp_id to change fields.

    Regards

    Shamsundarsing

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 02, 2015 at 09:44 AM

    Hello Naveen,

          You can able to read the root information from the item information using io_read->retrieve_by_assocation method.

           pass the exporting parameter has

                          it_key          = item key

                          association = item-to_root

                          fill_data        = abap_true

          Importing

                         et_data ( root information )

    Thanks,

    Dinesh

    Add comment
    10|10000 characters needed characters exceeded