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 26th June 2006, 12:54
alibaba's Avatar
alibaba alibaba is offline
Junior Member
 
Join Date: Jan 2003
Location: Earth
Posts: 26
alibaba is on a distinguished road
Baan: IVc2/IVc4/V -
Unhappy Cant Generate Receipt number when AFS call

Hi:
I was test AFS receipt in Baan4C4 sch.before develpe, I sought some examples in baanboard,but not same with us :

* My script for sub.order receipt,so input serial of receipt only.and call tdpur4131s000 only (sch).
Code:
    select	tdpur045.*
    from	tdpur045
    where	tdpur045._index4 = {:temp.pdno,:temp.opno}
    as set with 1 rows
    selectdo
       stpapi.put.field("tdpur4120m000","tdpur045.reno",str$(temp.rcno))
       stpapi.enum.answer("tdpur4120m000","tdpur41206",tcyesno.no)
       stpapi.handle.subproc("tdpur4120m000","tdpur4131s000","add")

|****in fact the choice.cont.process not any define in tdpur4120m000*****
|      stpapi.continue.process("tdpur4120m000", error.cont)
       stpapi.zoom.option("tdpur4120m000",1,"tdpur4131s000",error.zoom)

       stpapi.put.field("tdpur4131s000","tdpur045.reno",str$(temp.rcno))
       stpapi.put.field("tdpur4131s000","tdpur045.suno",tdpur045.suno)
       stpapi.put.field("tdpur4131s000","tdpur045.orno",str$(tdpur045.orno))
       stpapi.put.field("tdpur4131s000","tdpur045.pono",str$(tdpur045.pono))
       stpapi.put.field("tdpur4131s000","tdpur045.ddtb",str$(tdpur045.ddtb))
       
       ret.find.s = stpapi.find("tdpur4131s000")
       ret.mark = stpapi.mark("tdpur4131s000")

|choice cont.process and db.save not any define in tdpur4131s000 also...
|stpapi.continue.process("tdpur4131s000", error.cont)
|stpapi.save("tdpur4131s000", error.cont)
       
       stpapi.end.session("tdpur4131s000") 
 
      stpapi.get.field("tdpur4131s000","tdpur045.reno",ret.rcno)
      stpapi.end.session("tdpur4120m000") 
    endselect

at step stpapi.get.field("tdpur4131s000","tdpur045.reno",ret.rcno),I cant get receipt number,and I find the last number of receipt serial (tcmcs047),that not any changed.

so, I think maybe not geranated receipt number when runtime. but in AFS LOG , that find/mark was successful!
why ? how to geranate receipt number?


thanks!
Attached Files
File Type: log AFS.LOG (3.7 KB, 40 views)
__________________
----------------------------------------

Last edited by mark_h : 26th June 2006 at 14:40.
Reply With Quote
Sponsored Links
  #2  
Old 26th June 2006, 14:57
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,906
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I do not actually see anything to create the receipt - of course it looks like your version is different than mine. We do not use tdpur4131s000. You can try this in your code:
Code:
      stpapi.enum.answer("tdpur4120m000","tdpur41206",tcyesno.no)
      stpapi.handle.subproc("tdpur4120m000","tdpur4131s000","add")
      ret = stpapi.change.view("tdpur4120m000")

This might automatically start tdpur4131s000 - at least that is the impression I get from other posts. Once tdpur4131s000 comes up I really can't help. I can tell you this - on our system this session does have a "OK" button, which is usually the same as continue.

Just guessing.
__________________
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 27th June 2006, 03:23
alibaba's Avatar
alibaba alibaba is offline
Junior Member
 
