Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

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 18th August 2004, 12:04
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Code : use gbf browser to display bom

This is a short example using the gbf function of tgbrgsrvlib. This display the bom of an item (standard or specific) in the browser. each manufactured item by dubble cliking it display its component.

The form contains only two field project code (cprj.f) and the item code (mitm.f)

You must create a library ($BSE/gif/bom) and set therein the icon that you want to use (see function init_data_gbf)

Two librairies must be included in this script : tggbfsrvlib and tgcomlogging

Developped with baanIV c4 SP7

I have attached a zip file with the icon that i have created


Code:
|******************************************************************************
|* spbom0719  0  VRC B40O c4 expl
|* Impression graphique Nomenclatures spécifiques
|* Philippe Condé                
|* 2004-08-16
|******************************************************************************
|* Main table tipcs022 Nomenclatures spécifiques, Form Type 4
|******************************************************************************
|* License	:
|* Copyright 2001 by <Philippe Conde>
|* 
|* All Rights Reserved 
|* 
|* Permission to use, copy, modify, and distribute this software and its
|* documentation for any purpose and without fee is hereby granted,
|* provided that the above copyright notice appear in all copies and that
|* both that copyright notice and this permission notice appear in
|* supporting documentation. 
|* 
|* Philippe Conde and Baanboard.com DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|* AND FITNESS, IN NO EVENT SHALL <author> nor Baanboard.com BE LIABLE FOR ANY
|* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
|* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
|* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 
|* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|* OR PERFORMANCE OF THIS SOFTWARE.
|*                                                                               
|****************************** declaration section ***************************
declaration:

	table	ttipcs022	|* Nomenclatures spécifiques
	table	ttcmcs003	|* Magasins
	table	ttibom010	|* Nomenclatures de fabrication
	table	ttiitm001	|* Articles
	table	ttipcs021	|* Articles spécifiques
	
	#include "itggbfdefs" 	|* 
	#include "itgcomlogging" 	|* 


		long		rc
	extern	domain	tcyesno       	txta.yn
		domain	tcmcs.str60	gbf_key
		domain	tcmcs.str60	gbf_desc
		domain	tcmcs.str60	head_key
		domain	tcdate		mydate
	extern	domain	tccprj        	cprj.f	fixed
	extern	domain	tcitem        	mitm.f	fixed
		long		int.iconset1
		long		int.iconset2
		long		leaf.iconset1
		long		leaf.iconset2

|****************************** form section **********************************

form.1:
init.form:
	mydate = date.num()
	get.screen.defaults()

|****************************** choice section ********************************

choice.cont.process:
on.choice:
	read.main.table()


|****************************** field section *********************************
field.mitm.f:
check.input:
	if isspace(cprj.f) then
		select tiitm001.* from tiitm001
		where tiitm001._index1 = {:mitm.f}
		as set with 1 rows
		selectdo		
		   if tiitm001.kitm <> tckitm.manufacture then
		   	set.input.error("spbom07191")
		   	|* Article non fabriqué
		   endif
		selectempty
			set.input.error("spbom07192")
			|* Article inconnu
		endselect
	else
		select tipcs021.* from tipcs021
		where tipcs021._index1={:cprj.f, :mitm.f}
		as set with 1 rows
		selectdo		
		   if tipcs021.kitm <> tcpuma.manufacture then
		   	set.input.error("spbom07191")
		   	|* Article non fabriqué
		   endif
		selectempty
			set.input.error("spbom07192")
			|* Article inconnu
		endselect
	endif	
			
|****************************** function section ******************************

functions:

function read.main.table()
{
	rc = init_data_gbf()
	
}


