Professional Documents
Culture Documents
BAT4 11 Manual
BAT4 11 Manual
Table of Contents
Archiving ...................................................................................................................................... 2 What is Archiving .......................................................................................................... 2 Why Archiving .............................................................................................................. 2 When to Archive ........................................................................................................... 2 Kind of data ................................................................................................................. 3 How to solve this problem? ............................................................................................. 3 Baan Archiving toolkit .................................................................................................................... 4 Parameters .................................................................................................................. 5 Procedures ................................................................................................................... 6 Procedure Parameters .................................................................................................. 11 Procedure Static Tables ................................................................................................ 12 Execute the procedure ................................................................................................. 13 Example .................................................................................................................... 14
Why Archiving In almost each ERP installation there are a lot of data that have completed their life cycle, and can be moved offline or even deleted. The archiving procedures allows to: Improve system performances Free-up online disk space Obtain better data management Delete obsolete data
When to Archive First at all, companies have to adopt an Archiving Strategy, defining what kind of data to move to an archiving company, what kind of data could be defined as not necessary anymore, and when to apply this strategy. So a period of archiving must be defined, usually could be an year (solar or financial). A basic schema could be defined as this:
In Baan, data is stored using Companies. So, there is one (or more, in case of multi-company structure) production company, and some Archiving companies have to be created. All those companies are accessible on-line for reporting data, but it is possible to store offline (on tape, CD, DVD or other external media storage) archiving companies containing data that are not necessary to consult online frequently. Copyright 2010 Robelle di Roberto Lano all rights reserved Page 2
Kind of data Basically, it is possible to define some category of data: Master data Those tables are even known as static tables because doesnt change frequently, like Master Items, Customers, Suppliers, Terms of Payment, etc. This kind of data usually is only copied in the archiving company but not removed from the original company. Dynamic data Those tables are the core of the system, they are updated constantly, like Sales Orders, Shipments, Ledger Journals, etc. This kind of data usually is moved to the archiving company and removed from the production company. Obsolete data Data that isnt anymore necessary to maintain or use (maybe they werent used at all), so they can be removed from the production company. Texts Texts are usually linked to other data, they could be copied in the archiving company or not. Usually the text arent removed from the original company by means of the archiving procedure, there is a standard Baan session that removes all unused texts. Standard Baan Archiving Baan offers a wide range of archiving sessions, but unfortunately they: Sometimes are not compliant with the business requirement for your company, by example some data has for your company a different life cycle than the standard (different concepts of obsolete data). Cannot consider the customizations, new tables could be added and linked to the standard tables and those session doesnt obviously knows the existence of them. Doesnt archive completely new, bolt-on tables.
How to solve this problem? There are basically three solutions for this problem: Customize the archiving sessions. This could be difficult or expensive to do due the lack of the sources or the cost of development resources. Dont use the archiving sessions, and develop completely new ones, maybe using different tools. This could be accomplished, but, again, the company have to spend a lot of time doing this. Use a toolkit that permits to define the archiving procedures in a simple but effective way, without to write code. This is the BAT solution way.
The Zoom button allows to access to the Procedure Steps session, the Log button to the display main log session:
If there is the detailed log activated, through the Zoom button is possible to see even the detailed log, like this:
In this example, the procedure SLSORD was run at 01/01/2010 from 00:56:36 to 00:56:37, and the record with index1 (tdsls040.orno) equal to 100345 (and all the other steps) were inserted in the archiving company without errors (result = 0).
TRUE The data is deleted from the actual company The data is moved from the actual company to the archiving company
In some cases, there is in the table a field that contains the company number, for the multicompany structure purposes. This field must be not simply copied in the archiving company but needs to be re-codified before the copy. The definition of which field is automatically taken from the parameter that defines the company domain.
There is also the need of a condition that links this table from the parent table, or, in case of the main table, the definition of how the selection of data is to be done. For the main table conditions it is possible to define and use parameters. The condition have the same syntax as for the where clause of a standard Baan query. All the possible clauses are possible, even the exists with subqueries.
In this example the way the tdcmcs050 is linked to the previous level table (the tdsls040).
In this example how the main table is selected, using the parameters 1 and 2 (see Procedure Parameters). Note that all those conditions (with the except of the main table condition, which is to be written manually), are automatically written by the Load Tables button, that deletes all the conditions but the level 0 condition, and starting from the main table loads all the steps linked, nesting them according to the data dictionary definition. In this example, all the steps and the conditions were obtained automatically by pressing the Load Tables button. However, it is always possible to change, delete, add steps and to modify the conditions.
In this case, the value 100000 and 199999 will be bind to the variables :1 and :2 in the main table selection of the tdsls040.
CHAPTER 2
Procedure Static Tables The static tables are all the tables that are referred by the procedure step tables. The static tables are only refreshed on the archiving company, never deleted from the actual company. It is possible to load automatically the static tables by pressing the Load Tables button once all the procedures steps are defined.
Static tables can have status as active or expired. Expired tables never be refreshed on the archive company.
Note that the sequence 0 (with level 0) is automatically added to the steps. Then press the Load Tables button. The result is:
The sequence 1 and level 1 is added, because the tubat210 refers to the tubat200 with tubat210.cmba field. The condition is automatically added:
The only thing to do manually is to add the selection condition for the main table. In this case, for brevity, no procedure parameter is chosen, but a simple condition:
So, the procedure is ready to be executed: Copyright 2010 Robelle di Roberto Lano all rights reserved Page 15
The procedure is run without problems, deleting all the logs that are not equal to the procedure BATDLOG. And all the procedure was written in a couple of minutes.