sniper_99
8th February 2008, 12:32
Afs Gurus,

We try to automate report orders completed session tisfc0520m000 and error message "Effectivity Unit 0 does not exists in Order Distribution" always occur. We are not using effectivity unit in our company. And when we check the tisfc001 using GTM, field odpr (Order Distribution Present) set to No.

But when we executed the session tisfc0520m000 manually it generates no error.

We are using LN6.1 FP2.

Attached is the function and afs.log for your reference:

function test()
{
long nret
string err.msg(100)
domain tcpdno pdno

stpapi.put.field("tisfc0520m000","tisfc001.pdno","WF1002348")
nret = stpapi.find("tisfc0520m000",err.msg)
if nret = 1 then
nret = stpapi.synchronize.dialog("tisfc0520m000","modify",err.msg)
stpapi.put.field("tisfc0120s000","tisfc001.qtdl","2")
stpapi.enum.answer("tisfc0120s000","tisfc01021",tcyesno.yes)
stpapi.enum.answer("tisfc0120s000","tisfc02029",tcyesno.yes)
stpapi.enum.answer("tisfc0120s000","tisfc02023",tcyesno.no)
nret = stpapi.update("tisfc0520m000",false,err.msg)
if nret then
nret = stpapi.save("tisfc0520m000",err.msg)
endif
endif
stpapi.end.session("tisfc0520m000")
}


**************
AFS.LOG
**************
LOGGING STARTED
08-02-2008
>tisfc0520m000(80) put.field:tisfc001.pdno WF1002348
>tisfc0520m000 Find
76dll->serv (def.find☺80)
tisfc0520m000(80)-RUNNING:def.find
80serv<-4gl (def.find☺0☺1)
tisfc0520m000(80)-RUNNING:
<tisfc0520m000 record found (1)
76dll->serv (start☺tisfc0120s000☺1☺tisfc0520m000☺1☺21)
82serv<-4gl (init.ready)
tisfc0120s000(82)-RUNNING:
76dll->serv (syncmodify☺80)
tisfc0520m000(80)-RUNNING:syncmodify
80serv<-4gl (syncmodify☺0)
tisfc0520m000(80)-RUNNING:
>tisfc0120s000(82) put.field:tisfc001.qtdl 2
>tisfc0120s000 enum.answer tisfc01021:1
76dll->serv (enum.answer☺tisfc01021☺1☺82)
tisfc0120s000(82)-RUNNING:enum.answer
82serv<-4gl (enum.answer☺0)
tisfc0120s000(82)-RUNNING:
>tisfc0120s000 enum.answer tisfc02029:1
76dll->serv (enum.answer☺tisfc02029☺1☺82)
tisfc0120s000(82)-RUNNING:enum.answer
82serv<-4gl (enum.answer☺0)
tisfc0120s000(82)-RUNNING:
>tisfc0120s000 enum.answer tisfc02023:2
76dll->serv (enum.answer☺tisfc02023☺2☺82)
tisfc0120s000(82)-RUNNING:enum.answer
82serv<-4gl (enum.answer☺0)
tisfc0120s000(82)-RUNNING:
>tisfc0120s000 update
76dll->serv (modify.set☺82)
tisfc0120s000(82)-RUNNING:modify.set
82serv<-4gl (modify.set☺1☺0)
tisfc0120s000(82)-RUNNING:
<tisfc0120s000 Effectivity Unit 0 does not exist in order distribution.
>tisfc0520m000 end.session
76dll->serv (end.program☺80)
tisfc0520m000(80)-RUNNING:end.program
tisfc0120s000(82)-RUNNING:end.program
80serv<-4gl (end.program☺0)
tisfc0520m000(80)-RUNNING:
80dll->serv (tisfc0520m000: exit(80))
82dll->serv (tisfc0120s000: exit(82))
76dll->serv (afsscript: exit(76))


Any idea will be a great help for us.

Thanks,
Sniper

mark_h
8th February 2008, 13:41
All I can recommend is doing a search on tisfc0520m000 - it turned up this thread here (http://www.baanboard.com/baanboard/showthread.php?t=9891&highlight=tisfc0520m000). There is another thread also that you might want to look at. Please keep in mind that your objects may not be the same between systems - you might need updated session or stpapi libraries.

sniper_99
9th February 2008, 04:34
Thanks Mark, i will keep you posted..