cancel
Showing results for 
Search instead for 
Did you mean: 

Need to update Transportation Zone Hierarchy through program.

Former Member
0 Kudos

My requirement is to create transportation zone hierarchy tree with 5 child through program for tcode : /SAPAPO/RELHSHOW.

I created hierarchy through FM : /SAPAPO/REL_CREATE but i m unable to update hierarchy tree with child node from FM : /SAPAPO/RELH_CHANGE.

Please suggest how can i append child node to Transportation Zone Hierarchy.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186731
Active Contributor
0 Kudos

Hi,

to me the function module '/SAPAPO/RELH_CHANGE' looks correct. What error do you get?

Just tried it out and it worked fine for me (of course you need to adjust the GUIDS!!!). The GUID for the Transportation Zone hierarchy can be found in table /SAPAPO/RELDSTR searching with RELNAME = 'RELH_ZONE'. Keep in mind that you can maintain multiple hierarchies in the system, but SAP TM only considers entries from RELH_ZONE!!!

The CHAR22 guids of the zones can be found in table /SCMB/TOENTITY searching with the names in field ENTITY.

DATA: lt_relh_entries TYPE STANDARD TABLE OF /sapapo/relhmodify,
            ls_relh_entry   TYPE                   /sapapo/relhmodify.

ls_relh_entry-pnodeid = '051Mh06I7jEW}ZNmCzeI5W'.  <- ADJUST

ls_relh_entry-cnodeid = '051Mh06I7jEW}ZNmCzeI6W'.  <- ADJUST
ls_relh_entry-clevid  = '001'.
APPEND ls_relh_entry TO lt_relh_entries.

CALL FUNCTION '/SAPAPO/RELH_CHANGE'
  EXPORTING
    iv_hierarchy         = '051Mh06I7k6zqewTbD{IfG' <- ADJUST
  TABLES
    it_relhmodify        = lt_relh_entries
  EXCEPTIONS
    not_qualified        = 1
    relid_not_found      = 2
    relstrid_not_found   = 3
    no_hierarchy_type    = 4
    wrong_hierarchy_type = 5
    OTHERS               = 6.
IF sy-subrc <> 0.
  RETURN.
ENDIF.

Cheers,

Marcus

Former Member
0 Kudos

Hello Inderjeet Kalra,

Maybe you can post this question in some APO/SCM group too, probably there you will have the answer.

Regards, Marcelo Lauria