Hello,
Did you check /SAPAPO/STD_HIER_CREATE Report: Create standard hierarchy?
If you want custom development then please refer OSS note 1309645 which have all relevant details in attached PDF file "Define_Hierarchy_Structure.pdf"
Best Regards,
R.Brahmankar