Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 2nd September 2003, 19:36
aobrien's Avatar
aobrien aobrien is offline
Junior Member
 
Join Date: Apr 2003
Posts: 4
aobrien is on a distinguished road
Baan: BaanERP 5B - DB: Oracle - OS: HP-UX
AFS - problem running session in a job

Hello,
I'm trying to run a session in a baan job, and am receiving errors. I am using AFS to execute an item transfer - the item transfer session is a custom session. Here's my problem: I am executing the following code in order to transfer material for an item from one warehouse to another:

string error(500)

stpapi.put.field( "whinhp202m200", "transfer.item.segment.1", transfer.item(1; 9) )
stpapi.put.field( "whinhp202m200", "transfer.item.segment.2", transfer.item(10; 38) )
stpapi.put.field( "whinhp202m200", "cwar.f", cwar.f )
stpapi.put.field( "whinhp202m200", "item.cuni", item.cuni )
stpapi.put.field( "whinhp202m200", "loca.f", loca.f )
stpapi.put.field( "whinhp202m200", "clot", clot )
stpapi.put.field( "whinhp202m200", "order.quan", str$(order.quan) )
stpapi.put.field( "whinhp202m200", "initial", "AFS" )
stpapi.put.field( "whinhp202m200", "receive.item.segment.1", receive.item(1; 9) )
stpapi.put.field( "whinhp202m200", "receive.item.segment.2", receive.item(10; 38) )
stpapi.put.field( "whinhp202m200", "cwar.t", cwar.t )
stpapi.put.field( "whinhp202m200", "loca.t", loca.t )
stpapi.put.field( "whinhp202m200", "trans.order.type", "ICT" )
stpapi.put.field( "whinhp202m200", "proc.trans.order", str$(etol(tcyesno.yes)) )

stpapi.form.command( "whinhp202m200", 5, "exec.cont.process", error )

stpapi.end.session( "whinhp202m200" , error )


If I run this session manually, the material transfers correctly. If I run this session through a BaaN job, I receive the error "Item not allowed." This sounds like an error that is generated when the fields on the screen are not correctly populated (perhaps the field buffer is losing values).

I can't figure out what the difference is between running this session manually, and running it as a job.

Any help would be greatly appreciated!

Thanks,
Amy
Reply With Quote
  #2  
Old 2nd September 2003, 20:26
gfasbender gfasbender is offline
Senior Member
 
Join Date: Aug 2001
Location: Seattle, WA USA
Posts: 172
gfasbender is on a distinguished road
Baan: Baan IV, Baan5, A&D extension - DB: Oracle, MSSQL, Informix - OS: Unix, NT
What happens when yo run session whinhp202m200 in a job?

And if it's a customized session, why not compile it in debug mode and trace through the code?
Reply With Quote
  #3  
Old 2nd September 2003, 21:05
aobrien's Avatar
aobrien aobrien is offline
Junior Member
 
Join Date: Apr 2003
Posts: 4
aobrien is on a distinguished road
Baan: BaanERP 5B - DB: Oracle - OS: HP-UX
If I run session, whinhp202m200 in a job, it runs correctly.

I have activated the job myself and run the job in debug. When I activate the job myself, it runs correctly. When I allow the job daemon to kick off the job, I receive errors for the transfer. Is it possible to view code in debug when the job daemon kicks off the job?

Amy
Reply With Quote
  #4  
Old 2nd September 2003, 22:12
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Job Daemon

I am by no means an expert on Job Daemon, but are all the environment variables set correctly for the job itself? Are there any defaults or permissions you may have that the job daemon does not have? Just some guesses. This may just be a setup issue.

Mark
Reply With Quote
  #5  
Old 9th September 2003, 22:32
aobrien's Avatar
aobrien aobrien is offline
Junior Member
 
Join Date: Apr 2003
Posts: 4
aobrien is on a distinguished road
Baan: BaanERP 5B - DB: Oracle - OS: HP-UX
I worked through the environment variables with someone else in my company and everything appears to be fine. We did find some solutions on the baan website that may apply to this problem, and service pack 15 will have to be installed. For right now, I am running the script from a visual basic program, and everything is working well.

Thanks,
Amy
Reply With Quote
  #6  
Old 9th September 2003, 22:47
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Solution..

Please return and let us know if you find a solution for future reference.

Thanks and good luck.

Mark
Reply With Quote
  #7  
Old 16th September 2003, 06:04
Paul P's Avatar
Paul P Paul P is offline
Guru
 
Join Date: Jul 2002
Location: Jakarta, Indonesia
Posts: 797
Paul P is on a distinguished road
Baan: BaanIV, BaanERP - DB: SQL Server, Informix, Oracle - OS: Windows, HP-UX
Dear Amy,

We did massive barcode integration to our client's 5c environment using AFS, including purchasing, production, and sales activities. All the AFS integration sessions are periodically run using job daemon. We didn't run into any problem using the AFS sessions under job daemon. Basically in our case, if it runs outside job daemon, it also runs inside job daemon.

It's a bit hard for me to diagnose your case since you are trying to control a customised session through AFS

Rgds,
Paul
Reply With Quote
Sponsored Links
  #8  
Old 16th September 2003, 14:58
sujoy.sen's Avatar
sujoy.sen sujoy.sen is offline
Member
 
Join Date: Mar 2003
Location: York, Pa.
Posts: 49
sujoy.sen is on a distinguished road
Baan: BaanERP 5b - DB: Oracle - OS: HP-UX
Paul,

It is possible that some of these problems are resolved in 5c. In version 5b SP13, there does seem to be a problem. The following excerpt of code based on a standard Baan session runs into the same problem reported by Amy:

Code:
current.date = utc.num()
stpapi.put.field("whinh5101s000", "whinh501.item.segment.1", item(1; 9))
stpapi.put.field("whinh5101s000", "whinh501.item.segment.2", item(10; 38))
stpapi.put.field("whinh5101s000", "whinh501.stun", stun)
stpapi.put.field("whinh5101s000", "whinh501.vstr", str$(net.chg.qty))
stpapi.put.field("whinh5101s000", "whinh501.cdat", str$(current.date))
stpapi.put.field("whinh5101s000", "whinh501.recd", recd)
ret1 = stpapi.insert("whinh5501m000", true, error_msg1)
if not ret1 then
   handle.error(time, tisfc.spectyp.palletizer, "whinh5101s00x", error_msg1)
   ret2 = stpapi.recover("whinh5101s000", error_msg2)
endif
return(ret1)
Here again, the code works fine when run manually and even when the job is activated manually but when queued and run through a job daemon (or cron) the above section of code fails. By that, I mean the buffered field values from the stpapi.put.field() calls are lost and the stpapi.insert() call returns a failure code (ret1 above). The error message indicates the loss of the buffered field values.

The consistent pattern seems to be a call to stpapi.insert() or stpapi.form.command() directly after a series of stpapi.put.field() calls. Other programs using AFS but not exhibiting this particular pattern work fine when run by a job daemon. Available information on the Baan Support site seems to indicate that this problem may be solved in SP15 on 5b. It'll probably be a few months before we get to SP15. In the mean time, we have also logged a case with Baan to see if they have any answers for us.

Thanks,
Sujoy.
Reply With Quote
  #9  
Old 16th September 2003, 15:07
NvanBeest's Avatar
NvanBeest NvanBeest is offline
Guru
 
Join Date: May 2003
Location: South Africa
Posts: 521
NvanBeest is on a distinguished road
Baan: BaanIVc4 - DB: Oracle, TBase, SQL Server - OS: AIX, Linux, Window$
Hi Sujoy

Have you tried to fool the system yet? Replace the code with the following, and see what it gives you. It worked for me in BaanIV. Maybe also works in ERP...

Code:
current.date = utc.num()
stpapi.put.field("whinh5101s000", "whinh501.item.segment.1", item(1; 9))
stpapi.put.field("whinh5101s000", "whinh501.item.segment.2", item(10; 38))
stpapi.put.field("whinh5101s000", "whinh501.stun", stun)
stpapi.put.field("whinh5101s000", "whinh501.vstr", str$(net.chg.qty))
stpapi.put.field("whinh5101s000", "whinh501.cdat", str$(current.date))
stpapi.put.field("whinh5101s000", "whinh501.recd", recd)
ret1 = stpapi.insert("whinh5501m000", false, error_msg1) | Don't save yet...
if not ret1 then
   handle.error(time, tisfc.spectyp.palletizer, "whinh5101s00x", error_msg1)
   ret2 = stpapi.recover("whinh5101s000", error_msg2)
else
   | Re-enter the field values
   stpapi.put.field("whinh5101s000", "whinh501.item.segment.1", item(1; 9))
   stpapi.put.field("whinh5101s000", "whinh501.item.segment.2", item(10; 38))
   stpapi.put.field("whinh5101s000", "whinh501.stun", stun)
   stpapi.put.field("whinh5101s000", "whinh501.vstr", str$(net.chg.qty))
   stpapi.put.field("whinh5101s000", "whinh501.cdat", str$(current.date))
   stpapi.put.field("whinh5101s000", "whinh501.recd", recd)
   ret1 = stpapi.save("whinh5501m000", error_msg1) | Now try to save...
   if not ret1 then
      handle.error(time, tisfc.spectyp.palletizer, "whinh5101s00x", error_msg1)
      ret2 = stpapi.recover("whinh5101s000", error_msg2)
   endif
endif
return(ret1)
__________________
Regards,
Nico
Reply With Quote
  #10  
Old 16th September 2003, 17:55
sujoy.sen's Avatar
sujoy.sen sujoy.sen is offline
Member
 
Join Date: Mar 2003
Location: York, Pa.
Posts: 49
sujoy.sen is on a distinguished road
Baan: BaanERP 5b - DB: Oracle - OS: HP-UX
Nico,

Thanks for your suggestion. I tried it out. As before, the code works fine when run manually and even when the job is activated manually. However, previously the job would terminate successfully and our internal error log would get updated with the error message generated, but with these latest changes, the job goes into perpetual status of "Running" and doesn't come out of it on its own (I had to Cancel the job). So it looks like there is something else going on, but things still aren't working quite right.

Thanks again for your help.
Sujoy.
Reply With Quote
  #11  
Old 16th September 2003, 18:03
NvanBeest's Avatar
NvanBeest NvanBeest is offline
Guru
 
Join Date: May 2003
Location: South Africa
Posts: 521
NvanBeest is on a distinguished road
Baan: BaanIVc4 - DB: Oracle, TBase, SQL Server - OS: AIX, Linux, Window$
Quote:
Thanks again for your help
It seems that I only helped in a negative way! Sorry!
__________________
Regards,
Nico
Reply With Quote
  #12  
Old 16th September 2003, 19:09
sujoy.sen's Avatar
sujoy.sen sujoy.sen is offline
Member
 
Join Date: Mar 2003
Location: York, Pa.
Posts: 49
sujoy.sen is on a distinguished road
Baan: BaanERP 5b - DB: Oracle - OS: HP-UX
I already have my application working through an OLE call from VB, but I wanted to see if there was a way to do this through a Baan Job, just in case I ran into problems with OLE and needed a backup solution. So it was time well spent to try out your suggestion.
Thanks,
Sujoy.
Reply With Quote
  #13  
Old 16th September 2003, 19:36
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hello Amy,

you have not included you full source code. From my experience the major reason why sessions fail to function when run as job is the following: The code in form sections (init.form, before.form,..) of the script are not executed when the session is run as job. please check your code.

Toni
__________________
May the force be with you!
Reply With Quote
  #14  
Old 5th February 2004, 20:27
lsiyengar's Avatar
lsiyengar lsiyengar is offline
Junior Member
 
Join Date: Mar 2002
Posts: 7
lsiyengar is on a distinguished road
Baan: baan 5.0B - DB: Oracle - OS: Unix
I have a similar problem but with the session to convert non lot item to lot controlled items.
I logged a case with Baan support and they have aggreed that it is a bug and they will fix it.
Reply With Quote
  #15  
Old 2nd April 2004, 09:14
prasad_m_p's Avatar
prasad_m_p prasad_m_p is offline
Junior Member
 
Join Date: Jul 2002
Location: Pune
Posts: 10
prasad_m_p is on a distinguished road
Baan: Baan IV, V, LN - DB: Informix, Oracle - OS: Unix, Windows
suggession

Hi,

We had faced similar problem while using AFS, it turned out to be problem of start option of the session. when session was started there was no default record on the form so it was giving similar error message "Item not allowed" when we used stpapi.put.field

Can you try to change start option OR best will be execute first.set and then perform your operations.

May be this will solve the problem.

Prasad.
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
Problem while running tfcmg2100s000 through AFS arunprasath AFS/DDC/OLE: Function servers 10 21st February 2008 17:16
Problem running query in a queued job evesely Tools Administration & Installation 4 10th September 2004 22:33
Problem when invoking a session from another manusatsangi Tools Development 9 18th August 2003 13:40
Herstellkostenberechnung in BaaN 4c Kai's Forum Users Deutsches Forum 4 5th July 1999 00:00


All times are GMT +2. The time now is 05:01.


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