veyant
4th October 2006, 16:55
Hi,
I am facing problem in tfcmg2120s000 in inserting a transaction thru AFS.
I created one batch in tfgld1101m000 with transaction type and then called session tfcmg2100s000 to insert record with Type as "journal" and populated the fields with required data and called stpapi.insert and saved the document. It is working fine
Now i call tfcmg2120s000 (Enter Transaction) and try to populate data in fields thru AFS but when i send stpapi.insert, i returns back error "Batch Number not Allowed".
Can somebody help me in this. Given below is the source code which i am using for inserting transction thru tfcmg2120s000.
stpapi.handle.subproc("tfcmg2100s000","tfcmg2120s000","add")
stpapi.form.command("tfcmg2100s000",2,"tfcmg2120s000",cmg.error)
stpapi.put.field( "tfcmg2120s000", "tfgld102.cono", str$(comp.no) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.year", str$(fiscal.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.btno", str$(batch.no) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.ttyp", ttyp )
stpapi.put.field( "tfcmg2120s000", "tfgld102.docn", str$(docno) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.lino", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.serl", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.srno", str$(0) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.tcom", str$(comp.no) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.leac", tfsol912.leac )
if not isspace(tfsol912.dim1) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim1", tfsol912.dim1 )
endif
if not isspace(tfsol912.dim2) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim2", tfsol912.dim2 )
endif
if not isspace(tfsol912.dim3) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim3", tfsol912.dim3 )
endif
if not isspace(tfsol912.dim4) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim4", tfsol912.dim4 )
endif
if not isspace(tfsol912.dim5) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim5", tfsol912.dim5 )
endif
get.country.from.company.data(comp.no)
stpapi.put.field( "tfcmg2120s000", "tfgld102.ccty", tccom000.ccty )
stpapi.put.field( "tfcmg2120s000", "tfgld102.cvat", " ")
stpapi.put.field( "tfcmg2120s000", "form.amount", str$(tfsol912.amnt) )
if tfsol912.tpay = tfacp.tpay.invoice then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dbcr",str$(tfgld.dbcr.debit) )
else
if tfsol912.tpay = tfacp.tpay.sales then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dbcr", str$(tfgld.dbcr.credit) )
endif
endif
stpapi.put.field( "tfcmg2120s000", "tfgld102.qty1", str$(0))
stpapi.put.field( "tfcmg2120s000", "tfgld102.qty2", str$(0))
stpapi.put.field( "tfcmg2120s000", "tfgld102.fyer", str$(fiscal.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.fprd", str$(fiscal.prod) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.ryer", str$(fiscal.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.rprd", str$(rep.prod) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.vyer", str$(tax.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.vprd", str$(tax.prod) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.refr", tfsol912.esdb)
stpapi.insert( "tfcmg2120s000", true, cmg.error )
if isspace(cmg.error) then
stpapi.save( "tfcmg2120s000", cmg.error )
else
stpapi.recover( "tfcmg2120s000", cmg.error )
endif
on stpapi.isert,it returns cmg.error = "batch Number not Allowed".
can somebody help me in this. how i should handle this issue.
thanks
Veyant
I am facing problem in tfcmg2120s000 in inserting a transaction thru AFS.
I created one batch in tfgld1101m000 with transaction type and then called session tfcmg2100s000 to insert record with Type as "journal" and populated the fields with required data and called stpapi.insert and saved the document. It is working fine
Now i call tfcmg2120s000 (Enter Transaction) and try to populate data in fields thru AFS but when i send stpapi.insert, i returns back error "Batch Number not Allowed".
Can somebody help me in this. Given below is the source code which i am using for inserting transction thru tfcmg2120s000.
stpapi.handle.subproc("tfcmg2100s000","tfcmg2120s000","add")
stpapi.form.command("tfcmg2100s000",2,"tfcmg2120s000",cmg.error)
stpapi.put.field( "tfcmg2120s000", "tfgld102.cono", str$(comp.no) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.year", str$(fiscal.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.btno", str$(batch.no) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.ttyp", ttyp )
stpapi.put.field( "tfcmg2120s000", "tfgld102.docn", str$(docno) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.lino", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.serl", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.srno", str$(0) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.tcom", str$(comp.no) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.leac", tfsol912.leac )
if not isspace(tfsol912.dim1) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim1", tfsol912.dim1 )
endif
if not isspace(tfsol912.dim2) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim2", tfsol912.dim2 )
endif
if not isspace(tfsol912.dim3) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim3", tfsol912.dim3 )
endif
if not isspace(tfsol912.dim4) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim4", tfsol912.dim4 )
endif
if not isspace(tfsol912.dim5) then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim5", tfsol912.dim5 )
endif
get.country.from.company.data(comp.no)
stpapi.put.field( "tfcmg2120s000", "tfgld102.ccty", tccom000.ccty )
stpapi.put.field( "tfcmg2120s000", "tfgld102.cvat", " ")
stpapi.put.field( "tfcmg2120s000", "form.amount", str$(tfsol912.amnt) )
if tfsol912.tpay = tfacp.tpay.invoice then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dbcr",str$(tfgld.dbcr.debit) )
else
if tfsol912.tpay = tfacp.tpay.sales then
stpapi.put.field( "tfcmg2120s000", "tfgld102.dbcr", str$(tfgld.dbcr.credit) )
endif
endif
stpapi.put.field( "tfcmg2120s000", "tfgld102.qty1", str$(0))
stpapi.put.field( "tfcmg2120s000", "tfgld102.qty2", str$(0))
stpapi.put.field( "tfcmg2120s000", "tfgld102.fyer", str$(fiscal.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.fprd", str$(fiscal.prod) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.ryer", str$(fiscal.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.rprd", str$(rep.prod) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.vyer", str$(tax.year) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.vprd", str$(tax.prod) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.refr", tfsol912.esdb)
stpapi.insert( "tfcmg2120s000", true, cmg.error )
if isspace(cmg.error) then
stpapi.save( "tfcmg2120s000", cmg.error )
else
stpapi.recover( "tfcmg2120s000", cmg.error )
endif
on stpapi.isert,it returns cmg.error = "batch Number not Allowed".
can somebody help me in this. how i should handle this issue.
thanks
Veyant