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 17th May 2004, 11:52
jmathew jmathew is offline
Senior Member
 
Join Date: Aug 2003
Location: Middle East
Posts: 183
jmathew is on a distinguished road
Baan: Baan IV C4 - DB: Oracle 8i - OS: Windows 2000
get data from tfgld3501m000 display session

Hi,

I would like to get data from the display session "tfgld3501m000". The problem is that when we manually open the session the session opens and another zoom session is super-imposed which is "tfgld3503s000" where we input the "Year" and "Current Period" and "Save & Exit" to come back to the session tfgld3501m000 and find the balace of a GL account.

I would like to retreive data using AFS from the session "tfgld3501m000". How can i do it. Can someone let me know how the code is to be written. I tried AFS but not able to proceed since a sub-session is automatically opened. I am not able to put the "Year" and "Current Period" and "Save & Exit" to come back to the session "tfgld3501m000" and get the closing balance or any other data from the session "tfgld3501m000".

Please help!!!

Regards,
John.
Reply With Quote
  #2  
Old 17th May 2004, 14:34
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Something to try...

Here is something you can try. Use the code you have to start tfgld3501m000 - do put field or what ever. Then do a find in tfgld3501m000. Next compile the code in debug mode. Stop immediately after the first put field. You should have tfgld3501m000 and tfgld3503s000 running. Now use option dialog and start shell. Go out and kill the tfgld3503s000 session. First make sure it ends. Next step through the rest of the code to see if it works.

I have seen some automatic zoom sessions that do not work and by that I mean you can not control them with stpapi commands. It one of these cases what I do is a zoom to a sub-session I wrote to kill these sessions so I can control the main session. Not pretty, but it works. The code for this is in this forum, but first we can check to see if this works. I keep meaning to fix this session to make it run in the background, but just have not got around to it.

Mark
Reply With Quote
  #3  
Old 17th May 2004, 15:33
jmathew jmathew is offline
Senior Member
 
Join Date: Aug 2003
Location: Middle East
Posts: 183
jmathew is on a distinguished road
Baan: Baan IV C4 - DB: Oracle 8i - OS: Windows 2000
great idea!!!

Hi Mark,

I am able to go to the bshell and kill the sub-session "tfgld3503s000" and then it works fine. But how can I kill this from the script? Please let me know.

Thanks,
John.
Reply With Quote
  #4  
Old 17th May 2004, 15:36
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
just use kill(parent)
Reply With Quote
  #5  
Old 17th May 2004, 16:11
jmathew jmathew is offline
Senior Member
 
Join Date: Aug 2003
Location: Middle East
Posts: 183
jmathew is on a distinguished road
Baan: Baan IV C4 - DB: Oracle 8i - OS: Windows 2000
kill not possible

Hi en,

The program hangs and hence from script i am not able to kill. How can i go ahead with the script when it hangs?

John.
Reply With Quote
  #6  
Old 17th May 2004, 16:12
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Check

Check this post out. I actually made it a sub-session that I could zoom to, kill some sub-session.

Mark
Reply With Quote
  #7  
Old 18th May 2004, 10:57
jmathew jmathew is offline
Senior Member
 
Join Date: Aug 2003
Location: Middle East
Posts: 183
jmathew is on a distinguished road
Baan: Baan IV C4 - DB: Oracle 8i - OS: Windows 2000
how find the process id of the sub-session

Hi Mark,

How can i find the process id of this sub-session so that i could kill the process.

I have developed a sub-session but i am using pid -1 to kill the process. But is there a way to find the process id of the sub-session "tfgld3503s000" that is hanging.

Please let me know.

Thanks,
John.
Reply With Quote
  #8  
Old 18th May 2004, 14:44
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Here is what I use to call my subsession - note I do not really need to pass the PID. I never changed the code when I got it working:

Code:
| Update reason code for change.
	put_reason_code()
|************ This is where it hoses..................................
	ppid = pid
	baan.sess = "tdpur9151s00b"
	export("ppid",ppid)
	export("baan.sess",baan.sess)
	activate("tuddc9120m000")
	stpapi.zoom.option("tdpur4107s000",1,"tdpur9151s00b",fserr)

