2014 Dec 25 7:26 AM
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..?
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
2014 Dec 26 2: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.
2015 Jan 02 9: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
2015 Mar 14 9: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
2015 Apr 13 4: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
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |