ERP LN Job出错后的状态重置源代码

时间:2022-06-18
本文章向大家介绍ERP LN Job出错后的状态重置源代码,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

ERPLN里面的Job可以通过不同的方式来调用执行,如果在Windows平台的话就用类似自动任务的程序来执行如[URL=http://www.networkautomation.com/automate/9/]Automate[/URL]等,但是我们经常会遇到Job出错的时候,这时候不得不在整个Job的Session执行完毕后来设定Job的状态为Free,那么下面的一段代码做成一个Session之后加入到Job的最后来执行就可以解决出错后自动修改状态的问题。

<br/>|******************************************************************************<br/>|* Main table ttaad500 , Form Type 4<br/>|******************************************************************************<br/>                                                                                <br/>|****************************** declaration section ***************************<br/>declaration:<br/><br/>    table   tttaad500 | <br/>  <br/>    extern  domain  tcmcs.str32  job.f,job.t<br/><br/><br/>|****************************** program section ********************************<br/><br/><br/>|****************************** group section **********************************<br/><br/>group.1:<br/>init.group:<br/>   get.screen.defaults()<br/><br/>|****************************** choice section ********************************<br/><br/>choice.cont.process:<br/>on.choice:<br/>   execute(print.data)<br/><br/>choice.print.data:<br/>on.choice:<br/>   if rprt_open() then<br/>       read.main.table()<br/>       rprt_close()<br/>   else<br/>       choice.again()<br/>   endif<br/><br/><br/>|****************************** field section *********************************<br/><br/><br/>|****************************** function section ******************************<br/><br/>functions:<br/><br/>function read.main.table()<br/>{<br/>      select  ttaad500.*<br/>      from  ttaad500 for update<br/>      where   ttaad500._index1 >= :job.f<br/>      and ttaad500._index1 <= :job.t<br/>      and ttaad500.jsta = ttaad.jsta.runtime.error  <br/>      order by ttaad500._index1<br/>     selectdo<br/>       ttaad500.jsta = ttaad.jsta.not.active<br/>       db.update(tttaad500, db.retry)<br/>    commit.transaction()<br/>       <br/>           rprt_send()<br/>     endselect<br/>}<br/>

另外请注意:

1、Form上的job.f和job.t的Zoom Session选择ttaad5500m000 2、Job的几种状态:Blocked,Running,Free,Runtime Error