function long read.pcs022( domain tccprj mycprj, domain tcitem myitem, domain tcmcs.str3 level )
{
	select	tipcs022.* from	tipcs022
	where   tipcs022._index1 = {:mycprj, :myitem}
	order by tipcs022._index1
	selectdo
		gbf_key(1;3) = edit$(tipcs022.pono,"999")
		gbf_key(10;16) = tipcs022.sitm(1;16)
		gbf_key(4;6) = "      "
		gbf_desc(1;3)=edit$(tipcs022.pono,"999")
		gbf_desc(4;1) = " "
		gbf_desc(5;6)="      "
		gbf_desc(11;2) = "  "
		gbf_desc(13;16)=tipcs022.sitm(1;16)
		gbf_desc(29;2)="  "
	        if tipcs022.opol = tcittb.customized then
			gbf_desc(5;6) = tipcs022.cprj(1;6)
			gbf_key(4;6) = tipcs022.cprj(1;6)
			select tipcs021.* from tipcs021
			where tipcs021._index1 = {:mycprj, :tipcs022.sitm}
			as set with 1 rows
			selectdo
				gbf_desc(31;30)=tipcs021.dsca(1;30)
				if tipcs021.kitm = tcpuma.manufacture then
					rc = gbf.add.interior(gbf_key, gbf_desc, 0)  |node
				else
					rc = gbf.add.object(gbf_key, gbf_desc, 1, true, leaf.iconset2) |leaf
				endif
			endselect	
	        else
	        	select tiitm001.* from tiitm001
	        	where tiitm001._index1= {:tipcs022.sitm}
	        	as set with 1 rows
	        	selectdo
	        		gbf_desc(31;30) = tiitm001.dsca(1;30)
	        		if tiitm001.kitm = tckitm.manufacture then
					rc = gbf.add.object(gbf_key, gbf_desc, 1, false, int.iconset2) | node
	        		else
					rc = gbf.add.leaf(gbf_key, gbf_desc, 0)  | leaf
				endif
			endselect
	        endif
	endselect
	return(0)
}
function long read.bom010(domain tcitem myitem, domain tcmcs.str3 level)
{
	select	tibom010.*
	from	tibom010
	where   tibom010._index1 inrange {:myitem, 0}
	                             and {:myitem, 999}
	and (tibom010.exdt = 0 or
	     tibom010.exdt > :mydate ) 
	order by tibom010._index1
	selectdo
		gbf_key(1;3) = edit$(tibom010.pono,"999")
		gbf_key(4;6) = "      "
		gbf_key(10;16) = tibom010.sitm(1;16)
		gbf_desc(1;3)=edit$(tibom010.pono,"999")
		gbf_desc(4;1) = " "
		gbf_desc(5;6)="      "
		gbf_desc(11;2) = "  "
		gbf_desc(13;16)=tibom010.sitm(1;16)
		gbf_desc(29;2)="  "
	        select tiitm001.* from tiitm001
	        where tiitm001._index1 = {:tibom010.sitm}
	        as set with 1 rows
	    	selectdo
	        	gbf_desc(31;30) = tiitm001.dsca(1;30)
	    		if tiitm001.kitm = tckitm.manufacture then
				rc = gbf.add.object(gbf_key, gbf_desc, 1, false, int.iconset2) |node
	    		else
				rc = gbf.add.leaf(gbf_key, gbf_desc,  0)  | leaf
	    		endif
	        endselect
	endselect
	return(0)
}
function extern long init_data_gbf()
{

	long	def.options
	long	ret_start
	long	retval


	
	head_key(1;6) = cprj.f(1;6)
	head_key(8;16) = mitm.f(1;16)
	retval = gbf.init(gbf.current.library(), head_key,
			bit.or(GBF.MENU.ALL  , GBF.MENU.FILE.OPEN),
			bit.or(GBF.BUTTON.ALL, GBF.BUTTON.FILE.QUIT),
			def.options)
	LogExecErrorReturn(retval, "gbf.init()")

	int.iconset1 = gbf.set.interior.icon( "bom",
				"specm.normal",		|unselected.closed
				"specm.open",		|unselected.open
				"specm.closed",		|selected.closed
				"specm.open",		|selected.open
				true )			|Défault
	int.iconset2 = gbf.set.interior.icon( "bom",
				"standm.normal",	|unselected.closed
				"standm.normal",	|unselected.open
				"standm.select",	|selected.closed
				"standm.select",	|selected.open
				false )
	leaf.iconset1 = gbf.set.leaf.icon( "bom",
			 "purs.normal",
			 "purs.select",
			 TRUE)
	leaf.iconset2 = gbf.set.leaf.icon( "bom",
			 "pursp.normal",
			 "pursp.select",
			 false)
			 

	retval = gbf.set.key.desc.length(60, 30)
	LogExecErrorReturn(retval, "gbf.set.key.desc.length(%d, %d)",
				60, 30)

	retval =  gbf.set.sort.strategy(  GBF.SORT.DESC
					+ GBF.SORT.ASCENDING
					+ GBF.SORT.INSENSITIVE)
	LogExecError(retval, "gbf.set.sort.strategy()")

	retval =  gbf.set.open.strategy(  GBF.OPEN.AGAIN
					+ GBF.OPEN.CURSEL
					+ GBF.OPEN.READALL)
	LogExecError(retval, "gbf.set.open.strategy()")

	ret_start = gbf.start(1, 1) 
	
	return (0)
}


