Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
36%
Installation Wizard into new VRC
36%
Manual into existing VRC
7%
Manual into new VRC
22%
Total votes: 45

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 9th March 2018, 08:07
Babu N Babu N is offline
Junior Member
 
Join Date: Dec 2009
Posts: 16
Babu N is on a distinguished road
Baan: Baan IV c3 - DB: oracle i8 - OS: Windows
I am struck with AFS for tdpcg0231m000
Baan: ERP LN 6.1 FP11 (Infor ERP 10.5)
C/S: Both

Hi,
I am writing an AFS to upload price book lines from text file. As for a me my script is fine and throws no error, but the data is not getting processed and the price is not getting uploaded. Also, the report output is not getting generated. I have pasted my script below.

function process.price.book.lines()
{
long ret
effd = utc.num()
stpapi.put.field("tdpcg0131m000","tdpcg031.prbk",pric.book)
stpapi.put.field("tdpcg0131m000","tdpcg031.item",in.item)
stpapi.find("tdpcg0131m000",errm)
stpapi.mark("tdpcg0131m000",errm)
stpapi.handle.subproc("tdpcg0131m000","tdpcg0231m000",errm)
stpapi.put.field("tdpcg0231m000","enum",str$(etol(tdpcg.ampe.amount)))
stpapi.put.field("tdpcg0231m000","prc.valby",str$(valby))
stpapi.put.field("tdpcg0231m000","working.curr",str$(ccur))
stpapi.put.field("tdpcg0231m000","new.effdte",str$(effd))
stpapi.put.field("tdpcg0231m000","new.expdte",str$(0))
stpapi.put.field("tdpcg0231m000","simonl",str$(etol(tcyesno.no)))
stpapi.put.field("tdpcg0231m000","prtchg",str$(etol(tcyesno.yes)))
stpapi.set.report("tdpcg0231m000","rtdpcg023111000","D66",errm)


if isspace(errm) then

stpapi.form.command("tdpcg0231m000",5,"exec.cont.process",errm)
else
stpapi.recover("tdpcg0231m000",errm)
endif
stpapi.end.session("tdpcg0231m000")
stpapi.end.session("tdpcg0131m000")
}

Nothing is happening and no error is poping up.

If any one can throw some light on what I am missing here, it will be much helpful as I am struck for hours on this.

Thanks in advance

Regards
Babu N
Reply With Quote
  #2  
Old 9th March 2018, 15:48
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Not familiar with the session or LN, but does the find work is my first question? And does just doing a find launch the subsession?

Code:
stpapi.put.field("tdpcg0131m000","tdpcg031.prbk",pric.book)
 stpapi.put.field("tdpcg0131m000","tdpcg031.item",in.item)
 stpapi.find("tdpcg0131m000",errm)
 stpapi.mark("tdpcg0131m000",errm)
 stpapi.handle.subproc("tdpcg0131m000","tdpcg0231m000",errm)
If not then right after the stpapi.handle I would expect to see a command to launch the subsession - a continue or some kind of form command to get the subsession to start.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 12th March 2018, 15:11
vinceco252's Avatar
vinceco252 vinceco252 is offline
Guru
 
Join Date: Mar 2002
Location: Frederick, CO
Posts: 407
vinceco252 is on a distinguished road
Baan: Baan IVc3, IVc4, 5b, 5c, ERP LN 6.1, Infor ERP 10.x - DB: SQL Server, Oracle - OS: Windows, Linux, HPUX, AIX, (a little bit of) Solaris
Is this something you could use an Excel upload for?
__________________
Vincent Murphy
---------------
Senior ERP Consultant
OST
vmurphy@ostusa.com
Reply With Quote
Sponsored Links
  #4  
Old 13th March 2018, 08:34
Babu N Babu N is offline
Junior Member
 
Join Date: Dec 2009
Posts: 16
Babu N is on a distinguished road
Baan: Baan IV c3 - DB: oracle i8 - OS: Windows
Hi Vincent,

The idea is to read the price from a text file and upload to the system.

Initially I used the script.

