Skip to Content
avatar image
Former Member

Reading Custom Hierarchy Data in SAP MDG

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 24, 2016 at 11:20 AM

    Dear Experts,

    Input on this is really appreciated.

    Thanks,

    Preetham

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 24, 2016 at 02:26 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 26, 2016 at 10:04 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 16, 2016 at 07:32 AM

    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

    Add comment
    10|10000 characters needed characters exceeded