Skip to Content
0

Reading Custom Hierarchy Data in SAP MDG

Oct 21, 2016 at 09:08 AM

255

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

preetham B Oct 24, 2016 at 11:20 AM
0

Dear Experts,

Input on this is really appreciated.

Thanks,

Preetham

Share
10 |10000 characters needed characters left characters exceeded
ramesh gubba Oct 24, 2016 at 02:26 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
preetham B Oct 26, 2016 at 10:04 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Naveen Sharma Dec 16, 2016 at 07:32 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded