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

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 30th April 2014, 09:48
a.menon's Avatar
a.menon a.menon is offline
Junior Member
 
Join Date: Sep 2013
Posts: 20
a.menon is on a distinguished road
Baan: BAAN 5 - DB: Oracle - OS: Windows7
AFS stpap.find retunrs 2 - another record found

Dear All,

I have an AFS session which automates the Warehouse Receipt Process. The session calls The Receipts session - whinhf3520m000 and creates a new receipt. Then links the expected order lines to the receipt. I noticed that the stpapi.find which runs on whinh3820m000 and finds the record to be linked , fails in some cases.

Code:
        stpapi.put.field("whinh3520m000", "whinh210.rcno", receipt.number)		|AM.14042014.sn
	stpapi.browse.set("whinh3520m000", error.mess)		
	if not isspace(error.mess) then
		message(error.mess)
	endif		
	stpapi.handle.subproc("whinh3520m000","whinh3820m000","add")		|AM.14042014.en	
		
	whinhf3820m000.put.Order_Origin(whgei210.oorg)
	whinhf3820m000.put.Order(whgei210.orno)
	whinhf3820m000.put.Position_Number(whgei210.pono)
	whinhf3820m000.put.Sequence_Number(ord.seq)
	ret = whinhf3820m000.find(error.mess)

The FIND returns 2- another record found- in some cases. Whereas it works fine in others. The session does not have a view field , as such I don't understand as to why the script fails.

The session had been working fine for a long time now. But suddenly started to have this issue.

Kindly provide your insights. I have attached the AFS log files for 2 runs of the session as well.

Thanks in advance.

Anjana
Attached Files
File Type: txt DSPA55A.log-run1.txt (4.6 KB, 16 views)
File Type: txt DSPE517.log- run2.txt (16.8 KB, 7 views)
__________________
Regards,
Anjana
Reply With Quote
  #2  
Old 30th April 2014, 14:15
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,322
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

Were there any recent solution installations related to Warehouse Receipts? May be any changes to functionality. Verify if everything is same as it was earlier.

Also, try using stpapi.change.view() if the session has view fields instead of stpapi.find()

Check this thread.

And, I guess you are the owner of this Thread.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #3  
Old 30th April 2014, 16:03
a.menon's Avatar
a.menon a.menon is offline
Junior Member
 
Join Date: Sep 2013
Posts: 20
a.menon is on a distinguished road
Baan: BAAN 5 - DB: Oracle - OS: Windows7
Quote:
Hi,

Were there any recent solution installations related to Warehouse Receipts? May be any changes to functionality. Verify if everything is same as it was earlier.

Also, try using stpapi.change.view() if the session has view fields instead of stpapi.find()

Check this thread.

And, I guess you are the owner of this Thread.

__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Thank you for your reply. The session does not have a view field as such change.view may not be applicable I believe.
__________________
Regards,
Anjana
Reply With Quote
  #4  
Old 30th April 2014, 16:55
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Moved this thread the the correct AFS forum.

I am not familiar with the session, but the thread Bhushan linked in shows 5 fields for the find and you only show 4. So if the find has 5 fields even if you do not use a field like oset - you should still possible put it. I just do not know if you have to have that field.
Code:
stpapi.put.field("whinh3820m000","whinh210.oorg","80")
stpapi.put.field("whinh3820m000","whinh210.orno","100000135")
stpapi.put.field("whinh3820m000","whinh210.oset","1")
stpapi.put.field("whinh3820m000","whinh210.pono","10")
stpapi.put.field("whinh3820m000","whinh210.seqn","1")

And on of the threads it links to shows 5 fields also, but they put receipt number again - so you might want to try that.
Code:
stpapi.handle.subproc("whinh3520m000","whinh3820m000","add")
 stpapi.put.field("whinh3820m000", "receipt.number", recnum)
 stpapi.put.field("whinh3820m000", "whinh210.oorg", "1") 
 stpapi.put.field("whinh3820m000", "whinh210.orno", "211000499")
 stpapi.put.field("whinh3820m000", "whinh210.pono", "10")
 stpapi.put.field("whinh3820m000", "whinh210.seqn", "0")
 stpapi.form.command("whinh3820m000", 5, "exec.user.1",error)

Basically when you hit the find button manually what ever fields show up in it are what you should put in the session to execute the find.
__________________
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
Sponsored Links
  #5  
Old 30th April 2014, 17:04
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,322
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Good catch Mark
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #6  
Old 1st May 2014, 08:18
a.menon's Avatar
a.menon a.menon is offline
Junior Member
 
Join Date: Sep 2013
Posts: 20
a.menon is on a distinguished road
Baan: BAAN 5 - DB: Oracle - OS: Windows7
Unhappy

Quote:
Originally Posted by mark_h View Post
Moved this thread the the correct AFS forum.

I am not familiar with the session, but the thread Bhushan linked in shows 5 fields for the find and you only show 4. So if the find has 5 fields even if you do not use a field like oset - you should still possible put it. I just do not know if you have to have that field.
Code:
stpapi.put.field("whinh3820m000","whinh210.oorg","80")
stpapi.put.field("whinh3820m000","whinh210.orno","100000135")
stpapi.put.field("whinh3820m000","whinh210.oset","1")
stpapi.put.field("whinh3820m000","whinh210.pono","10")
stpapi.put.field("whinh3820m000","whinh210.seqn","1")

