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

User login

Frontpage Sponsor


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

Baanboard at LinkedIn

Reference Content

Thread Tools Display Modes
Old 13th August 2014, 13:15
kruyoupatel kruyoupatel is offline
Junior Member
Join Date: Aug 2012
Posts: 23
kruyoupatel is on a distinguished road
Baan: BaanIV - DB: informix - OS: ms-win\
AFS for Purchase Invoice Transaction to Material Costs session failing

Hello All,

Can anybody help to get correct AFS to execute "tpppc2511m000" session from "tfacp1120s000" session.

I did tried to write AFS but nothing works properly.

I did RnD and was amused to see that standard script calls "tpppc2511m000" session using 3gl.

What actually happens is "tfacp1120s000" session calls tpppc2811m000 through dll using start.session command and this "tpppc2811m000" session has 3gl attached to it which executes "tpppc2511m000" session.

As there is an 3GL intermediate session i am unable to have "stpapi.subproc AFS" call on "tpppc2511m000" session, it opens the session as front end process instead of backend process.
Reply With Quote
Old 13th August 2014, 15:24
mark_h's Avatar
mark_h mark_h is offline
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,903
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
This is 4c4 code and I do not have source code to look at. This was one of the tougher ones for me to solve - while not the same sessions you mention it does launch tpppc2811m000 to get to 2111m000. This is just a piece of the code - there is a couple of what they call ZRC and AP5 transactions. You will notice that the call to tuddc9120m000 is actually running code to kill a background process, because an actual stpapi.end hangs. Second or third time I had to use this type of kill in some code. Hopefully this gives you some ideas on getting yours running.

function create.zrcb1()
	errmsg = ""
	errmsg1= ""
	| 1.  tfgld1100m000 (Maintain Transactions) 
	| 1.0 Input Batch data

	stpapi.put.field("tfgld1100m000", "tfgld100.year", str$(c.yyyy)) 
	stpapi.put.field("tfgld1100m000", "tfgld100.btno", str$(s.btno))
	rc = stpapi.find("tfgld1100m000", errmsg) 
	| Start Session tfgld1101s000 ... Insert CTR transaction holder
	stpapi.handle.subproc("tfgld1100m000", "tfgld1101s000", "add")
	stpapi.put.field("tfgld1101s000", "tfgld101.year", str$(c.yyyy)) 
	stpapi.put.field("tfgld1101s000", "tfgld101.btno", str$(s.btno))
	stpapi.put.field("tfgld1101s000", "tfgld101.ttyp", "ZRC")
	rc = stpapi.find("tfgld1101s000", errmsg) 
	if rc<>1 then
		errmsg1 = "9." & "ZRC not found"
	stpapi.handle.subproc("tfgld1101s000", "tfacp1110s000", "add")
	stpapi.continue.process("tfgld1101s000", errmsg)"tfacp1110s000",errmsg)

	stpapi.handle.subproc("tfacp1110s000", "tfacp1130s000", "add")	
	stpapi.continue.process("tfacp1110s000", errmsg) | should start 1130 and 1131s
	stpapi.handle.subproc("tfacp1130s000", "tfacp1140s000", "add")		
	stpapi.application.option( "tfacp1130s000", 1, 0, errmsg )	| Approve button
	| Now 1133 is running.
	stpapi.put.field("tfacp1133s000","tfacp101.leac", "CCN")
	stpapi.handle.subproc("tfacp1133s000", "tpppc2811m000", "add")		
	stpapi.insert("tfacp1133s000",1, errmsg)
	select	tdpur951.*, tipgc820.cspa
	from	tdpur951, tipgc820				
	where   tdpur951._index1 = {:tdudi050.orno,
				    :tdudi050.line}  and	
		tipgc820.cprj = tdpur951.cprj and		
		tipgc820.butm = tdpur951.butm and
		tipgc820.sbtm = tdpur951.sbtm and
		tipgc820.prog = tdpur951.prog and
		tipgc820.eser = tdpur951.eser and
		tipgc820.unfr <= tdpur951.eseq and
		tipgc820.unto >= tdpur951.eseq
	as set with 1 rows
	stpapi.put.field("tpppc2111m000","tpppc211.cprj", tdpur951.cprj)
	stpapi.put.field("tpppc2111m000","tpppc211.item", "MISC MATL")
	stpapi.put.field("tpppc2111m000","tpppc211.cspa", tipgc820.cspa)
	stpapi.put.field("tpppc2111m000","tpppc211.ccco", "287")
	stpapi.put.field("tpppc2111m000","reasoncode", "BUY")
	stpapi.insert("tpppc2111m000",1, errmsg)
	if not isspace(errmsg) then	
		errmsg1 = "9a" & errmsg
	baan.sess = "tpppc2811m000"
	rc = activate("tuddc9120m000")	

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

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
Finance session afs error jayugandhi AFS/DDC/OLE: Function servers 3 11th August 2014 17:15
synchronizing different occurrences on parent session from child Ruskin Tools Development 8 18th March 2008 17:56
FS Script for the Session tdslsl205s001(Maintain Excise Invoice Details) KHN Naik AFS/DDC/OLE: Function servers 0 30th October 2002 17:15
AFS - Material To Issue for Production Orders vsevilla AFS/DDC/OLE: Function servers 2 3rd October 2002 14:45

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

©2001-2017 - -