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 16th May 2002, 11:55
jdhaan jdhaan is offline
Junior Member
 
Join Date: Jan 2002
Location: Netherlands
Posts: 8
jdhaan is on a distinguished road
Using AFS in reportscript

Is there someone who knows if you can call AFS dll's from report scripts?

I've tried to do this, for inserting in table tpppc211, but AFS is always returning "Item not allowed". The AFS dll is called from a report script.

When I call the same dll with the same data from a program script AFS is creating the record succesfull.
Reply With Quote
  #2  
Old 17th May 2002, 20:02
mark_h's Avatar
mark_h mark_h is offline
Guru
 
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
Did a quick test...

I have never really thought about running a FS in a report. I will have to remember that as a possible solution later on.

Anyway I did a quick test. I put the following code into a report:
Code:
	#pragma used dll ottstpapihand		
before.program:
	stpapi.put.field("tpptc1230m000","cprj.f"," LSIM5")
	stpapi.put.field("tpptc1230m000","cprj.t"," LSIM5")
	stpapi.set.report("tpptc1230m000","rtpptc123001000",spool.device,errmsg)
	stpapi.continue.process("tpptc1230m000", errmsg)
	if(strip$(errmsg)<>"") then
		message(errmsg)
	endif

It worked just fine - except the report from the Generate control session was at the beginning of my report. So it makes me wonder if for some reason or other the item that you are putting onto the session might not be what the session is expecting. Have you run the report in debug mode to check the items? Also I put my code in the before.program section, so I really do not know how it would effect the FS in other sections. Maybe if you post the code someone may see something that is causing the problems.

Good Luck!

Mark

Last edited by ~Vamsi : 9th June 2002 at 02:46.
Reply With Quote
  #3  
Old 21st May 2002, 10:13
jdhaan jdhaan is offline
Junior Member
 
Join Date: Jan 2002
Location: Netherlands
Posts: 8
jdhaan is on a distinguished road
AFS in report script

The problem is, when I try to debug the report script, I get an overflow error when I ask the value of a field variable and the Baan session has to be killed.
This is why I assume, that AFS will not work from a report script.

Looking at the AFS log, the field for the item has the right value:

Code:
LOGGING STARTED
16-05-2002
12->get.fields
12<-get.fields0tpppc211.cprj1tpppc211.cspa1tpppc211.cact1tpppc211.item0
tpppc211.item.segment.11tpppc211.item.segment.21tpppc211.sern1tpppc211.cstl1
tpppc211.ccco1tpppc211.desc1tpppc211.quan
1tpppc211.cuni1tpppc211.curc1tpppc211.pric1tpppc211.amoc1tpppc211.curs1
tpppc211.pris1tpppc211.amos1tpppc211.rgdt
1tpppc211.year1tpppc211.peri1tpppc211.fyea1
tpppc211.fper1tpppc211.entu1tpppc211.cdoc1tpppc211.otbp1tpppc211.ifbp1
>tpppc2111s000 put.field:tpppc211.cprj E10071   
>tpppc2111s000 put.field:tpppc211.sern 2
>tpppc2111s000 put.field:tpppc211.cspa     0001
>tpppc2111s000 put.field:tpppc211.cact 
>tpppc2111s000 put.field:tpppc211.item          2.10071.81518                         
>tpppc2111s000 put.field:tpppc211.rgdt 730986
>tpppc2111s000 put.field:tpppc211.quan 100
>tpppc2111s000 put.field:tpppc211.cuni pcs
>tpppc2111s000 put.field:tpppc211.cstl 
>tpppc2111s000 put.field:tpppc211.ccco 420     
>tpppc2111s000 put.field:tpppc211.desc Stock item/10/Appelboor standa
>tpppc2111s000 put.field:tpppc211.curc EUR
>tpppc2111s000 put.field:tpppc211.pric 0
>tpppc2111s000 put.field:tpppc211.amoc 0
>tpppc2111s000 put.field:tpppc211.curs EUR
>tpppc2111s000 put.field:tpppc211.pris 0
>tpppc2111s000 put.field:tpppc211.amos 0
>tpppc2111s000 put.field:tpppc211.entu 200
>tpppc2111s000 put.field:tpppc211.cdoc          
>tpppc2111s000 put.field:tpppc211.otbp          
>tpppc2111s000 put.field:tpppc211.ifbp          
>tpppc2111s000 insert
12->add.set+save
12<-add.set+save10
<tpppc2111s000 Item not allowed
>tpppc2111s000 save
12->update.db
12<-update.db0
<tpppc2111s000 
>tpppc2111s000 end.session
12->end.program
12<-end.program0
Also when I manually start the session and add this record, there is no problem with the item code.

Last edited by mark_h : 21st May 2002 at 14:14.
Reply With Quote
Sponsored Links
  #4  
Old 21st May 2002, 17:06
mark_h's Avatar
mark_h mark_h is offline
Guru
 
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
Possibilities........

We have something like this with our Purchase Order report. When we run it in debug at a certain point you get an overflow and the report just shuts down. I have to debug using messages and such. I have never really solved this problem. I figured it had something to with corrupting memory or something like that. I keep hoping that one of the tools releases will fix the problem, but no luck so far.

I did have a couple of ideas you could try if you want - I am not sure if they will work. First since you know your session works, take the code and create a dll. Then remove all the code from the report script and just put in the code for the DLL - of course passing all the parameters you need. This idea may work. Hopefull by pulling all that code out of the script and putting it in a DLL may solve the overflow problem.

Another idea is to try activating your session that works. I am not sure if you could export variables from a report script to a session. I think this probably would not work, but thought I still should mention it.

Not real good solutions, but I do think trying the first suggestion is worth the try. Good Luck!


Mark
Reply With Quote
  #5  
Old 22nd May 2002, 08:22
jdhaan jdhaan is offline
Junior Member
 
Join Date: Jan 2002
Location: Netherlands
Posts: 8
jdhaan is on a distinguished road
AFS in reportscript

I've created an independent session,
copied the report script to the program script,
did some modifications,
and now it is working fine.

Thanks for your help Mark.
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 - 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
Performance Issues with AFS calls baaniac AFS/DDC/OLE: Function servers 0 29th May 2002 11:41


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


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