justknowledge
16th July 2007, 15:10
Hi ,
I am writing AFS for print sales invoice however i am facing problem to print sales invoice report and change the status as well as generating invoice number in table tdsls045.
I am not able to trace out where the actual problem is in my code.
Can sombody please help me.
Regards
Nitesh
domain tcncmp cmpnr
cmpnr = get.compnr()
rprt_log = creat.tmp.file$(bse.tmp.dir$())
stpapi.put.field( "tdsls4404m000", "Printed", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "inv.date", str$(date.num()))
stpapi.put.field( "tdsls4404m000", "selection", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "comp.f", str$(cmpnr))
stpapi.put.field( "tdsls4404m000", "comp.t", str$(cmpnr))
stpapi.put.field( "tdsls4404m000", "cuno.f", "")
stpapi.put.field( "tdsls4404m000", "cuno.t", "ZZZZZZ")
stpapi.put.field( "tdsls4404m000", "orno.f", str$(orno1))
stpapi.put.field( "tdsls4404m000", "orno.t", str$(orno1))
stpapi.put.field( "tdsls4404m000", "copt.f", "")
stpapi.put.field( "tdsls4404m000", "copt.t", "ZZZ")
stpapi.put.field( "tdsls4404m000", "amount.f", str$(-9999999999.00))
stpapi.put.field( "tdsls4404m000", "amount.t", str$(9999999999.00))
stpapi.put.field( "tdsls4404m000", "definite", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "direct.process", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "exci.inv", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "totals", str$(etol(tcyesno.no)))
|if prnt.options tcyesno.yes then make prnt.sellpr = tcyesno.no
|if prnt.options tcyesno.no then make prnt.sellpr = tcyesno.yes
|because only one rpt can be set be set thru AFS.
|so selection as to be make
stpapi.put.field( "tdsls4404m000", "prnt.options", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "prnt.sellpr", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "reportgrp","1")
stpapi.put.field( "tdsls4404m000", "spool.fileout",rprt_log)
stpapi.set.report("tdsls4404m000", "rtdsls440401000","D",error.mess)
if isspace(error.mess) then
stpapi.print.report("tdsls4404m000", error.mess)
stpapi.continue.process("tdsls4404m000",error.mess)
else
stpapi.recover("tdsls4404m000", error.mess)
endif
stpapi.end.session("tdsls4404m000")
I am writing AFS for print sales invoice however i am facing problem to print sales invoice report and change the status as well as generating invoice number in table tdsls045.
I am not able to trace out where the actual problem is in my code.
Can sombody please help me.
Regards
Nitesh
domain tcncmp cmpnr
cmpnr = get.compnr()
rprt_log = creat.tmp.file$(bse.tmp.dir$())
stpapi.put.field( "tdsls4404m000", "Printed", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "inv.date", str$(date.num()))
stpapi.put.field( "tdsls4404m000", "selection", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "comp.f", str$(cmpnr))
stpapi.put.field( "tdsls4404m000", "comp.t", str$(cmpnr))
stpapi.put.field( "tdsls4404m000", "cuno.f", "")
stpapi.put.field( "tdsls4404m000", "cuno.t", "ZZZZZZ")
stpapi.put.field( "tdsls4404m000", "orno.f", str$(orno1))
stpapi.put.field( "tdsls4404m000", "orno.t", str$(orno1))
stpapi.put.field( "tdsls4404m000", "copt.f", "")
stpapi.put.field( "tdsls4404m000", "copt.t", "ZZZ")
stpapi.put.field( "tdsls4404m000", "amount.f", str$(-9999999999.00))
stpapi.put.field( "tdsls4404m000", "amount.t", str$(9999999999.00))
stpapi.put.field( "tdsls4404m000", "definite", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "direct.process", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "exci.inv", str$(etol(tcyesno.no)))
stpapi.put.field( "tdsls4404m000", "totals", str$(etol(tcyesno.no)))
|if prnt.options tcyesno.yes then make prnt.sellpr = tcyesno.no
|if prnt.options tcyesno.no then make prnt.sellpr = tcyesno.yes
|because only one rpt can be set be set thru AFS.
|so selection as to be make
stpapi.put.field( "tdsls4404m000", "prnt.options", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "prnt.sellpr", str$(etol(tcyesno.yes)))
stpapi.put.field( "tdsls4404m000", "reportgrp","1")
stpapi.put.field( "tdsls4404m000", "spool.fileout",rprt_log)
stpapi.set.report("tdsls4404m000", "rtdsls440401000","D",error.mess)
if isspace(error.mess) then
stpapi.print.report("tdsls4404m000", error.mess)
stpapi.continue.process("tdsls4404m000",error.mess)
else
stpapi.recover("tdsls4404m000", error.mess)
endif
stpapi.end.session("tdsls4404m000")