Thursday 25 April 2013

Database Utility


Introduction:
The database utility is a tool to provide the interface between the ABAP Dictionary and the underlying database management system (DBMS).  
Uses:
a)     Convert Data (I.e. change field lengths  and data types etc)
b)    Activate Objects
c)     Create/Delete/Change of tables and indexes
Approach:
Go to Transaction SE14
The Initial screen of database utility is displayed. Enter Name of either table/view/Match code/Pool/Cluster tables
I given table name as “ZDATA_UTL”
Choose Edit button or Enter Key.
Next screen will be displayed as below.
Indexes: It will display the list of indexes that are created for this table
Processing Type:
The DB Utility can be run either online or in the background.
A)    Direct:  the create/delete/modify operations of the object will be performed in foreground.
B)    Background:  the create/delete/modify operations of the object will be performed in background
C)    Enter for Mass processing:
If you want to modify large no of objects, choose this option.
If you run DB Utility, a log file gets created which contains information on whether or not the conversion was successful and the point of failure during the conversion if it was not successful. 
To check the log click on  in the application toolbar
For Example,
Step 1:
I created table “ZDATA_UTL” with four fields as specified below and activated the table.
Step 2:
After activation, I changed the key field of VBTYP to non-key field and trying to activate the table.
Then I got error message as below.
To avoid such kind of errors, go to SE14 (database utility) and enter the table name “ZDATA_UTL”.
Choose “Edit” button or Enter Key
In the next screen choose  for making adjustments to the table (i.e. adding fields/deleting fields/change the key fields).
If some kind of conversion errors (i.e. Character to Number, Currency ) will also deal with database utility
Step 3:
Popup will be displayed for confirmation on adjustment of table
Choose “Yes”.
Then a message will be displayed as 
Step 4:
Check the log by clicking on  in application tool bar of the database utility screen.
Note:
If you made changes to the dictionary object, then the underlying database is activated. Usually it works behind the scenes, but occasionally the database utility will prompt you for information.  This occurs when an error is encountered or when existing data must be converted.

No comments:

Post a Comment