jpadilla
12th August 2002, 16:46
Hi,

I'm trying to use AFS to run the session ticpr2210m000 calculate cost price, for a items that I have in a ascii file.

I run the session but I get the message "Device not Found"

any suggestion is welcome.

Regards

JP

I have set the AFSLOG in my command line of bw, but I don´t find any log file in home directory, does anybody know why this happen??

mark_h
12th August 2002, 17:10
Could you post the relevant code? That may help someone answer your question.

Thanks

Mark

jpadilla
12th August 2002, 18:13
choice.cont.process:
on.choice:
method=ltoe(1)
actualize=ltoe(1)
date_proc=inputstr.to.date("08092002","%D002,3")

stpapi.put.field("ticpr2210m000","item.f","0000021")
stpapi.put.field("ticpr2210m000","item.t","0000021")
stpapi.put.field("ticpr2210m000","cntr.f"," ")
stpapi.put.field("ticpr2210m000","cntr.t","ZZZ")
stpapi.put.field("ticpr2210m000","citg.f"," ")
stpapi.put.field("ticpr2210m000","citg.t","ZZZZZZ")
stpapi.put.field("ticpr2210m000","calc.cd",”001”)
stpapi.put.field("ticpr2210m000","calc.meth",method)
stpapi.put.field("ticpr2210m000","calc.date",date_proc)
stpapi.put.field("ticpr2210m000","actualize.copr",actualize)
stpapi.set.report("ticpr2210m000","rticpr221001000","ASCIF",error)
stpapi.continue.process("ticpr2210m000",error)
stpapi.end.session("ticpr2220m000")
Whe I run this code I get the error "Device not found", does anybody know how to solve it??

r_nagu
12th August 2002, 18:59
Does the device "ASCIF" exists? if yes set the spool.fileout variable to a filename where you want it print.

mark_h
12th August 2002, 19:13
I usually set spool.device - spool.device = "ASCIF". It could be that the ASCIF actually has trailing spaces.

Example:

spool.device = "ASCIF"
stpapi.set.report("tisfc9417m000","rtisfc941702220",spool.device,errmsg)


Try using something like this.


Mark

mark_h
12th August 2002, 20:37
Forgot to mention that should also set the spool.fileout variable. It needs to know where to write the data.

Mark

jpadilla
12th August 2002, 20:51
I made the changes and It still gives the error "Device not found", I include the line spool.open ("rticpr221001000","D",2)
I put the 2 value on third argument to let me check if the device is D,..

It's ok, but the session hangs up until I kill the process and no change in the cost price value is reflected

Regards JP

mark_h
12th August 2002, 23:59
You may need a new object. I ran the below code and got the error report on the display.


stpapi.put.field("ticpr2210m000","item.f","2121371")
stpapi.put.field("ticpr2210m000","item.t","2121371")
stpapi.put.field("ticpr2210m000","calc.cd","CPC")
stpapi.put.field("ticpr2210m000","calc.meth",str$(tcccmt.top.down))
stpapi.put.field("ticpr2210m000","actualize.copr",str$(tcyesno.yes))
stpapi.set.report("ticpr2210m000","rticpr221001000","D66",msg)
stpapi.continue.process("ticpr2210m000",msg)
stpapi.end.session("ticpr2210m000")


I did change which session I ended. I did not do anything with the 2220 sub session that pops up. This leads me to believe that you need a new object. I tried to check the Baan support site, but I keep getting an error trying to go to the knowledge base.

Mark

jpadilla
14th August 2002, 00:31
I update the objects and Í'm still getting the same error, this the afs log file.... any clue??

mark_h
14th August 2002, 01:22
Here is a copy of the my afs.log:

08-13-2002
6->get.fields
6<-get.fields^A0^Aitem.f^A1^Aitem.t^A1^Acntr.f^A1^Acntr.t^A1^Acitg.f^A1^Acitg.t^
A1^Acalc.cd^A1^Aticpr100.dsca^A0^Acalc.meth^A1^Acalc.date^A1^Aactualize.copr^A1^
Atiitm001.reli^A0^Atiitm001.cntr^A0^Abom.level^A0
>ticpr2210m000 put.field:item.f 2121371
>ticpr2210m000 put.field:item.t 2121371
>ticpr2210m000 put.field:calc.cd CPC
>ticpr2210m000 put.field:calc.meth 1
>ticpr2210m000 put.field:actualize.copr 1
>ticpr2210m000 set.report
6->set.report^Articpr221001000^AD66
6<-set.report^A0
<ticpr2210m000
>ticpr2210m000 continue.process
6->cont.process
7<-api.child.startedttstpsplopen 6
10<-api.child.startedticpr2220s0006
6<-cont.process^A0
<ticpr2210m000
>ticpr2210m000 end.session
6->end.program
6<-end.program


