Hi Shivaji,
If you wish to traverse from child to root, BOPF model will automatically taken care for the association called to_root using retrieve_by_association. There is no need to get Root key to get the root data,
io_read->retrieve_by_association(
EXPORTING
it_key = it_key
iv_node = zif_bo_c=>sc_node-child_name
iv_association = zif_bo_c=>sc_association-child_name-to_root
iv_fill_data = abap_true"we need root data
IMPORTING
et_target_data = lt_root ).
whereas zif_bo_c is the constant interface for the particular BO.
Regards,
Dhivya