jmathew
4th April 2005, 17:21
Hi,
I am trying to update cost of new purchased items through the session ticpr2210m000 using AFS. The code that is used is given below, can someone help me or is this not possible through AFS?
stpapi.put.field("ticpr2210m000", "item.f", item)
stpapi.put.field("ticpr2210m000", "item.t", item)
stpapi.put.field("ticpr2210m000", "calc.cd", sccc)
stpapi.put.field("ticpr2210m000", "calc.meth", str$(3))
stpapi.put.field("ticpr2210m000", "actualize.copr", str$(1))
stpapi.set.report("ticpr2210m000", "rticpr221001000", prdev, error.msg)
if isspace(error.msg) then
stpapi.continue.process("ticpr2210m000", error.msg)
endif
mark_h
6th April 2005, 15:50
Well - it should be possible. Are you getting any error messages? You might also want to try stpapi.get.mess.code after the continue. I know I use this on my manual transfer session to see if there was a warning on why the transfer might not take place.
jmathew
7th April 2005, 08:32
Hi Mark,
I debugged the program and it does not give any error messages at all, but the update is not taking place. I tried a lot, but not successful. Can someone try the same and see if the problem exists.
The result of AFS debug is also attached with this mail from the afs.log file.
kbartelds
7th April 2005, 12:00
Did you check the print queue ttaad320 if there is any output? Did you check whether costprice has already been calculated for this date?
Regards,
Klaas
mark_h
7th April 2005, 15:42
I noticed that this session zooms to tipcr2220s000 - is it possible for you to run ticpr2220m000 instead? Not familiar enough with these sessions. It could be that you also have to set the report for ticpr2220s000, before it gets called.
shaboo
7th April 2005, 16:19
We created a Function Server based BOI that calculates and update cost price calculation based on ticpr2210m000 and it has been working just fine. The issue we faced during it was related to report handling and we wrote the report to disk to solve the issue. Here is how our function server call look in our BOI DLL.
spool.fileout = "costcalc.log" & "." & dte$()
stpapi.put.field("ticpr2210m000", "spool.fileout", spool.fileout)
f2210m000.set.report("rticpr221001000", "ASCIF" , g.fs.error.message )
f2210m000.continue( g.fs.error.message )
Pieter van de L
8th April 2005, 14:38
We are using baan V and i update the costprices with the following script.
dev.log = "ASCIF"
spooler.for.log = spool.open("",dev.log,0)
spool.fontnumber = 2
spool.pg.length = 66
function do.calculation()
{
domain tcdsca mes1, mes2, mes3
stpapi.put.field("ticpr2210m000", "citg.f", " ")
stpapi.put.field("ticpr2210m000", "citg.t", "zzzzzz")
stpapi.put.field("ticpr2210m000", "item.f", tcibd977.item)
stpapi.put.field("ticpr2210m000", "item.t", tcibd977.item)
stpapi.put.field("ticpr2210m000", "calc.cd", "001")
stpapi.put.field("ticpr2210m000", "calc.meth", str$(etol(tcccmt.single.level)))
stpapi.put.field("ticpr2210m000", "calc.date", str$(utc.num()))
stpapi.put.field("ticpr2210m000", "only.new.items", str$(etol(tcyesno.no)))
stpapi.put.field("ticpr2210m000", "actualize.copr", str$(etol(tcyesno.yes)))
stpapi.set.report("ticpr2210m000", "rticpr221001000", "ASCIF", mes1)
if isspace(mes1) then
stpapi.form.command("ticpr2210m000", 5, "continue.process", mes2)
spooler.save = spool.id
spool.id = spooler.for.log
while true
mes3 = stpapi.get.mess.code("ticpr2210m000", mes2)
if isspace(mes3) and isspace(mes2) then
break
endif
spool.pr.line = "COSTPRICE "&tcibd977.item&" "& mes2
spool.line()
mes2 = ""
mes3 = ""
endwhile
spool.id = spooler.save
else
message("Report not found")
endif
stpapi.end.session("ticpr2210m000")
jmathew
9th April 2005, 09:07
Hi all,
I tried all the option given and still the cost update does not work. For the same item when i manually run the session ticpr2210m000 the cost is updated. I am still not sure why it is not working.
mark_h
10th April 2005, 04:02
Contact Baan - it may be that you need updated stpapi libraries or a new session object.
sant123
8th July 2005, 07:06
James,
Did you get this working??
I am using the similar code to calculate the cost, I don't get any errors but nothing happens, std cost doesn't get updated.
I am on baan4c4, sp18 on tools & sp13+weeks patch on application.
Appreciate any help.
Thanks.