function long find.bom(const string key.c())
{
	long	retval
	domain	tcitem	item.c
	domain	tccprj	cprj.c
	domain   tcmcs.str3	level


	level(1;3) = key.c(1;3)
	cprj.c = key.c(4;6)
	item.c = key.c(10;16)
	if isspace(cprj.c) then
		retval = read.bom010(item.c,level)
	else
		retval = read.pcs022(cprj.c,item.c, level)
	endif
	
	return (0)
}

function extern long gbf.get.top.level()
{
	head_key(1;3) = "   "
	head_key(4;6) = cprj.f(1;6)
	head_key(10;16) = mitm.f(1;16)
	return (find.bom(head_key))
}

function extern long gbf.get.children(const string key(),
					long value,
					long level)
{
	return (find.bom(key))
}

function extern long gbf.save(
	const	long	object.id,
	const	string	object.key(),
	const	long	object.value,
	const	long	menu.value)
{
| Doesn't need save already in tables :-)
	return (0)
}

Last edited by ~Vamsi : 18th August 2004 at 17:16.
Reply With Quote
  #2  
Old 30th September 2004, 15:31
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Here an example of a bom. (bmp file) and the zip file with the icons used
Attached Images
File Type: jpg bbcode.JPG (72.3 KB, 654 views)
Attached Files
File Type: zip bsegif.zip (29.1 KB, 335 views)
Reply With Quote
  #3  
Old 30th September 2004, 20:29
Xikkos's Avatar
Xikkos Xikkos is offline
Member
 
Join Date: Aug 2001
Location: Brazil
Posts: 58
Xikkos is on a distinguished road
Baan: Baan IV c4/Baan V -
Hi,

How can I read the files that are include in the file bsegif.zip ? For exemple the file "Thumbs.db".


Xikkos.
Reply With Quote
  #4  
Old 1st October 2004, 14:49
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Hello,

you can edit them with baan (session ttdsk6200m000) or copy them to windows and use paint

Regards
Philippe
Reply With Quote
  #5  
Old 6th October 2004, 15:52
jroberts's Avatar
jroberts jroberts is offline
Senior Member
 
Join Date: Nov 2001
Location: Guelph, Canada
Posts: 103
jroberts is on a distinguished road
Baan: Baan IVc4 SP5 - DB: Oracle 8.0.5 - OS: NT 4 SP 5
Happy Happy Engineers

Thanks so much for this post,

Our Engineering Staff have been asking for a tool like this for a long time, and I had no idea of how to meet their requirement.

I am deploying it today, and early feedback says that this will be a very valuable tool for us.

Thank you for sharing your knowledge, and for helping me to solve a very real problem in an elegant fashion.

John.
Reply With Quote
  #6  
Old 7th October 2004, 15:12
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 566
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Thumbs up

Hello Philippe,

respect for this nice and very useful code!

Thanks for your posting,
Juergen
Reply With Quote
  #7  
Old 11th October 2004, 12:03
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 566
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Hello Philippe,

do you have any idea why on our system the item descriptions will not be displayed?

I have checked it with the debugger. The field gbf_desc is filled correctly with the descriptions, but only the first 30 characters for field gbf_desc will be displayed (the description starts at position 31).

Thanks in advance,
Juergen
Reply With Quote
  #8  
Old 11th October 2004, 13:49
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Hello,

I checked my code, (i have do some update therein since the initial post) I think that the problem is is the routine init_data_gbf.

here is the correct code

retval = gbf.set.key.desc.length(60, 60)
LogExecErrorReturn(retval, "gbf.set.key.desc.length(%d, %d)",
60, 60)

Regards
Philippe Conde
Reply With Quote
  #9  
Old 11th October 2004, 14:14
Juergen's Avatar
Juergen Juergen is offline
Guru
 
Join Date: Aug 2001
Location: Germany
Posts: 566
Juergen is on a distinguished road
Baan: IVc4, ERP LN - DB: Oracle - OS: Linux, Unix
Thumbs up