Here is the code for the sub-session itself and my dis-claimer. Feel free to modify this to suit your needs, but my code has never been cleaned up. If you look closely I believe my code would kill only the first instance of the session. If you had this session up manually it could cause problems. We did not discover this problem until we went live on 4c4 so I just threw something together to get the users working. One of these days I will clean it up.

Mark

Code:
declaration:

| Form Fields
	extern	domain	tcmcs.str14	baan.sess

| Fields used for checking request to be deleted
	extern		long		ppid
	extern	domain	tcbool		sess.found
	extern		long		cnter
	#include <bic_tt>

|****************************** PROGRAM     SECTION ***************************
before.program:
	cnter = 0
	
|****************************** ZOOM FROM   SECTION ***************************
|****************************** FORM	    SECTION ***************************
form.1:
init.form:
	if background then
| If you execute the kill command to quick it will not work.
		suspend(5000)
		execute(cont.process)
	endif

|****************************** CHOICE      SECTION ***************************
choice.cont.process:
on.choice:
	if not background then
		check.all.input()
	else
		import("ppid",ppid)
		import("baan.sess",baan.sess)
	endif
	find.a.process()
	if background then
		execute(end.program)
	endif

choice.interrupt:
before.choice:
	
choice.abort.program:
before.choice:

choice.end.program:
before.choice:
	if background and not sess.found then
		cnter = cnter + 1
		if cnter<100 then
			suspend(100)
			execute(cont.process)
		endif
	endif
|****************************** FIELD       SECTION ***************************
field.baan.sess:
check.input:
	if isspace(baan.sess) then
		message("Session is mandatory")
		set.input.error("")
	endif
|****************************** MAIN TABLE  SECTION ***************************
|****************************** FUNCTION    SECTION ***************************
functions:
function find.a.process()
{
	long    hold.pno
	long    pno
	long    info(256)
	string  pname(15)
	
	sess.found = false
|	message("%d",pid)
	pno = 0
	hold.pno = pno
	pno = pstat (pno, pname, info)
	while pno > 0 and not sess.found
		hold.pno = pno
		pno = pstat (pno, pname, info)
		if strip$(pname)=strip$(baan.sess) then
			kill(hold.pno)
			sess.found = true
		endif
	endwhile
}
Reply With Quote
  #9  
Old 16th October 2004, 15:31
vishbaan's Avatar
vishbaan vishbaan is offline
Senior Member
 
Join Date: Aug 2001
Location: Dubai
Posts: 207
vishbaan is on a distinguished road
Baan: B40c4, LN - DB: SQL2K - OS: W2K
pid always returned as 0

hi

I used this code to return all processes of the user currently logged-in; but the pno varible always has the value 0; where as the pname contains the relevant session codes.

any clues, it will help

thanks

VISH
__________________
Vishi...Cool
Reply With Quote
Sponsored Links
  #10  
Old 18th October 2004, 00:58
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Are you saying that in this statement "pno = pstat (pno, pname, info)" the pno variable is always 0? You may just need the latest tools patch. You may want to post your code - someone may see something that would fix the problem, of course I am wondering how it steps through each of the sessions. According to the help
each process number is returned to step through the sessions.

Mark
Reply With Quote
  #11  
Old 31st October 2004, 09:20
vishbaan's Avatar
vishbaan vishbaan is offline
Senior Member
 
Join Date: Aug 2001
Location: Dubai
Posts: 207
vishbaan is on a distinguished road
Baan: B40c4, LN - DB: SQL2K - OS: W2K
it worked

thanks MARK.

it returned the "pno" when I tried it on SP14; SP12 it does not work.

I think this is the one I will use for logging-out the user with regards to licence control by company and multiple log-ins.

thanks again, best regards

VISH
__________________
Vishi...Cool
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
ERPJewels Hitesh Shah Third Party Products 10 6th November 2006 05:38
How to display data from two companies in a single session? kbabu1 Tools Development 22 16th November 2004 23:02
Display Session Form Data Manipulation rmarles Tools Development 6 25th October 2003 17:54


All times are GMT +2. The time now is 08:49.


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