effd = utc.num()
expd = utc.num()
effd.r = utc.num()
effd.r = effd.r + 300
expd.r = utc.num()
expd.r = expd.r + 300
stpapi.put.field("tdpcg0231m000","type.f",str$(etol(tdpcg.mous.so)))
stpapi.put.field("tdpcg0231m000","type.t",str$(etol(tdpcg.mous.so)))
stpapi.put.field("tdpcg0231m000","prbk.f",str$(pric.book))
stpapi.put.field("tdpcg0231m000","prbk.t",str$(pric.book))
stpapi.put.field("tdpcg0231m000","ccur.f",str$(" "))
stpapi.put.field("tdpcg0231m000","ccur.t",str$("ZZZ"))
stpapi.put.field("tdpcg0231m000","otbp.f",str$(" "))
stpapi.put.field("tdpcg0231m000","otbp.t",str$("ZZZZZZZZZ"))
stpapi.put.field("tdpcg0231m000","sfbp.f",str$(" "))
stpapi.put.field("tdpcg0231m000","sfbp.t",str$("ZZZZZZZZZ"))
stpapi.put.field("tdpcg0231m000","qtun.f",str$(" "))
stpapi.put.field("tdpcg0231m000","qtun.t",str$("ZZZ"))
stpapi.put.field("tdpcg0231m000","niqt.f",str$("0.0000"))
stpapi.put.field("tdpcg0231m000","miqt.t",str$("999999999.9999"))
stpapi.put.field("tdpcg0231m000","f.pb.prty.f",str$(etol(tdpcg.prit.not.applicable)))
stpapi.put.field("tdpcg0231m000","f.pb.prty.t",str$(etol(tdpcg.prit.service.subc)))
stpapi.put.field("tdpcg0231m000","efdt.f",str$("0"))
stpapi.put.field("tdpcg0231m000","efdt.t",str$(effd.r))
stpapi.put.field("tdpcg0231m000","exdt.f",str$("0"))
stpapi.put.field("tdpcg0231m000","exdt.t",str$(expd.r))
stpapi.put.field("tdpcg0231m000","item.f",str$(in.item))
stpapi.put.field("tdpcg0231m000","item.t",str$(in.item))
stpapi.put.field("tdpcg0231m000","enum",str$(etol(tdpcg.ampe.amount)))
stpapi.put.field("tdpcg0231m000","prc.valby",str$(valby))
stpapi.put.field("tdpcg0231m000","working.curr",str$(ccur))
stpapi.put.field("tdpcg0231m000","new.effdte",str$(effd))
stpapi.put.field("tdpcg0231m000","new.expdte",str$(expd))
stpapi.put.field("tdpcg0231m000","simonl",str$(etol(tcyesno.no)))
stpapi.set.report("tdpcg0231m000","rtdpcg023111000","D66",errm)
stpapi.form.command("tdpcg0231m000",5,"exec.cont.process",errm)
|stpapi.continue.process("tdpcg0231m000",errm)

if isspace(errm) then
stpapi.form.command("tdpcg0231m000",5,"exec.print.data",errm)
|stpapi.print.report("tdpcg0231m000",errm)
else
stpapi.recover("tdpcg0231m000",errm)
endif
|stpapi.form.command("tdpcg0231m000",5,"exec.cont.process",errm)
|ret = stpapi.save("tdpcg0231m000",errm)
stpapi.end.session("tdpcg0231m000")

It throws no error message but still does not process. Then I changed the script to.

effd = utc.num()
stpapi.put.field("tdpcg0131m000","tdpcg031.prbk",pric.book)
stpapi.put.field("tdpcg0131m000","tdpcg031.item",in.item)
stpapi.find("tdpcg0131m000",errm)
stpapi.mark("tdpcg0131m000",errm)
stpapi.handle.subproc("tdpcg0131m000","tdpcg0231m000",errm)
stpapi.put.field("tdpcg0231m000","enum",str$(etol(tdpcg.ampe.amount)))
stpapi.put.field("tdpcg0231m000","prc.valby",str$(valby))
stpapi.put.field("tdpcg0231m000","working.curr",str$(ccur))
stpapi.put.field("tdpcg0231m000","new.effdte",str$(effd))
stpapi.put.field("tdpcg0231m000","new.expdte",str$(0))
stpapi.put.field("tdpcg0231m000","simonl",str$(etol(tcyesno.no)))
stpapi.put.field("tdpcg0231m000","prtchg",str$(etol(tcyesno.yes)))
stpapi.set.report("tdpcg0231m000","rtdpcg023111000","D66",errm)


if isspace(errm) then
|stpapi.form.command("tdpcg0231m000",5,"exec.print.data",errm)
|stpapi.print.report("tdpcg0231m000",errm)
stpapi.form.command("tdpcg0231m000",5,"exec.cont.process",errm)
else
stpapi.recover("tdpcg0231m000",errm)
endif
stpapi.end.session("tdpcg0231m000")
stpapi.end.session("tdpcg0131m000")

But with same effect. It does not throw any error, but does not process the record. I am clueless about if I am missing some syntax here.

Thanks

Regards
Babu N
Reply With Quote
  #5  
Old 17th March 2018, 23:52
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
On this part of the post.

Code:
stpapi.mark("tdpcg0131m000",errm)
 stpapi.handle.subproc("tdpcg0131m000","tdpcg0231m000",errm)
Even with this code right after the stpapi.handle I expect a command to launch tdpcg0231m000. Some kind of stpapi.form.command for ln. When you run tdpcg0131m000 manually and mark a record what do you do to get tdpcg0231m000 to kick off? You have to replicate every click or button push you use manually when using the api commands.

In 4c4 I can run a shell window and use ps and watch the processes run. To you can see that main session ppid is the parent of the subsession ppid. In your case it looks like a main launching another main session (stpapi.handle.subproc("tdpcg0131m000","tdpcg0231m000",errm)). Which is fine, but I still think the first main should probably show as the parent of the second main session.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AFS waiting timed out (frozen) jp.aalders AFS/DDC/OLE: Function servers 4 20th December 2011 20:48
AFS for tfacr4410m000 and Credit Notes Neal Matthews AFS/DDC/OLE: Function servers 7 12th April 2011 20:48
Steps to create AFS indian_sumesh AFS/DDC/OLE: Function servers 1 6th November 2008 17:32
Update field value i.e. not a form field through AFS! Ankita AFS/DDC/OLE: Function servers 12 18th May 2008 03:06
Nested AFS calls. r_nagu AFS/DDC/OLE: Function servers 7 17th November 2005 06:41


All times are GMT +2. The time now is 19:49.


©2001-2017 - Baanboard.com - Baanforums.com