📄 ch06.htm
字号:
<LI>The size category determines the size of the initial extent
and next extents, as well as the number of possible next extents.
Choosing too low a number will cause one or more additional extents
to be allocated. A table that spans multiple extents decreases
system performance, increases database maintenance, and lowers
system availability, again because the database is usually taken
offline for reorganizations.
<LI>Buffering increases system performance by caching data locally
on the application server. When done properly, fewer database
accesses are required because the data that is most often read
is stored in RAM on the application server. Good candidates for
buffering are tables that are seldom updated and often read.
<LI>Activating the automatic logging feature on a table will cause
a change document to be created each time the table is changed.
This feature slows table updates, and so is only used for tables
containing critical data. For non-critical tables, change document
objects should be used.
</UL>
<H2><A NAME="RevisedandActiveVersions"><FONT SIZE=5 COLOR=#FF0000>
Revised and Active Versions</FONT></A></H2>
<P>
<IMG SRC="../button/newterm.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/newterm.gif">
<P>
Two versions of a table can exist (or any DDIC object): the <I>Revised
version</I> and the <I>Active version</I>. If you change a table
and press the Save button without pressing Activate, you have
created a Revised version of the table that contains your changes.
The Active version still exists; it is the last version that was
activated. ABAP/4 programs only use Active versions. The presence
of Revised versions does not affect them.
<P>
The Revised version exists to enable you to prepare a change before
it is needed and then activate it when it is required. It also
enables you to change many objects and then activate them all
simultaneously. When you activate them, the currently Active versions
are discarded and your Revised versions become active and replace
them.
<P>
The Revised version is displayed, if it exists, when you display
a table (the Status field will contain <TT>Revised)</TT>. The
Application toolbar will have an Active Version button (see Figure
6.5). If you press it, the Active version will be displayed and
the button on the toolbar will change to Revised Version, enabling
you to press the button again and return to the previous display.
<P>
<A HREF="javascript:popUp('f6-5.gif')"><B>Figure 6.5 :</B> <I>When a table that has a Revised version
is displayed, you see the Revised version by default</I>.</A><BR>
<P>
<IMG SRC="../button/screencam.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Compare Revised and Active Versions"
now.
<P>
To compare the Revised and Active versions:
<OL>
<LI>From the Dictionary: Table/Structure: Display Fields screen,
choose the menu path Utilities->Version management. The Versions
of Object screen is displayed. The first line contains the word
<TT>mod.</TT>. This is the Revised version. The next line contains
<TT>act.</TT>. This is the Active version.
<LI>To compare the two versions, tickmark them both and press
the Compare pushbutton. The Version Comparison for Tables screen
is displayed. The changed lines are indicated in the right margin.
<TT><- only activ</TT> means that line only exists in the Active
version. <TT><- only modif</TT> means that line only exists
in the Revised version.
<LI>To see a summary of changes, press the Delta display button
on the Application toolbar. The list is updated to contain only
the differences between the two versions.
</OL>
<H3><A NAME="AdditionalVersions">
Additional Versions</A></H3>
<P>
Aside from the Active and Revised versions, you can also create
temporary versions <BR>
of a table. To do this, choose the menu path Table->Generate
version. The message <TT>Temporary version of active object stored.</TT>
appears at the bottom of the window. This temporary version is
kept until the table is transported into production To view the
new version, choose the menu path Utilities->Version Management.
The version with the highest number is the one you just created.
<H3><A NAME="DiscardingaRevisedVersion">
Discarding a Revised Version</A></H3>
<P>
To discard a Revised version without activating it, you must first
generate a temporary version from the Active version and then
restore it, as shown in the following procedure.
<P>
<IMG SRC="../button/screencam.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Discard a Revised Version"
now.
<P>
To discard a Revised version and restore the Active version:
<OL>
<LI>From the Dictionary: Table/Structure: Change Fields screen,
choose the menu path Table->Generate Version. A dialog box
appears containing the message <TT>Version of >> active
<< object stored</TT>.
<LI>Press the Continue button. You are returned to the Dictionary:
Table/Structure: Change Fields screen, and the message <TT>Temporary
version of activate object stored</TT> is displayed at the bottom
of the window.
<LI>Choose the menu path Utilities->Version management. The
Versions Of Object screen is displayed. There will be a tickmark
beside the word <TT>act.</TT>.
<LI>Remove the tickmark beside the word <TT>act.</TT>.
<LI>Place a tickmark beneath the Version(s) In The Version Database:
line beside the highest version number.
<LI>Press the Retrieve button on the Application toolbar. A dialog
box appears containing the message <TT>Version nnnnn is now new
revised (non-active) version. Proceed?</TT>.
<LI>Press the Yes button. You are returned to the Versions Of
Object screen, and the message <TT>Restored version must be activated!</TT>
appears at the bottom of the window. There will be a tickmark
beside the word <TT>act.</TT>. The Revised version is now the
same as the Active button.
<LI>To verify that the Revised version matches the Active version,
place a tickmark beside the word <TT>mod.</TT>. Both the <TT>act.</TT>
and <TT>mod.</TT> lines should now be tickmarked.
<LI>Press the Compare button on the Application toolbar. The Version
Comparison For Tables screen is displayed.
<LI>Press the Delta Display button on the Application toolbar.
The list should contain a line reading <TT>General attributes:
Unchanged</TT> and another line that reads <TT>Fields: Unchanged</TT>.
You have now confirmed that the Active and Revised versions match.
<LI>Press the Back button on the Standard toolbar. You are returned
to the Versions of Object screen.
<LI>Press the Back button on the Standard toolbar. You are returned
to the Dictionary: Table/Structure: Change Fields screen.
<LI>Press the Activate button on the Application toolbar. The
Status field contains <TT>Act.</TT> and the message <TT>xxxxx
was activated</TT> appears at the bottom of the window.
</OL>
<P>
All DDIC objects, such as domains and data elements, have Revised
and Active versions. They can all be displayed and compared the
same way. Objects can use only Active versions. For example, if
you modify a domain and create a Revised version, data elements
using it continue to use the Active version until you activate
the domain.
<H2><A NAME="UsingtheDatabaseUtility"><FONT SIZE=5 COLOR=#FF0000>
Using the Database Utility</FONT></A></H2>
<P>
<IMG SRC="../button/newterm.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/newterm.gif">
<P>
Within the DDIC lies a <I>database utility</I> tool. Using it,
you can examine and modify tables at the database level.
<P>
<IMG SRC="../button/screencam.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Access the Database Utility"
now.
<P>
To access the database utility:
<OL>
<LI>Begin at the Dictionary: Initial Screen.
<LI>Enter a table name in the Object Name field.
<LI>Press the Display pushbutton.
<LI>Select the menu path Utilities->Database Utility. The ABAP/4
Dictionary: Utility for Database Tables screen is displayed, as
shown in Figure 6.6.
</OL>
<P>
<A HREF="javascript:popUp('f6-6.gif')"><B>Figure 6.6 :</B> <I>Using the ABAP/4 Dictionary: Utility for
Database Tables screen, you can communicate directly with the
database to display or change a table</I>.</A>
<P>
From here you can:
<UL>
<LI>Check the consistency of the R/3 DDIC definitions against
the database.
<LI>View the activation log to see the actual SQL statements sent
to the database.
<LI>Display and modify database storage parameters.
<LI>Delete a table by dropping it in the database, or empty it
by dropping and re-creating it in the database.
</UL>
<H3><A NAME="ConsistencyChecks">
Consistency Checks</A></H3>
<P>
The definition of a transparent table exists in two places: the
R/3 data dictionary and the database. To check for consistency
between the two, from within the database utility choose the menu
path Extras->Database Object->Check. The Active version
of the table is compared to the database table. The Table xxxxx:
Check Database Object screen will be displayed, and a message
at the top of the list will indicate whether the database object
is consistent (see Figure 6.7).
<P>
<A HREF="javascript:popUp('f6-7.gif')"><B>Figure 6.7 :</B> <I>A consistency check against the database
confirms that the R/3 DDIC definition of table ztxlfa1 and the
database definition are identical</I>.</A>
<P>
Inconsistencies can arise if:
<UL>
<LI>The definition of the table was altered at the database level.
This can happen if someone manually alters the database definition,
or if an ABAP/4 program alters it using native SQL.
<LI>The database becomes corrupt.
</UL>
<P>
You might do a consistency check if, when testing a program, you
get an unusual SQL error, or if you get incorrect results from
code that should work fine but inexplicably does not. Finding
an inconsistency indicates that the source of the problem might
lie outside of your program.
<P>
<IMG SRC="../button/newterm.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/newterm.gif">
<P>
An R/3 table is in some ways like a traditional program. It exists
in two forms: the "source" that you can display and
modify, and the <I>compiled</I> form that is used at runtime,
called the <I>runtime object</I>. The runtime object is created
when you activate the table, and is also known as the <I>nametab.</I>
<P>
When a consistency check is performed, the nametab is compared
against the database.
<P>
You can display the nametab from the database utility by choosing
the menu path Extras->Runtime object->Display. The Object
xxxxx: Display Active Runtime Object screen is displayed (see
Figure 6.8). At the top is the time stamp of the nametab followed
by the header information. It contains the table type (<TT>T</TT>
for transparent), the table form in the database (again, <TT>T</TT>
for transparent), the number of fields in the table, the length
in bytes of the record, the number of key fields, the length of
the key fields in bytes, buffering information, and more. (For
detailed information on the header fields and their values, display
the structure <TT>X030L</TT>.) Below the header is a list of the
fields, their position in the table, the data type, length, number
of decimal places, offset from the beginning of the record, external
length the reference table, the check table, and more. The technical
attributes of the table are completely described by the nametab.
<P>
<A HREF="javascript:popUp('f6-8.gif')"><B>Figure 6.8 :</B> <I>The nametab is the runtime object for a
table. It contains all the table's technical characteristics such
as field names, data types, and lengths</I>.</A>
<H4>Role of the Nametab in ABAP/4 Programs</H4>
<P>
As you learned on Day 2, when you create an ABAP/4 program that
selects data from a table, you must code a <TT>tables</TT> statement.
The <TT>tables</TT> statement makes the structure of the table
known to the program. However, when you generate the runtime object
for the program, the definition of the table is not embedded into
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -