Baanboard.com

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

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
37%
Installation Wizard into new VRC
37%
Manual into existing VRC
5%
Manual into new VRC
21%
Total votes: 43

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 26th January 2005, 10:01
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 575
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
AFS and switch.to.company

Hi,

I have a big problem with the function switch.to.company and AFS.

We build up a connector between our EDM System ProfiDB and our Baan system (IVc4 SP 14). Item and BOM information from the EDM System will be automatically transferd (via ASCII files) to Baan. On the Baan side main parts in the session are done using AFS. This is working very well.

The only problem is that we have two companies in Baan (company A and company B). Depending on two fields in the ASCII files the data must be inserted in company A or in company B or into both companies.
The last option is the problem. The Baan session is running in company A. If now the data must be inserted into both companies the session first insert the data in company A and in a second loop insert the data in company B.

To do this I use the function switch.to.company before calling the AFS functions.

function create.edmitm(domain tccomp comp)
{
if get.compnr() <> comp then
ret.sw = switch.to.company(comp)
endif

stpapi.put.field("tiedm0110m000", "tiedm010.eitm", in.item)
....
....
ret = stpapi.insert("tiedm0110m000", 1, error.mess)
....
stpapi.end.session("tiedm0110m000")


switch.to.company returns 1 (o.k) but stpapi.insert returns 0 (failed) with error.mess "Record already exists" for insert the data into company B.

The error does not occur if the data needs olny be inserted into company B and the session is running in company A. So the switch.to.company itself is working. The error only occur if the data needs to be inserted into both companies in one run.

After hours of debugging and checking (e.g. AFS.LOG) now I am helpless.

In some other threads regarding AFS and switch.to.company I found nothing what can be the problem. Normally it must work.

Maybe someone out there knows more or has the same problems in the past?

Regards,
Juergen

Last edited by Juergen : 27th January 2005 at 08:12.
Reply With Quote
  #2  
Old 27th January 2005, 19:12
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,037
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Just something to try - add a suspend(x) after the last session. Try something like 3000 milliseconds. I know on some of my sessions if I do not pause things and let them clear out then I have problems when continuing. I do not have a clue if this is even remotely possible in your case, but something to try. And yes 3000 is rather a long pause, but if it works you can always try lower values. Again just something to try.

Mark
Reply With Quote
Sponsored Links
  #3  
Old 28th January 2005, 08:30
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 575
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hello Mark,

I tried your suggestion, but with no success. The problem must be in this area. Maybe the session which is called thru AFS will not closed complete or some internal pointers are not resetting.
Nevertheless thank`s for the tip.

The Problem is that we must go live with the Connector between EDM and Baan in the next time. If there is no solution for the problem I have to redesign the Baan part. Means to kick off AFS and doing it in the old way.

Thanks again,
Juergen
Reply With Quote
  #4  
Old 28th January 2005, 09:59
kbartelds kbartelds is offline
Senior Member
 
Join Date: Feb 2003
Location: Netherlands
Posts: 264
kbartelds is on a distinguished road
Baan: B40c4 - DB: Oracle 7 - OS: Sun Solaris
Just a possible solution: create 3 sessions. First one to read the ascii file, second one to control data for company A and third one to control data for company B. Second and third session will have the same source code and will contain the afs code to send data to edm tables.

The first session reads the file and analyses the data and will use a zoom.to to the second and/or third session to fill in the data in company A/B. The data from the file that is used to fill edm can be exported/imported, so is the requiered company number.

Regards,
Klaas
Reply With Quote
  #5  
Old 28th January 2005, 11:03
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 575
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Thanks Klaas,

good idea. Need some additional coding but if I don`t find an easier solution for the problem in the next days I will give it a try. Splitting it into itself closed tasks can be the solution.

Regards,
Juergen
Reply With Quote
  #6  
Old 29th January 2005, 16:06
csecgn's Avatar
csecgn csecgn is offline
Guru
 
Join Date: Aug 2004
Location: Cologne/Germany
Posts: 300
csecgn is on a distinguished road
Baan: IVc4 SP14 (Tools SP 21) ; LN 6.1 (Testing) - DB: Oracle - OS: Solaris
Just an idea if you are using jobs for the import: Split it into 2 jobs. One for Company A and one for Company B. Then the second job has to wait until the first job has ended. So you have 2 "clean" environments.

Regards
csecgn
Reply With Quote
  #7  
Old 31st January 2005, 17:36
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Just FYI, I had a problem when running a batch job and using the switch.to.company with a bunch of old (ancient) db.* statements. So, it's not just afs, I think it has to do with the processing shell. We could switch once, but not back and forth very well. Our solution was to spawn another process for different companies as well, and that took care of it.
Reply With Quote
  #8  
Old 1st February 2005, 14:38
Hitesh Shah's Avatar
Hitesh Shah Hitesh Shah is offline
Guru
 
Join Date: Nov 2001
Location: Mumbai,India
Posts: 1,855
Hitesh Shah is on a distinguished road
Baan: triton,Baan IVc4 , ERP Ln - DB: Oracle/Bisam/SQL 2000/SQL 2005 - OS: Sun Solaris/Windows 2003
db statements

Lisa,
Db statements work properly if u use _compnr in SQL conditions for db.update / delete .For inserting records writing ppmmm999._compnr = ??? before db.insert works.

I had worked quite sometime back on this and it worked . Maybe u have a different set of objects or scenario .
Reply With Quote
  #9  
Old 1st February 2005, 15:58
lbencic's Avatar
lbencic lbencic is offline
Guru
 
Join Date: Dec 2001
Location: Lisle, IL, USA
Posts: 1,148
lbencic will become famous soon enough
Baan: 2.2d - LN - DB: most - OS: most
Thanks Hitesh, undoubtedly you are right. Our problem was that we had 'straight lined' the Baan session code, and that did not use the comany number in the db's. We could add them, but kept running into problems on every db. To complicate, it was a finance session and which company to read for in a multi logistic / single finance setup was not so easy. The quickest solution was to start new processes. My point was just that the shells themself have a problem with it, without special handling on each db, when called from afs or not. The Baan sessions have no issue, they restart each time called. Our batch processes calls of those standard sessions expose the issues.
Reply With Quote
  #10  
Old 2nd February 2005, 15:01
Hitesh Shah's Avatar
Hitesh Shah Hitesh Shah is offline
Guru
 
Join Date: Nov 2001
Location: Mumbai,India
Posts: 1,855
Hitesh Shah is on a distinguished road
Baan: triton,Baan IVc4 , ERP Ln - DB: Oracle/Bisam/SQL 2000/SQL 2005 - OS: Sun Solaris/Windows 2003
agree with u

Completely agree with u. Especially in a complex scenario like multi-company setup with logical tables with lot of other issues , this is the best strategy.

Wrt shells having problems , I have also noticed this at times.Think Marks idea of using suspend(x) is worth testing. However this too is tested . So currently agree with the workarounds suggested by others and also if possible to get the help from SSA support on this.
Reply With Quote
  #11  
Old 3rd February 2005, 08:35
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 575
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Smile Problem solved!

The problem with the function switch.to.company is solved from the Baan Support.

Troublemakers in our case was the tools objects ottstpapihand and ottstpstandard. After installing a new set of tools components now the session works without problems.

Thanks to all for their help and proposals.

Regards,
Juergen
Reply With Quote
  #12  
Old 24th May 2005, 16:13
vcolombo vcolombo is offline
Junior Member
 
Join Date: Sep 2003
Posts: 5
vcolombo is on a distinguished road
Baan: IV c4 - DB: SQL Server - OS: NT
Hi! Please, can you tell me the solution number you used in order to solve this? I have the same problem... Thanks!
Reply With Quote
  #13  
Old 24th May 2005, 16:19
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 575
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hi,

the solution number is 147361.

Regards,
Juergen
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
Interactive mode in AFS vineetu1 Tools Development 6 22nd December 2004 05:59
AFS - Print Order Documents BurghMan AFS/DDC/OLE: Function servers 5 29th October 2004 21:07
afs basics, please comment yogrind AFS/DDC/OLE: Function servers 1 21st April 2004 23:07
AFS (tfgld1101m000) don´t run fine since a user with a Dynamic menu (DEM) garias AFS/DDC/OLE: Function servers 4 20th January 2004 14:24
AFS : do we need BOI installed to use AFS rohan_rege AFS/DDC/OLE: Function servers 7 17th August 2002 09:54


All times are GMT +2. The time now is 20:47.


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