¹¤ÒÕ·ÏßÐÞ¸ÄBAPIÆäÖд´½¨ECNº¯ÊýÒѱ»·ÖÀë³öÈ¥²»¹ý´úÂë×¢ÊͲ¿·ÖÓÐʹÓÃECNº¯ÊýµÄTZPP006ÖÐÊÇ´«ÈëÊý¾ÝÊǹ¤Ðò¾ßÌåÊý¾Ýfunctionzoa_enc_routingchange.*----------------------------------------------------------------------**Localinterface:*EXPORTING*VALUE(O_AENNR)LIKEAENRB-AENNR*TABLES*TZPP006STRUCTUREZPP006OPTIONAL*TREURNINGSTRUCTUREZENCRMSOPTIONAL*TZENCRYISTRUCTUREZENCRYIOPTIONAL*----------------------------------------------------------------------clear:treurning[],tzencryi[].³õʼ»¯Á½¸öÊä³ö±ídata:beginoflt_reroutoccurs0,matnrlikerc27m-matnr,ÎïÁϺÅwerkslikerc27m-werks,¹¤³§aennrlikerc271-aennr,ECNºÅÂësttaglikerc271-sttag,¹Ø¼üÈÕÆÚplnnrlikemapl-plnnr,ÈÎÎñÇåµ¥×éÂë--MAPLplnallikeplkod-plnal,grcvornrlikeplpod-vornr,Ïî´ÎºÅnomn(2)typec,ÅÅÐòºÅarbpllikeplpod-arbpl,¹¤×÷ÖÐÐÄsteuslikeplpod-steus,¿ØÖƼüÖµltxa1likeplpod-ltxa1,ÃèÊöbmsch(13)typec,LIKEPLPOD-BMSCH,»ù±¾ÊýÁ¿meinh(3)typec,LIKEPLPOD-MEINH,×÷Òµµ¥Î»umrez(5)typec,LIKEPLPOD-UMREZ,¼ÆÁ¿µ¥Î»×ª»»--±íÍ·umren(5)typec,LIKEPLPOD-UMREN,¼ÆÁ¿µ¥Î»×ª»»--¹¤Ðòvgw01(9)typec,LIKEPLPOD-VGW01,×¼±¸¹¤Ê±vge01(3)typec,LIKEPLPOD-VGE01,×¼±¸¹¤Ê±-µ¥Î»vgw02(9)typec,LIKEPLPOD-VGW02,»úÆ÷¹¤Ê±vge02(3)typec,LIKEPLPOD-VGE02,»úÆ÷¹¤Ê±µ¥Î»vgw03(9)typec,LIKEPLPOD-VGW03,È˹¤¹¤Ê±vge03(3)typec,LIKEPLPOD-VGE03,È˹¤¹¤Ê±µ¥Î»vge04(3)typec,LIKEPLPOD-VGE04,ÆäËû¹¤Ê±µ¥Î»spmuslikeplpod-spmus,·Ö½âÊý±êʾ'x'splim(3)typec,LIKEPLPOD-SPLIM,·Ö½âÊýuenichtlikeplpod-uenicht,ûÓÐÖصþ±êʾckselkzlikeplpod-ckselkz,³É±¾ºËËã±êʾ*QSEL1LIKEPDORQ-QSEL1,ÐèÇó²ÎÊýÎļþ±êʾĬÈϲÎÊýΪ¡®X¡¯ÏÖÔÚͳһ±ê×¼slwidlikeplpod-slwid,×Ö¶ÎÂëusr00likeplpod-usr00,ÖÜÆÚusr01likeplpod-usr01,ѨÊýusr02likeplpod-usr02,¶Öλifslwidlikeplpod-slwid,×Ö¶ÎÂëendoflt_rerout.*DATA:S_AENNRLIKERC271-AENNR.н¨ECNºÅÂëËùÓÐÎïÁϹ«¹²data:secn_headerlikeaenr_api01.data:trecn_objmgrectypestandardtableofaeoi_api01withheaderline.data:trecn_returntypestandardtableofzoa_s_returnwithheaderline.clearlt_rerout[].loopattzpp006.lt_rerout-matnr=tzpp006-matnr.ÎïÁϺÅÂëlt_rerout-werks=tzpp006-werks.¹¤³§lt_rerout-aennr=tzpp006-aennr.encºÅÂëlt_rerout-plnnr=tzpp006-plnnr.lt_rerout-sttag=sy-datum.¹Ø¼üÈÕÆÚlt_rerout-plnal=tzpp006-plnal.GRClt_rerout-vornr=tzpp006-vornr.appendlt_rerout.clearlt_rerout.*SELECTSINGLEPLNNRINTOLT_REROUT-PLNNRÈÎÎñÇåµ¥×éÂë*FROMMAPL*WHEREMATNR=TZPP006-MATNR*ANDWERKS=TZPP006-WERKS*ANDPLNTY='N'*ANDPLNAL=TZPP006-PLNAL.*IFSY-SUBRC=0.*LT_REROUT-STTAG=SY-DATUM.¹Ø¼üÈÕÆÚ*LT_REROUT-PLNAL=TZPP006-PLNAL.GRC*LT_REROUT-VORNR=TZPP006-VORNR.**APPENDLT_REROUT.*CLEARLT_REROUT.*ELSE.*TREURNING-MATNR=TZPP006-MATNR.*TREURNING-PLNAL=TZPP006-PLNAL.*TREURNING-VORNR=TZPP006-VORNR.*TREURNING-MSTYPE='E'.*TREURNING-MESSAGE='ûÓÐÕÒµ½ÈÎÎñÇåµ¥×éÂ룡'.**APPENDTREURNING.*CLEARTREURNING.*CONTINUE.Ìø³ö±¾´ÎÑ»·¼ÌÐøÏÂÃæµÄÑ»·*ENDIF.endloop.data:beginoflt_aspooccurs0,plnnrlikeplas-plnnr,plnallikeplas-plnal,plnknlikeplas-plnkn,datuvlikeplpo-datuv,ÓÐЧÆðʼÈÕÆÚ¾ÍÊÇÕë¶Ô¸ÃÏîµÄ×îºóÒ»´Îн¨Ïî´Îaennrlikeplpo-aennr,ecnºÅvornrlikeplpo-vornr,nomntypei,ÅÅÐòºÅsteuslikeplpo-steus,arbidlikeplpo-arbid,ltxa1likeplpo-ltxa1,bmschlikeplpo-bmsch,meinhlikeplpo-meinh,umrezlikeplpo-umrez,umrenlikeplpo-umren,vgw01likeplpo-vgw01,vge01likeplpo-vge01,vgw02likeplpo-vgw02,vge02likeplpo-vge02,vgw03likeplpo-vgw03,vge03likeplpo-vge03,vge04likeplpo-vge04,spmuslikeplpo-spmus,·Ö½âÊý±êʾ'x'splimlikeplpo-splim,·Ö½âÊýuemuslikeplpo-uemus,UENICHTLIKEPLPO-UENICHT,ûÓÐÖصþ±êʾckselkzlikeplpo-ckselkz,³É±¾ºËËã±êʾPslwidlikeplpo-slwid,×Ö¶ÎÂëusr00likeplpo-usr00,ÖÜÆÚusr01likeplpo-usr01,ѨÊýusr02likeplpo-usr02,¶Öλendoflt_aspo.data:beginofit_taboccurs0,matnrlikerc27m-matnr,ÎïÁϺÅplnnrlikemapl-plnnr,ÈÎÎñÇåµ¥×éÂë--MAPLendofit_tab.data:lt_aspo1likelt_aspooccurs0withheaderline.¶¨ÒåÄÚ±í2clearit_tab[].loopatlt_rerout.***********»ñÈ¡¶ÔÓ¦Êý¾Ýclear:lt_aspo[],lt_aspo1[].selectplas~plnnrplas~plnalplas~plnknplpo~datuvplpo~aennrplpo~vornrplpo~steusplpo~arbidplpo~ltxa1plpo~bmschplpo~meinhplpo~umrezplpo~umrenplpo~vgw01plpo~vge01plpo~vgw02plpo~vge02plpo~vgw03plpo~vge03plpo~vge04plpo~spmusplpo~splimplpo~uemusplpo~ckselkzplpo~slwidplpo~usr00plpo~usr01plpo~usr02intocorrespondingfieldsoftablelt_aspofromplasinnerjoinplpoonplpo~plnnr=plas~plnnrandplpo~plnkn=plas~plnknwhereplas~plnty='N'andplas~plnnr=lt_rerout-plnnrandplas~plnal=lt_rerout-plnalandplas~loekz'X'.loopatlt_aspo.readtablelt_aspo1withkeyplnnr=lt_aspo-plnnrplnal=lt_aspo-plnalplnkn=lt_aspo-plnknvornr=lt_aspo-vornr.ifsy-subrc=0.iflt_aspo1-datuvlt_aspo-datuv.ÓÐЧÈÕÆÚСÓÚlt_aspo1-datuv=lt_aspo-datuv.lt_aspo1-aennr=lt_aspo-aennr.ECNºÅlt_aspo1-vornr=lt_aspo-vornr.lt_aspo1-nomn=lt_aspo-nomn.lt_aspo1-steus=lt_aspo-steus.lt_aspo1-arbid=lt_aspo-arbid.lt_aspo1-ltxa1=lt_aspo-ltxa1.lt_aspo1-bmsch=lt_aspo-bmsch.lt_aspo1-meinh=lt_aspo-meinh.lt_aspo1-umrez=lt_aspo-umrez.lt_aspo1-umren=lt_aspo-umren.lt_aspo1-vgw01=lt_aspo-vgw01.lt_aspo1-vge01=lt_aspo-vge01.lt_aspo1-vgw02=lt_aspo-vgw02.lt_aspo1-vge02=lt_aspo-vge02.lt_aspo1-vgw03=lt_aspo-vgw03.lt_aspo1-vge03=lt_aspo-vge03.lt_aspo1-vge04=lt_aspo-vge04.lt_aspo1-spmus=lt_aspo-spmus.lt_aspo1-splim=lt_aspo-splim.lt_aspo1-uemus=lt_aspo-uemus.lt_aspo1-ckselkz=lt_aspo-ckselkz.lt_aspo1-slwid=lt_aspo-slwid.lt_