Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
50%
Handover everything to System Integrator from drawing BP till implementation of ERP
20%
Hire more inhouse skilled & capable IT Resource to work directly with SI
30%
Rely on SI Architects/Consultants
0%
Total votes: 10

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 12th January 2021, 14:00
RobertP RobertP is offline
Member
 
Join Date: Mar 2003
Location: South Africa Cyprus Canada
Posts: 60
RobertP is on a distinguished road
Baan: 4 or 5 - DB: Oracle - OS: Unix
Identify VRC of current table (converted to RDD)
Baan: Other/Unknown
C/S: None/Unknown

Hello gurus,

I'd like to know whether a predefined function exists which, simply, would return the VRC of the current active table definition.

For example:
- a company has 20 package comb. and many VRCs.
- a table "x" is present in many levels.

I don't want to evaluate each level via derivation structure. Surely Baan/Infor LN doesn't do this every time a table is accessed?

So, in a perfect world, a predefined function might exist which returns VRC of the current / active table. Alternatively, could it be that the current/active table's VRC (CRDD) is declared in some tools table (e.g. Runtime Components)? Any ideas?
__________________
Better to die on your feet than live on your knees
Reply With Quote
Sponsored Links
  #2  
Old 12th January 2021, 15:13
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 462
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi,

I don't know of any functions but I think the standard program "Print Current Table Definitions for Package VRC (ttadv4421m000)" does give you exactly the information you need. That is the actual Table defintion VRC for your Customer-VRC.

Here for exampla I see that the Table definition for tdpur100 for my customer VRC 106C_0_dev1 comes from the standard VRC 106U_0_a000
Attached Images
File Type: jpg ttadv4421m000.JPG (76.2 KB, 2 views)
__________________
May the force be with you!
Reply With Quote
  #3  
Old 12th January 2021, 15:14
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,542
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Check out the ottdllvrcsearch library. I pulled out so really really old code that was never used.
Code:
        #pragma used dll ottdllvrcsearch		| Search VRC Structure

| Get starting VRC for each table. Using users current package/vrc.
		get_current_pvrc()
		
| Search VRC will return true when the curr fields point to the lastest
| VRC for the table.
		rc = 0
		while rc = 0 and strip$(curr.tver(1,1)) <> ""
			rc = vrc_search_table(ttadv422.cpac,ttadv422.cmod,ttadv422.flno,
				tdep,curr.tver,curr.trel,curr.tcus)
			if rc = 0 then
				get_parent_pvrc()
			endif
		endwhile

|******************************************************************************
| Used to get the users current VRC.  You always want to start in that VRC.
|******************************************************************************
function get_current_pvrc()
{
	select	ttadv040.*
	from	ttadv040
	where	ttadv040.user = :logname$
	and	ttadv040._compnr = 0
	as set with 1 rows
	selectdo
	endselect
	curr.tver(1,1) = ttadv040.vers
	curr.trel(1,1) = ttadv040.rele
	curr.tcus(1,1) = ttadv040.cust
}

|******************************************************************************
| Used to get the "derived from" VRC for a given VRC.
|******************************************************************************
function get_parent_pvrc()
{
	domain	ttadv.vers	tver
	domain	ttadv.rele	trel
	domain	ttadv.cust	tcus

	tver = curr.tver(1,1)
	trel = curr.trel(1,1)
	tcus = curr.tcus(1,1)

	select	ttadv111.*
	from	ttadv111
	where	ttadv111._index1 = {:ttadv422.cpac,:tver,:trel,:tcus}
	and	ttadv111._compnr = 0
	as set with 1 rows
	selectdo
		curr.tver(1,1) = ttadv111.vedf
		curr.trel(1,1) = ttadv111.redf
		curr.tcus(1,1) = ttadv111.cudf
	selectempty   
		curr.tver(1,1) = ""
	endselect
}
__________________
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
  #4  
Old 12th January 2021, 16:05
RobertP RobertP is offline
Member
 
Join Date: Mar 2003
Location: South Africa Cyprus Canada
Posts: 60
RobertP is on a distinguished road
Baan: 4 or 5 - DB: Oracle - OS: Unix
Thanks Mark and Vahdani,

Mark - vrc_search_table requires traversing the derivation structure - in order to finally find the correct (and current) tabeldef's VRC where I can then analyze the components) . In my case these are many. To many in the structure. All I want is the current, active table definition being used by the system (on which data is present in the database. How could this be achieved? I had in mind the exchange package. It generates asci file formats - based on current table def. Any idea which function is called?
__________________
Better to die on your feet than live on your knees
Reply With Quote
  #5  
Old 12th January 2021, 20:42
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,542
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I am not sure what exchange or anything else uses. There could be another library in LN (or even 4c4) for that matter that would return the VRC. There were 3 or 4 VRC dll's but I did not see anything that would work.

What I do know is that in 4c4 there is a data dictionary directory for the VRC the company is in. This is built based off all the tables no matter which VRC is the home VRC for that table. I am not sure it is in any table in the system that says - hey here is the current VRC the table is in that this VRC uses. I know I could read the dictionary file out on the file system to see what makes up the table. I can't imagine even with 20 VRC's it would like long to walk up the structure. Actually with my code what I did not was eventually write the table name and VRC it was found in into a table. I never found a use for it after that one flirt with VRCs and the tables.
__________________
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
  #6  
Old 12th January 2021, 21:44
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,125
NPRao will become famous soon enough
Baan: Baan 4-5,5.2(Reger),LN-6.1,Infor LN-10.x - DB: Oracle,MS-SQL - OS: HPUX, Linux, Windows
Quote:
Mark - vrc_search_table requires traversing the derivation structure - in order to finally find the correct (and current) tabeldef's VRC where I can then analyze the components) . In my case these are many. To many in the structure. All I want is the current, active table definition being used by the system (on which data is present in the database. How could this be achieved? I had in mind the exchange package. It generates asci file formats - based on current table def. Any idea which function is called?
1 - You have to analyze why do you need 20 levels of VRC, Package Combination, it is an overhead in process, disk, execution time, confusion in understanding the derivation structure etc.
2 - The current versions of domains, tables are taken from the user's package combination setting, and you can refer to the dictionary of the tables from the $BSE/dict/dd<package-combination>/d<package><module> directory and the files d<tablename> have the table definition.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 2 (0 members and 2 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
Editable additional field? alex.bonutti Tools Development 1 22nd May 2017 14:04
good/bad idea: keep new table fields out of derived VRC? RieseUSA Tools Development 7 30th July 2008 19:25
copy records c_siek Tools Development 9 18th June 2004 16:43
How to delete child table if the parent table has only 1 index with 3 fields? juhiasg Tools Development 4 12th February 2004 05:51


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


©2001-2020 - Baanboard.com - Baanforums.com