iuovchin
16th March 2015, 13:20
stpapi.put.field("tfgld1101m000", "tedt.f",str$(data.v))
stpapi.put.field("tfgld1101m000", "bref.f", n1.bref)
stpapi.put.field("tfgld1101m000", "fprd.f", str$(fin.p))
stpapi.put.field("tfgld1101m000", "rprd.f", str$(otch.p))
stpapi.put.field("tfgld1101m000", "vprd.f", str$(nal.p))
retval = stpapi.change.view("tfgld1101m000", o.mess)
stpapi.put.field("tfgld1101m000", "tfgld101.ttyp", n1.ttyp)

retval = stpapi.insert("tfgld1101m000", true,o.mess)

if not retval then
message(o.mess)
retval = stpapi.recover("tfgld1101m000", o.mess)
stpapi.end.session("tfgld1101m000")
return
endif


if retval then
retval2 = stpapi.mark("tfgld1101m000", o.mess)
if not retval2 then
message(o.mess)
retval2 = stpapi.recover("tfgld1101m000", o.mess)
stpapi.end.session("tfgld1101m000")
abort()
endif

if retval2 then
stpapi.continue.process( "tfgld1101m000", o.mess )
stpapi.handle.subproc("tfgld1101m000", "tfcmg2130s000", "add")

select tfacr200.cuno :b.cuno,tfacr200.ttyp :ttyp1, tfacr200.ninv :ninv1, tfacr200.ccur :b.ccur ,
tfacr200.ficu :b.ficu, tfacr200.orno :b.orno ,tfacr200.balc,tfacr200.docd
from tfacr200
where tfacr200._compnr = :comp.rez
and tfacr200.trec = 1
and tfacr200.balc<>0
and tfacr200.cuno = " 950"


selectdo

select tfacr200.cuno :cuno9,tfacr200.ttyp :ttyp9, tfacr200.ninv :ninv9, tfacr200.ccur :ccur,
tfacr200.ficu :ficu , tfacr200.orno :orno,
tfacr200.balc,tfacr200.docd
from tfacr200
where tfacr200._compnr = :comp.rez
and
tfacr200.trec = 9
and tfacr200.balc<>0
and tfacr200.orno<>0
and tfacr200.cuno = :b.cuno
and tfacr200.ccur = :b.ccur
and tfacr200.ficu = :b.ficu
and tfacr200.orno = :b.orno


selectdo

stpapi.put.field("tfcmg2130s000", "tfacr200.cuno", cuno9)
stpapi.put.field("tfcmg2130s000", "tfacr200.ttyp", ttyp9)
stpapi.put.field("tfcmg2130s000", "tfacr200.ninv", str$(ninv9))

retval2 = stpapi.mark("tfcmg2130s000", o.mess)
if not retval2 then
message(o.mess)
retval2 = stpapi.recover("tfcmg2130s000", o.mess)
stpapi.end.session("tfcmg2130s000")
stpapi.end.session("tfgld1101m000")
is.found.error = 1
abort()
else


stpapi.handle.subproc("tfcmg2130s000", "tfcmg2105s000", "modify")
stpapi.continue.process("tfcmg2130s000",o.mess)

stpapi.put.field("tfcmg2105s000", "tfcmg207.cuno", b.cuno)
stpapi.put.field("tfcmg2105s000", "tfcmg207.comp", str$(comp.rez))
stpapi.put.field("tfcmg2105s000", "tfcmg207.ttyp", str$(ttyp1))
stpapi.put.field("tfcmg2105s000", "tfcmg207.ninv", str$(ninv1))
stpapi.put.field("tfcmg2105s000", "ninv.ccur",str$(ccur))

retval = stpapi.find("tfcmg2105s000",o.mess)
if retval then
retval2 = stpapi.mark("tfcmg2105s000", o.mess)

stpapi.put.field("tfcmg2105s000","tfcmg207.type", str$(tfcmg.rcpt.automatic))
retval = stpapi.update("tfcmg2105s000",true, o.mess)
if not retval then message(o.mess) endif

retval2 = stpapi.save("tfcmg2105s000",o.mess)
if not retval2 then message("not saved") else

stpapi.get.field("tfcmg2105s000","tfcmg207.type", edsc )

retval2 = stpapi.mark("tfcmg2105s000", o.mess)
if not retval2 then message(o.mess) endif

stpapi.get.field("tfcmg2105s000","ninv.ccur", edsc )
stpapi.handle.subproc("tfcmg2105s000", "tfcmg2114s000", "modify")
stpapi.continue.process("tfcmg2105s000",o.mess)


stpapi.put.field("tfcmg2114s000","main.docn", str$(100))
retval = stpapi.update("tfcmg2114s000",true,o.mess)
if not retval then retval2 =stpapi.recover("tfcmg2114s000", o.mess) message(o.mess) endif


stpapi.end.session("tfcmg2114s000", o.mess)
endif
endif
endif

selectempty
message("Данные не выбраны - tfacr200-9")
RETURN
endselect

selectempty
message("Пусто")
endselect
endif

stpapi.end.session("tfcmg2105s000")
stpapi.end.session("tfcmg2130s000")




when i use debugger,on line:
"instpapi.end.session("tfcmg2114s000", o.mess)"

i get message:
Reference does not exist:
FROM tfacr200[300] TO tcmcs002[300] [ ]

what can i do to solve this problem?
thanks

mark_h
22nd March 2015, 01:51
Does the actual transition always work? If it does you might just trying killing the process. I have posted the code in this forum on locating and killing a session by process id.

mark_h
22nd March 2015, 01:53
Here is one post which contains a link to the code - http://www.baanboard.com/baanboard/showthread.php?t=64539&highlight=kill.