Join Date: Jan 2003
Location: Earth
Posts: 26
alibaba is on a distinguished road
Baan: IVc2/IVc4/V -
thanks for you reply Mark!
Yes, when put : stpapi.change.view("tdpur4120m000") to script,that same with stpapi.zoom.option("tdpur4120m000",1,"tdpur4131s000",error.zoom) in backguard(start tdpur4131s000),but message "<tdpur4120m000 2 another view found!" was appeard in log.I think maybe put fields not key field .so I put zoom.option call tdpur4131 directly.
so , I think my problem is gerenate receipt number only ,why can not auto generate after 4131s000(find = 1 mark = succ.). when and who? 4120m000 or 4131s000? if 4120m000. then another action needed when retrun from 4131s000?
.......................................
__________________
----------------------------------------
Reply With Quote
  #4  
Old 27th June 2006, 14:53
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,906
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I do not think I am going to be much help. On our system tdpur4131s000 uses supplier, delivery date, order and position to find a record. So it sounds like our systems work differently. I would expect your API code to mimic almost exactly what you do manually to create a receipt. From just glancing at my system this is how I think it should work - but this is only a guess.
Code:
|* Find existing receipt
 	stpapi.put.field("tdpur4120m000","tdpur045.reno",str$(receipt.number))
  	stpapi.put.field("tdpur4120m000","tdpur045.orno",str$(purchase.order))
 	stpapi.put.field("tdpur4120m000","tdpur045.pono",str$(purchase.line))
	rc = stpapi.find("tdpur4120m000",msg)
	
	stpapi.enum.answer("tdpur4120m000","tdpur41206",tcyesno.no)
	stpapi.handle.subproc("tdpur4120m000","tdpur4131s000","add")
	rc = stpapi.change.view("tdpur4120m000")
	|* The above change view launches tdpur4131s000
	stpapi.put.field("tdpur4131s000","tdpur045.suno",tdpur045.suno)
	stpapi.put.field("tdpur4131s000","tdpur045.ddtb",str$(tdpur045.ddtb))
	stpapi.put.field("tdpur4131s000","tdpur045.orno",str$(tdpur045.orno))
	stpapi.put.field("tdpur4131s000","tdpur045.pono",str$(tdpur045.pono))
	|* Find the new receipt in tdpur4131s000
	rc = stpapi.find("tdpur4131s000",msg)
	|* Mark the record
	ret.mark = stpapi.mark("tdpur4131s000")
	stpapi.continue.process("tdpur4131s000",msg)
	stpapi.end.session("tdpur4224s000")
	|Note for the continue you might get message Process is Gone
	|At this point this would to the existing receipt found in tdpur4120m000
I did not do any error checking and if you are trying a brand new receipt I would expect you could leave the stpapi.find on tdpur4120 out of the code and just do the change view. Again this is all guessing since our system does not work like that.

What I do in my code is check to see if a receipt exists for the line and position - if yes I run a modify existing receipt routine. If no I run the create a receipt routine, then when it completes I run modify existing receipt.
__________________
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
  #5  
Old 4th September 2006, 10:36
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
Just looking through the AFS forum and saw this thread. Alibaba, please look at the script that Pedro posted in Nov 2002. That one works. Don't worry about stpapi.change.view("tdpur4120m000")=2. I got the same return for that command, but my AFS sequence works as it should be (and it follows the same pattern as Pedro's)

By the way, stpapi.get.field("tdpur4120m000","tdpur045.reno",ReceiptNumber) failed in my test server until we updated our STP module. So, make sure you have latest STP too (solution 10923 in Baan Support)

Rgds,
Paul

Rgds,
Paul
__________________
Pambudi

Visit my technology consulting blog
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
How to generate receipt number srinivas AFS/DDC/OLE: Function servers 4 24th September 2016 09:09
AFS receipt in BaanERP Paul P AFS/DDC/OLE: Function servers 28 7th July 2009 11:50
AFS - Generate Inbound PeterCraven AFS/DDC/OLE: Function servers 2 11th March 2006 17:21
Receipt Number in Collect orders sandeep_Kumar Distribution, Transportation & Warehousing 1 28th September 2004 00:51
Lot Number Vs Receipt Number in BaaN IV C4 Abuibra Distribution, Transportation & Warehousing 2 11th October 2002 17:22


All times are GMT +2. The time now is 04:13.


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