Ilansu
8th December 2002, 10:38
Hi all
Im having a problem in getting the error message from a session.
Im trying to run the session tdilc1120m000 using AFS.
next.sern=search.for.next.serial.number(temp.cprj,item,temp.cntr,cwar,date)
stpapi.put.field("tdilc1120m000","tdinv100.cprj"," ")
stpapi.put.field("tdilc1120m000","tdinv100.item",item)
stpapi.put.field("tdilc1120m000","tdinv100.cwar",cwar)
stpapi.put.field("tdilc1120m000","tdinv100.idat",str$(date))
stpapi.put.field("tdilc1120m000","tdinv100.sern",str$(next.sern))
stpapi.put.field("tdilc1120m000","tdinv100.kowt","1")
stpapi.put.field("tdilc1120m000","tdinv100.rlcd",suno)
stpapi.put.field("tdilc1120m000","tdinv100.comp",str$(get.compnr()))
stpapi.put.field("tdilc1120m000","tdinv100.odat",str$(date))
stpapi.put.field("tdilc1120m000","tdinv100.pdat",str$(date))
stpapi.put.field("tdilc1120m000","tdinv100.pqan",str$(quan))
stpapi.put.field("tdilc1120m000","tdinv100.wtst","1")
stpapi.insert( "tdilc1120m000", 1, error.mess )
if isspace(error.mess) then
error.mess=stpapi.get.mess.code( "tdilc1120m000" )
I run the session in a debug mode and found that if the item doesnt have a cost price for the requested date the there is a set.input.error() function .
When I run my ASF with the same date I dont get that message and the rest of my code is not executed as it should.(of course there was no insert)
The session get stuck after trying to put value in the subsession tdilc1121s000.
if isspace(error.mess) then
stpapi.handle.subproc("tdilc1120m000","tdilc1121s000","add")
stpapi.continue.process("tdilc1120m000", error.mess)
if isspace(error.mess) then
stpapi.put.field("tdilc1121s000","tdilc102.serb","1")
tpapi.put.field("tdilc1121s000","tdilc102.stun",tiitm001.cuni)
stpapi.put.field("tdilc1121s000","tdilc102.qstr",str$(quan))
stpapi.put.field("tdilc1121s000","tdilc102.qstk",str$(quan))
stpapi.insert( "tdilc1121s000", 1, error.mess )
endif
stpapi.handle.subproc("tdilc1120m000","tdilc1121s000","kill")
stpapi.end.session("tdilc1121s000")
if isspace(error.mess) then
stpapi.put.field("tdilc1120m000","tdinv100.wtst","2")
stpapi.update( "tdilc1120m000", 1, error.mess )
endif
endif
stpapi.end.session("tdilc1120m000")
Any suggestions ?
Thanks
Ilan S
Im having a problem in getting the error message from a session.
Im trying to run the session tdilc1120m000 using AFS.
next.sern=search.for.next.serial.number(temp.cprj,item,temp.cntr,cwar,date)
stpapi.put.field("tdilc1120m000","tdinv100.cprj"," ")
stpapi.put.field("tdilc1120m000","tdinv100.item",item)
stpapi.put.field("tdilc1120m000","tdinv100.cwar",cwar)
stpapi.put.field("tdilc1120m000","tdinv100.idat",str$(date))
stpapi.put.field("tdilc1120m000","tdinv100.sern",str$(next.sern))
stpapi.put.field("tdilc1120m000","tdinv100.kowt","1")
stpapi.put.field("tdilc1120m000","tdinv100.rlcd",suno)
stpapi.put.field("tdilc1120m000","tdinv100.comp",str$(get.compnr()))
stpapi.put.field("tdilc1120m000","tdinv100.odat",str$(date))
stpapi.put.field("tdilc1120m000","tdinv100.pdat",str$(date))
stpapi.put.field("tdilc1120m000","tdinv100.pqan",str$(quan))
stpapi.put.field("tdilc1120m000","tdinv100.wtst","1")
stpapi.insert( "tdilc1120m000", 1, error.mess )
if isspace(error.mess) then
error.mess=stpapi.get.mess.code( "tdilc1120m000" )
I run the session in a debug mode and found that if the item doesnt have a cost price for the requested date the there is a set.input.error() function .
When I run my ASF with the same date I dont get that message and the rest of my code is not executed as it should.(of course there was no insert)
The session get stuck after trying to put value in the subsession tdilc1121s000.
if isspace(error.mess) then
stpapi.handle.subproc("tdilc1120m000","tdilc1121s000","add")
stpapi.continue.process("tdilc1120m000", error.mess)
if isspace(error.mess) then
stpapi.put.field("tdilc1121s000","tdilc102.serb","1")
tpapi.put.field("tdilc1121s000","tdilc102.stun",tiitm001.cuni)
stpapi.put.field("tdilc1121s000","tdilc102.qstr",str$(quan))
stpapi.put.field("tdilc1121s000","tdilc102.qstk",str$(quan))
stpapi.insert( "tdilc1121s000", 1, error.mess )
endif
stpapi.handle.subproc("tdilc1120m000","tdilc1121s000","kill")
stpapi.end.session("tdilc1121s000")
if isspace(error.mess) then
stpapi.put.field("tdilc1120m000","tdinv100.wtst","2")
stpapi.update( "tdilc1120m000", 1, error.mess )
endif
endif
stpapi.end.session("tdilc1120m000")
Any suggestions ?
Thanks
Ilan S