swanandp
22nd July 2004, 15:53
While executing a save function of a maintain session through AFS we are getting a fatal error "Process terminated by display server". What can we do to resolve this problem?
mark_h
22nd July 2004, 16:15
What session? Does it run correctly for a number of records before the error?
Mark
swanandp
23rd July 2004, 11:38
We are facing the problem with the type 3 session Transactions - tfgld1101m000.
The following is the code that we have written for inserting a new record in tfgld1101m000
|********************************************************
edate = date.num()
stpapi.put.field( "tfgld1101m000", "tedt.f", str$(edate) )
year=2004
stpapi.put.field( "tfgld1101m000", "tfgld101.year", str$(year) )
bat_desc = "Batch thru AFS"
stpapi.put.field( "tfgld1101m000", "bref.f", bat_desc )
|* Query to get the latest batch number
select tfgld014.*
from tfgld014
where tfgld014._index1 = { :year }
as set with 1 rows
selectdo
btno = tfgld014.lbno + 1
selectempty
btno = 1
endselect
stpapi.put.field( "tfgld1101m000", "tfgld101.btno", str$(btno) )
fprd=09
stpapi.put.field( "tfgld1101m000", "fprd.f", str$(fprd) )
rprd=09
stpapi.put.field( "tfgld1101m000", "rprd.f", str$(rprd) )
tyear=2004
stpapi.put.field( "tfgld1101m000", "vyer.f", str$(tyear) )
tprd=09
stpapi.put.field( "tfgld1101m000", "vprd.f", str$(tprd) )
new.batch = true
ret = stpapi.change.view( "tfgld1101m000" )
ttyp="100"
stpapi.put.field( "tfgld1101m000", "tfgld101.ttyp", ttyp )
ret = stpapi.insert( "tfgld1101m000", 1, sess.error )
if not isspace(sess.error) then
message("Insert Error " & sess.error)
ret = stpapi.recover( "tfgld1101m000", sess.error )
endif
stpapi.end.session( "tfgld1101m000" )
|********************************************************
The error occurs at the stpapi.insert statement although the record is correctly inserted in the table tfgld101.
mark_h
23rd July 2004, 15:35
Is it dropping your connection? This almost sounds like you need new objects, tool set and maybe even a porting set. Another thing you can try is to find the batch in tfgld1100m000, do a continue, then insert into tfgld1101s000. That is how the one we have works.
Mark