anjunath
26th July 2015, 10:26
Hi,
I am unable to insert values in tfacr1110s000 using AFS .I am using Infor ERPLN . While debugging an error message is coming like :"ttstps0036"
The below is my source code :
******************************************************************************
|* 15-07-21 [14:58]
|******************************************************************************
|* Script Type: 0
|******************************************************************************
|****************************** declaration section ***************************
#pragma used dll ottstpapihand
#pragma nowarnings
#define ERR shiftl$(shiftr$(error)) <> ""
#include <bic_tt>
|****************************** DECLARATION SECTION ***************************
table ttfgld100
table ttfgld101
table ttfgld102
double trans.amnt
long ret, opno,ret1,ret2
string error(256),sess(13),sub.sess1(13),sub.sess2(13),seqn(4),docn(10),lino(10),
str.btno(11),err.str(50),suno(6),suno1(6),ccur(3),isup(30),refa(30),docd(10),error.msg(256)
domain tcbool afs.success,first.record,valid.data
long amnt, line, doc, rp, reof, wp,dbcr
string leac(12),refr(30),file.name(50), buff(1024), err.file(50),ttyp(3)
double line.amnt, inv.amnt
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
|****************************** CHOICE SECTION ***************************
|****************************** FIELD SECTION ***************************
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
function main()
{
clean.mess()
afs.success = false
str.btno = "0"
stpapi.put.field("tfgld1101m000", "tedt.f", str$(date.num()))
stpapi.put.field("tfgld1101m000", "tfgld100.year", str$(2015))
stpapi.put.field("tfgld1101m000", "tfgld100.bref", "test")
stpapi.put.field("tfgld1101m000","tfgld100.fprd","7")
ret = stpapi.insert("tfgld1101m000", true, error)
if ERR then
message("Cannot Create Batch :- ",shiftl$(error))
stpapi.recover("tfgld1101m000", error)
stpapi.end.session("tfgld1101m000", error)
else
stpapi.get.field("tfgld1101m000","tfgld100.btno",str.btno)
afs.success = true
message("Batch %d",str.btno)
endif
if afs.success then
ret = stpapi.find("tfgld1101m000", error)
if ret then
stpapi.handle.subproc("tfgld1101m000","tfgld1101m100","add")
stpapi.put.field("tfgld1101m100", "tfgld101.year", str$(2015))
stpapi.put.field("tfgld1101m100", "tfgld101.btno", str$(str.btno))
stpapi.put.field("tfgld1101m100", "tfgld101.ttyp", str$("EMD"))
ret = stpapi.insert("tfgld1101m100", true, error)
if ret = 1 then
afs.success = true
else
message(" 2 %s",error)
afs.success = false
endif
else
message(" 3 %s",error)
afs.success = false
endif
ret = stpapi.find("tfgld1101m100", error)
if ret = 1 then
ret = stpapi.mark("tfgld1101m100", error)
afs.success = true
else
message(" 1 %s",error)
afs.success = false
endif
message("Batch Created %s",str.btno)
stpapi.browse.set( "tfgld1101m100" ,"last.set" ,error )
stpapi.handle.subproc("tfgld1101m100", "tfacr1110s000", "add")
stpapi.handle.subproc("tfacr1110s000", "tfacr1111s000", "kill")
stpapi.continue.process("tfgld1101m100",error )
stpapi.put.field("tfacr1110s000", "tfacr200.ttyp", "EMD")
stpapi.put.field("tfacr1110s000", "tfacr200.ninv", "615")
stpapi.put.field("tfacr1110s000", "tfacr200.itbp", "EMP100001")
stpapi.put.field("tfacr1110s000", "tfacr200.styp", "SLS")
stpapi.put.field("tfacr1110s000", "tfacr200.pfbp", "EMP100001")
stpapi.put.field("tfacr1110s000", "tfacr200.ccur", "AED")
stpapi.put.field("tfacr1110s000", "tfacr200.docd", "15/07/2015")
stpapi.put.field("tfacr1110s000", "screen.amnt", "1000")
stpapi.put.field("tfacr1110s000", "tfacr200.refr", "test")
ret =stpapi.insert( "tfacr1110s000", false, error)
If ret = 1 then
stpapi.save( "tfacr1110s000", error)
message("Record3 inserted successfully")
else
error.msg = stpapi.get.mess.code("tfacr1110s000", error)
if isspace(error.msg) then
else
message("not inserted :" &error.msg)
endif
stpapi.recover("tfacr1110s000",error)
message("Insert not saved:" &error)
endif
stpapi.handle.subproc("tfacr1110s000", "tfacr1111s000", "add")
stpapi.continue.process("tfacr1110s000" ,error)
stpapi.put.field("tfacr1111s000", "tfgld102.leac", "11900")
stpapi.put.field("tfacr1111s000", "tfgld102.dim1","1000")
stpapi.put.field("tfacr1111s000", "amount", "1000")
ret =stpapi.insert("tfacr1111s000",FALSE, error)
If ret = 1 then
message("Record3 inserted successfully")
else
stpapi.recover( "tfacr1111s000",error)
message("Insert sub:" &error)
endif
stpapi.end.session( "tfacr1111s000", error)
stpapi.end.session( "tfacr1110s000", error)
stpapi.end.session("tfgld1101m100", error)
stpapi.end.session( "tfgld1101m000", error)
endif
}
I am unable to insert values in tfacr1110s000 using AFS .I am using Infor ERPLN . While debugging an error message is coming like :"ttstps0036"
The below is my source code :
******************************************************************************
|* 15-07-21 [14:58]
|******************************************************************************
|* Script Type: 0
|******************************************************************************
|****************************** declaration section ***************************
#pragma used dll ottstpapihand
#pragma nowarnings
#define ERR shiftl$(shiftr$(error)) <> ""
#include <bic_tt>
|****************************** DECLARATION SECTION ***************************
table ttfgld100
table ttfgld101
table ttfgld102
double trans.amnt
long ret, opno,ret1,ret2
string error(256),sess(13),sub.sess1(13),sub.sess2(13),seqn(4),docn(10),lino(10),
str.btno(11),err.str(50),suno(6),suno1(6),ccur(3),isup(30),refa(30),docd(10),error.msg(256)
domain tcbool afs.success,first.record,valid.data
long amnt, line, doc, rp, reof, wp,dbcr
string leac(12),refr(30),file.name(50), buff(1024), err.file(50),ttyp(3)
double line.amnt, inv.amnt
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************
|****************************** CHOICE SECTION ***************************
|****************************** FIELD SECTION ***************************
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
function main()
{
clean.mess()
afs.success = false
str.btno = "0"
stpapi.put.field("tfgld1101m000", "tedt.f", str$(date.num()))
stpapi.put.field("tfgld1101m000", "tfgld100.year", str$(2015))
stpapi.put.field("tfgld1101m000", "tfgld100.bref", "test")
stpapi.put.field("tfgld1101m000","tfgld100.fprd","7")
ret = stpapi.insert("tfgld1101m000", true, error)
if ERR then
message("Cannot Create Batch :- ",shiftl$(error))
stpapi.recover("tfgld1101m000", error)
stpapi.end.session("tfgld1101m000", error)
else
stpapi.get.field("tfgld1101m000","tfgld100.btno",str.btno)
afs.success = true
message("Batch %d",str.btno)
endif
if afs.success then
ret = stpapi.find("tfgld1101m000", error)
if ret then
stpapi.handle.subproc("tfgld1101m000","tfgld1101m100","add")
stpapi.put.field("tfgld1101m100", "tfgld101.year", str$(2015))
stpapi.put.field("tfgld1101m100", "tfgld101.btno", str$(str.btno))
stpapi.put.field("tfgld1101m100", "tfgld101.ttyp", str$("EMD"))
ret = stpapi.insert("tfgld1101m100", true, error)
if ret = 1 then
afs.success = true
else
message(" 2 %s",error)
afs.success = false
endif
else
message(" 3 %s",error)
afs.success = false
endif
ret = stpapi.find("tfgld1101m100", error)
if ret = 1 then
ret = stpapi.mark("tfgld1101m100", error)
afs.success = true
else
message(" 1 %s",error)
afs.success = false
endif
message("Batch Created %s",str.btno)
stpapi.browse.set( "tfgld1101m100" ,"last.set" ,error )
stpapi.handle.subproc("tfgld1101m100", "tfacr1110s000", "add")
stpapi.handle.subproc("tfacr1110s000", "tfacr1111s000", "kill")
stpapi.continue.process("tfgld1101m100",error )
stpapi.put.field("tfacr1110s000", "tfacr200.ttyp", "EMD")
stpapi.put.field("tfacr1110s000", "tfacr200.ninv", "615")
stpapi.put.field("tfacr1110s000", "tfacr200.itbp", "EMP100001")
stpapi.put.field("tfacr1110s000", "tfacr200.styp", "SLS")
stpapi.put.field("tfacr1110s000", "tfacr200.pfbp", "EMP100001")
stpapi.put.field("tfacr1110s000", "tfacr200.ccur", "AED")
stpapi.put.field("tfacr1110s000", "tfacr200.docd", "15/07/2015")
stpapi.put.field("tfacr1110s000", "screen.amnt", "1000")
stpapi.put.field("tfacr1110s000", "tfacr200.refr", "test")
ret =stpapi.insert( "tfacr1110s000", false, error)
If ret = 1 then
stpapi.save( "tfacr1110s000", error)
message("Record3 inserted successfully")
else
error.msg = stpapi.get.mess.code("tfacr1110s000", error)
if isspace(error.msg) then
else
message("not inserted :" &error.msg)
endif
stpapi.recover("tfacr1110s000",error)
message("Insert not saved:" &error)
endif
stpapi.handle.subproc("tfacr1110s000", "tfacr1111s000", "add")
stpapi.continue.process("tfacr1110s000" ,error)
stpapi.put.field("tfacr1111s000", "tfgld102.leac", "11900")
stpapi.put.field("tfacr1111s000", "tfgld102.dim1","1000")
stpapi.put.field("tfacr1111s000", "amount", "1000")
ret =stpapi.insert("tfacr1111s000",FALSE, error)
If ret = 1 then
message("Record3 inserted successfully")
else
stpapi.recover( "tfacr1111s000",error)
message("Insert sub:" &error)
endif
stpapi.end.session( "tfacr1111s000", error)
stpapi.end.session( "tfacr1110s000", error)
stpapi.end.session("tfgld1101m100", error)
stpapi.end.session( "tfgld1101m000", error)
endif
}