cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Custom Hierarchy Data in SAP MDG

Former Member
0 Kudos

Dear MDG Experts,

We have created few custom Hierarchies as per the customer requirement, Now I need to create few custom reports with Hierarchy data ( Node Name, Sub Node Name, Level etc) and send to other systems. I have checked all the available API's CL_USMD_GOV_API, CL_USMD_HRY_API,CL_USMD_READ_API but could not get the data which is saved in the stating tables.

If any one would have worked on fetching of the hierarchy data, please share it.

Thanks and Regards,

Preetham.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member288488
Participant
0 Kudos

Hi Preetham,

Please let me know if you got the solution for this as I have similar sort of requirement. I need to capture all the child items that are deleted automatically when a parent node is deleted.

Currently MDG does not capture USMD_OBSOLETE = 'X' for child items , please let me know if I can do some customization to achieve this.

Thanks,Naveen

Former Member
0 Kudos

Hi Ramesh,

Thanks for your reply. I tried to implement this logic, it is giving NID, Parent NID and Is_Leaf. My requirement is to display the data of all sub nodes with the respective level. Is there a standard way to get the data which is saved in staging/active tables if you provide the parent hierarchy name.

Thanks and Regards,

Preetham

Former Member
0 Kudos

Hi ,

Please try this . We used below APIs may be works for you .

TRY.
CALL METHOD cl_usmd_hry_factory=>get_hry_api
EXPORTING
iv_model = p_model
RECEIVING
ro_hry_api = lo_hry.
CATCH cx_usmd_hry .
ENDTRY.


CALL METHOD lo_hry->get_hry_id
EXPORTING
iv_fieldname = gv_entity "'CCTRG'
* IV_HRY_VERS =
iv_hry_edition = ls_edtn-usmd_edition
IMPORTING
ev_hry_id = lv_hry_id
ET_MESSAGE = lt_message .

CALL METHOD lo_hry->get_hry_tree_id
EXPORTING
iv_hry_id = lv_hry_id
IMPORTING
ev_hry_tree_id = lv_hry_tree_id
ET_MESSAGE = lt_message .


CALL METHOD lo_hry->get_tree
EXPORTING
iv_hry_tree_id = lv_hry_tree_id
iv_whole_subtree = 'X'
it_sel = lt_selopt
IMPORTING
et_tree = lo_tree.

Former Member
0 Kudos

Dear Experts,

Input on this is really appreciated.

Thanks,

Preetham