problem solved!

thanks for your quick respone.
Regards,
Juergen
Reply With Quote
  #10  
Old 8th September 2006, 08:31
mr_suleyman's Avatar
mr_suleyman mr_suleyman is offline
Guru
 
Join Date: Aug 2004
Posts: 639
mr_suleyman is an unknown quantity at this point
Baan: Baan IV - DB: Oracle - OS: HP UX, IBM AIX
Hi Dear Friends,
We use Baan IV C3 and I couldn't find those include files. How can I get them ? and
Does it works for c3 version.

Thanks...
Reply With Quote
  #11  
Old 18th September 2006, 13:40
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Hello,

On my system (BIV c4) the 2 includes are also present in BIV c1, so I think that it should wotk in c3. The include files can be asked to SSA support.

Regards
Philippe
Reply With Quote
  #12  
Old 18th September 2006, 14:45
mr_suleyman's Avatar
mr_suleyman mr_suleyman is offline
Guru
 
Join Date: Aug 2004
Posts: 639
mr_suleyman is an unknown quantity at this point
Baan: Baan IV - DB: Oracle - OS: HP UX, IBM AIX
Thanks I solved the problem . Only How can I print GBF ?
Reply With Quote
  #13  
Old 18th September 2006, 16:15
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Print GBF. Good question! tggbfsrvlib doesn't include a print function. But I think that it should be possible because in the DEM they print something that like to a gbf tree.

Maybe a bic_info6.1 on all libraries in tgeis or tgbrg could give info?

Regards
Philippe
Reply With Quote
  #14  
Old 22nd September 2006, 16:20
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,639
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
otipcsprintasc

Quote:
Originally Posted by pconde
Print GBF. Good question! tggbfsrvlib doesn't include a print function. But I think that it should be possible because in the DEM they print something that like to a gbf tree.

Maybe a bic_info6.1 on all libraries in tgeis or tgbrg could give info?

Regards
Philippe
Hello,

it's posible to print the gbf tree as pure ascii tree.

Regards
__________________
//Bernd
Reply With Quote
Sponsored Links
  #15  
Old 22nd September 2006, 16:55
mr_suleyman's Avatar
mr_suleyman mr_suleyman is offline
Guru
 
Join Date: Aug 2004
Posts: 639
mr_suleyman is an unknown quantity at this point
Baan: Baan IV - DB: Oracle - OS: HP UX, IBM AIX
I couldn't find this object (Baan IV c3) . I search my sistem I got only followings files.
Quote:
$
/baan/bse/lib/printinf
/baan/bse/application/tgB40_c1/otgbrg/obrggprint
/baan/bse/application/tgB40_c1/otgbrg/obrgprint
/baan/bse/application/tgB40U_c4_stnd/otgbrg/obrggprint
/baan/bse/application/tgB40_c3/otgbrg/obrggprint
/baan/bse/application/tgB40U_c3_stnd/otgbrg/obrgprint
/baan/bse/application/tgB40U_c3_stnd/otgbrg/obrggprint
/baan/bse/application/tgB40_c4/otgbrg/obrggprint
/baan/bse/application/tgB40_c4/otgbrg/obrgprint
/baan/bse/tools/ttB40_c4/ottstp/ostpprofprint
/baan/bse/tools/ttB40_c4/ottdll/odllprintscr
/baan/bse/include6.1/bic_gprint
/baan/bse/include6.1/bic_gprinth
/baan/bse/include6.1/bic_print
/baan/bse/tools_220404/ttB40_c4/ottstp/ostpprofprint
/baan/bse/tools_220404/ttB40_c4/ottdll/odllprintscr
/baan/bse/include6.1_220404/bic_gprint
/baan/bse/include6.1_220404/bic_gprinth
/baan/bse/include6.1_220404/bic_print
That is all.
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 Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Baanboard code to display Images Belitre Tools Development 3 17th May 2004 16:19
CODE: Starting Baan browser from VB steveauckly Code & Utilities 4 27th September 2003 08:48
HP Unix help plse pjohns Operating Systems & Databases 3 16th May 2003 15:10
NEW: vbcode CODE extensions patvdv About Baanboard.com 3 13th March 2003 11:19
How to print from within BaanERP 5.0c display browser ? dbclark79 Tools Development 0 16th July 2002 15:43


All times are GMT +2. The time now is 11:29.


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