And on of the threads it links to shows 5 fields also, but they put receipt number again - so you might want to try that.
Code:
stpapi.handle.subproc("whinh3520m000","whinh3820m000","add")
 stpapi.put.field("whinh3820m000", "receipt.number", recnum)
 stpapi.put.field("whinh3820m000", "whinh210.oorg", "1") 
 stpapi.put.field("whinh3820m000", "whinh210.orno", "211000499")
 stpapi.put.field("whinh3820m000", "whinh210.pono", "10")
 stpapi.put.field("whinh3820m000", "whinh210.seqn", "0")
 stpapi.form.command("whinh3820m000", 5, "exec.user.1",error)

Basically when you hit the find button manually what ever fields show up in it are what you should put in the session to execute the find.
Thank you mark for the great find.
When I open the session and do a find the set no is not included in the find fields. I checked the indices on the session and the table. The table has an index with the set no , but the session does not seem to use it.
I have attached screenshots of the same.

Problem is I am not able to reproduce the issue on my test environment and as such I am not able to do a trial and error. Hope you understand the pickle am in!!
Attached Images
File Type: jpg Indices.JPG (109.8 KB, 8 views)
File Type: jpg session.JPG (138.4 KB, 9 views)
__________________
Regards,
Anjana
Reply With Quote
  #7  
Old 1st May 2014, 09:17
a.menon's Avatar
a.menon a.menon is offline
Junior Member
 
Join Date: Sep 2013
Posts: 20
a.menon is on a distinguished road
Baan: BAAN 5 - DB: Oracle - OS: Windows7
Perform a stpapi.find twice

The following Thread shows a case in which a FIND was done twice. Any chance this could be the solution here. Mine is not a session with view field.

If someone has tried a similar solution and worked please do reply. Thanks.
__________________
Regards,
Anjana
Reply With Quote
  #8  
Old 1st May 2014, 14:49
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,322
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

You can definitely give it a try. I am not familiar with your session so can't try anything.

AFS requires a lot of trial and errors and even after you think you are done, you can get some unusual problems either due to some new scenarios introduced or may be any system changes. You just need to be a bit patient and you will do it.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #9  
Old 1st May 2014, 15:58
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Well it tells me something is different between production and development. Session, libraries, porting set or something. I am just not sure how to determine which it is.

And yes - I can't remember which case it was that I had to do a find twice to make sure I got the correct record. I have also had to do change view and a find to make sure I got the correct record. Sometimes you just have to play with it like Bhushan mentioned.
__________________
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
  #10  
Old 8th May 2014, 12:27
a.menon's Avatar
a.menon a.menon is offline
Junior Member
 
Join Date: Sep 2013
Posts: 20
a.menon is on a distinguished road
Baan: BAAN 5 - DB: Oracle - OS: Windows7
Thumbs down

Hello Gurus,

I tried the solution with 2 finds as given below.

Code:
|whinhf3520m000.handle.sub.process("whinh3820m000", "add")		|AM.14042014.so
	|stpapi.put.field("whinh3820m000", "whinh210.rcno", receipt.number)		|AM.14042014.eo
	
	stpapi.put.field("whinh3520m000", "whinh210.rcno", receipt.number)		|AM.14042014.sn
	stpapi.browse.set("whinh3520m000", error.mess)		
	if not isspace(error.mess) then
		message(error.mess)
	endif		
	stpapi.handle.subproc("whinh3520m000","whinh3820m000","add")		|AM.14042014.en	

	|ret = whinhf3820m000.find(error.mess)				|AM.04052014.n	

		
	whinhf3820m000.put.Order_Origin(whgei210.oorg)
	whinhf3820m000.put.Order(whgei210.orno)
	whinhf3820m000.put.Position_Number(whgei210.pono)
	whinhf3820m000.put.Sequence_Number(ord.seq)
	ret = whinhf3820m000.find(error.mess)	
	

	if ret<>1 then 								|AM.06052014.en
		whinhf3820m000.put.Order_Origin(whgei210.oorg)
		whinhf3820m000.put.Order(whgei210.orno)
		whinhf3820m000.put.Position_Number(whgei210.pono)
		whinhf3820m000.put.Sequence_Number(ord.seq)
		ret = whinhf3820m000.find(error.mess)
	endif

The test environment all worked fine , the first find returns 2 then the next find returns 1. But on Live , only on certain cases , both finds return 2 .

The test and live only differ by the package combination . Rest all is the same in both . As such I don't see why any difference should be there.

Does anyone have any other suggestions ? Will change.view work in this situation? But the session does not have a view field.

Thank you.
__________________
Regards,
Anjana
Reply With Quote
  #11  
Old 8th May 2014, 15:07
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,934
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Never hurts to try change view. My thing is if it works in test and not production - there is a difference somewhere between the two systems. I just do not know how to identify where.
__________________
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 21:48
AFS fail to delete record in Maintain Estimated End Items ppchong AFS/DDC/OLE: Function servers 1 21st September 2011 14:16
Error: record modified by other user; new values are displayed / Record not found mast_aadmi Tools Development 2 30th December 2009 18:20
how to insert record in type3 form via AFS??? alibaba AFS/DDC/OLE: Function servers 5 17th September 2004 05:19
Detected database server termination (help! aide! ayuda! hilfe! ayuto! hellup! •‚¯!)! Francesco Operating Systems & Databases 15 20th July 2002 12:37


All times are GMT +2. The time now is 15:10.


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