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 7th July 2005, 00:24
pradbaan pradbaan is offline
Junior Member
 
Join Date: May 2002
Posts: 15
pradbaan is on a distinguished road
afs for tisfc0202m000 - report production order complete

Hi
I would like to write an afs for the tisfc0202m000 along with the handling of the subsession tdilc4113s000 - maintain receipts.
can someone help me get started.
Reply With Quote
  #2  
Old 7th July 2005, 13:35
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,936
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Question

This thread has my version of tisfc0202m000 in it. This is a starting point. If when you complete a production order it calls tdilc4113s000 then you will need to add a stpapi.handle.subproc statement to try to control the sub-session. The outline would look something like this:

stpapi.put.field("tisfc0202m000",.....)
stpapi.put.field("tisfc0202m000",.....)
stpapi.put.field("tisfc0202m000",.....)
stpapi.handle.subproc("tisfc0202m000","tdilc4113s000",somemsg)
rc = stpapi.update("tisfc0202m000",1,msg)
stpapi.put.field("tdilc4113s000",.....)
stpapi.put.field("tdilc4113s000",.....)
rc = stpapi.update("tdilc4113s000",1,msg)

It is not always as easy as it looks. I have problems with programs that call tdilc4113 and tdilc4123 before.

Good Luck!
__________________
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
  #3  
Old 8th July 2005, 05:07
pradbaan pradbaan is offline
Junior Member
 
Join Date: May 2002
Posts: 15
pradbaan is on a distinguished road
afs for tisfc0202m000

Thanks mark for your help
I did run the session with the afs but it doesn't seem to be doing anything at all. it goes thru fine without any error and i check in the debug mode. but it does seem to anything at all.
any thoughts on this

thanks
Reply With Quote
  #4  
Old 8th July 2005, 13:28
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,936
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
If you post the code someone might see something. You can also set turn on the afs log and post it (-set AFSLOG=1 in bwc login). That will also help.
__________________
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 8th July 2005, 17:54
pradbaan pradbaan is offline
Junior Member
 
Join Date: May 2002
Posts: 15
pradbaan is on a distinguished road
afs for tisfc0202m000

Code:
function extern domain tcbool tisfcdll9110.create.afs.report.production.order.completed(
	|	domain  tfgld.docn	docn.f,
	|	domain	tfgld.lino	lino.f,
	|	domain	tcncmp		comp.f,
		domain	tcpdno		pdno.f,
		domain	tiqep1		qcmp.f,
		domain	tccwar		cwar.f,
		domain	tdltc.clot	clot.f,
		domain	tcitem		item.f,
	|	domain	tcyesno		comp.frm,
	|	domain	tcyesno		updt.popr,
	|	domain  tcyesno 	post.stock,
		domain  tidate		date.f,
		ref string o.mess())
{
     long ret.val
     long retval
     string	msg
     long	gapi.error.code
     long	rc
     string	somemsg
	stpapi.put.field("tisfc0202m000","tisfc001.pdno",str$(pdno.f))
	rc = stpapi.find("tisfc0202m000",o.mess)
	if not isspace(o.mess) or rc<>1 then
		stpapi.end.session("tisfc0507m000")
		stpapi.end.session("tisfc0202m000")
		return(false)
	endif
| Update the warehouse	
	stpapi.put.field("tisfc0202m000","tisfc001.cwar",cwar.f)
	rc = stpapi.update("tisfc0202m000",1,o.mess)
	if not isspace(o.mess) or rc<>1 then
		stpapi.end.session("tisfc0202m000")
		return(false)
	endif

|	stpapi.get.field("tisfc0202m000","tisfc001.osta",qcmp)
|	stpapi.get.field("tisfc0202m000","tisfc001.pdno",qcmp)
|	stpapi.get.field("tisfc0202m000","qdlv.frm",qcmp)
	stpapi.put.field("tisfc0202m000","qdlv.frm",str$(qcmp.f))
	rc = stpapi.enum.answer("tisfc0202m000","tisfc02024",tcyesno.yes)
	rc = stpapi.enum.answer("tisfc0202m000","tisfc02029",tcyesno.yes)
	stpapi.put.field("tisfc0202m000","tisfc001.cwar",cwar.f)
	stpapi.continue.process("tisfc0202m000",o.mess)
	if isspace(o.mess) then
		stpapi.handle.subproc("tisfc0202m000","tdilc4113s000",somemsg)
		stpapi.put.field("tdilc4113s000","tdilc402.item",item.f)
		stpapi.put.field("tdilc4113s000","tdilc402.clot",clot.f)
		stpapi.put.field("tdilc4113s000","tdilc402.date",str$(date.f))
		stpapi.put.field("tdilc4113s000","tdilc402.qstr",str$(qcmp.f))
	|	rc = stpapi.insert("tfacp1120s000", true, o.mess)
		rc = stpapi.update("tdilc4113s000",1,o.mess)
		if not isspace(o.mess) or rc<>1 then
			stpapi.end.session("tdilc4113s000")
			stpapi.end.session("tisfc0507m000")
			stpapi.end.session("tisfc0202m000")
			return(false)
		else
			stpapi.end.session("tdilc4113s000")
			rc = stpapi.update("tisfc0202m000",1,o.mess)
			if not isspace(o.mess) or rc<>1 then
				stpapi.end.session("tisfc0507m000")
				stpapi.end.session("tisfc0202m000")
			endif
		endif
		stpapi.get.mess.code("tisfc0202m000",o.mess)
	else
		return(false)
	endif
	stpapi.end.session("tisfc0202m000")
	return(true)
}

Last edited by mark_h : 8th July 2005 at 18:41. Reason: add code tags
Reply With Quote
  #6  
Old 8th July 2005, 19:00
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,936
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
The first thing I notice is that your stpapi.handle.subproc should be before the continue. From looking at your code I am assuming that when you run it manually you may change the warehouse(this is the only field I change), then you click continue and then the session tdilc4113s000 comes up. Is that correct? Also what version of Baan are you on? It makes a difference in some cases.

The whole key behind these function servers is to try to mirror what you do manually on your system - which may be different from my system. So on my system I can get asked two questions, those are what you have in your code. Make sure these match your system and make sure you do not get asked additional questions. Those will also need to be built into your code. I usually run through the session manually tracking what I did to get it to work - then just translate it into code.
__________________
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
Production Order Substitution Report rdbailey Manufacturing & Supply Chain 4 3rd June 2005 08:46
Reject field in the Report Order Complete hendra Manufacturing & Supply Chain 4 23rd November 2004 03:52
Production Order Complete tomlbacon Manufacturing & Supply Chain 3 16th June 2004 14:06
More quantity when report production order completed hpcarol Manufacturing & Supply Chain 6 18th September 2002 10:05


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


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