When compared to yours you can see that ttstpsplopen happened and it never happened in yours. I would recommend contacting Baan, my best guess is that you will need a new ttstpsplopen or maybe even a new version of stpapi libraries. That is my best guess. Sorry I am not much help, but it looks like what you are doing is correct. I even changed my open.report to D and it worked(using my previous posted code). If you do contact Baan please post what the solution was.

Mark

klesch
14th August 2002, 09:43
I would just like to let you know that I am experiencing the same error message. The interesting part of it is that I'm using AFS on sessions that DON'T print at all.

mark_h
14th August 2002, 15:50
I checked your profiles and you are both on 4c4 so maybe there is a common patch that you all need. But that is just a guess.

So hopefully if one solves it, then they can post the solution for the other.


Mark

klesch
14th August 2002, 15:54
I forgot to mention that I'm experiencing this on Baan5c. I think that I will ask Baan support about it.

Originally posted by mark_h
I checked your profiles and you are both on 4c4 so maybe there is a common patch that you all need. But that is just a guess.

So hopefully if one solves it, then they can post the solution for the other.


Mark

Kingsto88
25th May 2005, 11:19
Hi everyone,

I tried using the below script but am unsuccessful in updating the cost in the item master. If i run the session itself, then the cost is updated.


I am running the below script in the print PO session as I want the cost to be updated with the new purchase price. Can anyone tell me what is wrong.

domain tcmcs.str50 msg
stpapi.put.field("ticpr2210m000","item.f",tdpur041.item)
stpapi.put.field("ticpr2210m000","item.t",tdpur041.item)
stpapi.put.field("ticpr2210m000","cntr.f"," ")
stpapi.put.field("ticpr2210m000","cntr.t","ZZZ")
stpapi.put.field("ticpr2210m000","citg.f"," ")
stpapi.put.field("ticpr2210m000","citg.t","ZZZZZZ")
stpapi.put.field("ticpr2210m000","calc.cd","AVE")
stpapi.put.field("ticpr2210m000","calc.date",str$(date.num()))
stpapi.put.field("ticpr2210m000","calc.meth",str$(etol(tcccmt.top.down)))
stpapi.put.field("ticpr2210m000","actualize.copr",str$(etol(tcyesno.yes)))
spool.paper.type = "A4LS"
spool.device = "D"
stpapi.set.report("ticpr2210m000","rticpr221001000",spool.device,msg)
stpapi.continue.process("ticpr2210m000",msg)
message("mess:%s",msg)
stpapi.end.session("ticpr2210m000")

thanks and regards

Kingsto88
25th May 2005, 13:18
Hi everyone,

I am taking the advice to download the solution for standard program. But it is crazy because there are so many prerequisite solutions.

I am on Baan 4c4 with SP16 already, why is there still so many prerequisites to download. Can someone out there give me the latest stpapihand or stpstandard or all those stp files, instead of downloading. It is taking too much time.

Thanks and appreciate it very much

mark_h
25th May 2005, 16:00
Your code worked for me. So you may need all the patches and pre-requisites. We are on 4c4 SP18.

Kingsto88
26th May 2005, 03:27
Hi Mark,

Thanks for your answer.
Just wondering, if I add in the SP17 and SP18, will this update my api objects that i need, to the latest?? Ie. Does the latest api objects all come in the SP18? or must I still install the individual solutions to update the api objects?

Thanks and regards

mark_h
26th May 2005, 14:52
I am not sure - all I know is we installed the PMC dumps and a new porting set. We are having some issues with the WMS stuff that is embedded into the code.

sant123
8th July 2005, 07:03
Hi, Mark,

I have the smilar proble, I am on Baan4c4, sp18 on tools patches and sp13+ on application pachtes. I donot get any errors but the cost is not getting updated. I pretty much copied the source code from this thread.

Any help is appreciated.

mark_h
8th July 2005, 13:31
You might want to report it to Baan and see what they say. Sometimes baan executes things in events that function servers do not activate. If Baan does not have a solution ask them for the script. You might then be able to figure out a work around using one of the wrapper programs.

sigmabaani
21st April 2008, 14:14
hallo experts,

I called the session ticpr2210m000 by AFS and had problems with the session
ticpr2220s000, called by "zoom.to" in the code.
In the session ticpr2110m000 the zoom works correct, but the choice "on.print" in the session ticpr2220s000 is not called, only the choice "after.print" was called.

Id would be kind of you to inform me if a solution exists.

patwanirav
14th July 2011, 07:41
hi have u got the solution for the above post, becoz i m getting the same problem.
if u got the solution pls send it...

baanspider
18th November 2015, 05:57
Hi everyone

Has anyone got ticpr2210m000 to work through AFS?

ticpr2220m000 works through AFS but it does not update for all items.
Items that has economic stock present will not update the cost.

thanks n regards