I am writing a program to copy routing from one plant to another. Everything works great except for long text. I did search the forum but could not find any helpful tips.
1> I am reading the routing using fm CP_EX_PLAN_READ
CALL FUNCTION 'CP_EX_PLAN_READ'
cmode_imp = 'R'
plnty_imp = wa_rthd-plnty
plnnr_imp = wa_rthd-plnnr
plnal_imp = wa_rthd-plnal
sttag_imp = wa_rthd-datuv
plpo_exp = lt_plpo_exp
pltx_exp = lt_pltx_exp
Even though header and operations has long text, table lt_pltx_exp is not getting populated (lt_plpo_exp is getting right data). Any idea why this would happen?
2> Once I successfully get the long text then what all is the mapping to populate the structure BAPI1012_TXT_HDR_C & BAPI1012_TXT_C, as I am using BAPI_ROUTING_CREATE to create the routing in the new plant.
CALL FUNCTION 'BAPI_ROUTING_CREATE'
testrun = lh_testrun
group = lh_group
groupcounter = lh_groupcounter
task = t_rthd_bapi_n
materialtaskallocation = t_rtma_bapi_n
operation = t_rtop_bapi_n
textallocation = t_rtxo_bapi_n
text = t_rttx_bapi_n
return = t_rt_ret.
Any feed back is greatly appreciated.