📄 ch03.htm
字号:
</TD><TD WIDTH=288>Integer values </TD></TR>
<TR VALIGN=TOP><TD WIDTH=144><TT>NUMC</TT></TD><TD WIDTH=288>Character field that can contain only numerics
</TD></TR>
</TABLE>
</CENTER>
<P>
<CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
You should always press the Enter key after you fill in the data type field. Pressing Enter causes the screen to change based on the data type you specified. If the data type is a signed numeric type, a Sign check box will appear. For fields that allow decimals, a Decimal Places field will appear. For character fields, a Lowercase Letters check box will appear.</BLOCKQUOTE>
</TD></TR>
</TABLE>
</CENTER>
<P>
<H4>Output Length, Decimal Places, and Lowercase Letters Fields
</H4>
<P>
The Output Length field indicates the number of bytes needed to
output the field to a list or a screen, including commas, decimal
point, sign, and any other formatting characters. For example,
on output, date and time fields are automatically formatted with
separators. Internally, a date is stored as eight characters (always
<TT>YYYYMMDD</TT>), but the output length in the domain should
be specified as 10 to enable two separators to be inserted. If
the Output Length field is left blank, its value is automatically
calculated by the system when you press Enter.
<P>
For decimal fields, you can specify the number of decimal places
in the Decimal Places field.
<P>
Character fields are usually converted to uppercase before they
are stored in the database. You can turn this conversion off by
tickmarking the Lowercase Letters check box.
<P>
Most developers do not have problems understanding the internal
representation of character or integer fields. However, the location
of the decimal point in decimal fields is often a point of confusion,
so it is described here.
<P>
For type <TT>DEC</TT> fields, the decimal point is not stored
in the database. Only the numeric portion is stored, not the decimal.
On output, the position of the decimal is determined by the value
you put in the Decimal Places field of the domain.
<P>
In order for the field to be properly displayed, you must specify
an output length that includes one byte for the decimal point
and one byte for each thousands separator that can be displayed.
However, the system will calculate the output length for you if
you simply blank out the Output Length field and press Enter.
<H4>Creating a Domain</H4>
<P>
In this section, you will learn the bottom-up approach to creating
a domain.
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Create a Domain" now.
<P>
Perform this procedure twice to create the -<TT>lifnr</TT>
and -<TT>name1</TT> domains. Help
with common problems is given in the Troubleshooter that follows
it. If you have trouble with any one of the steps, don't forget
to consult the Troubleshooter.
<OL>
<LI>Begin at the Dictionary: Initial Screen. (To get there from
the SAP main menu, choose the menu path Tools->ABAP/4 Workbench,
Development->ABAP/4 Dictionary.)
<LI>Enter the domain name in the Object Name field.
<LI>Choose the Domains radio button.
<LI>Press the Create pushbutton. You then see the Dictionary:
Maintain Domain screen. The fields containing question marks are
required fields.
<LI>Type a description of the domain in the Short Text field.
<LI>Fill in the Data Type field. You can put your cursor in this
field and press the down arrow to display a list of allowed data
types. Pick one from the list or type one in.
<LI>Enter a field length.
<LI>Press the Activate button on the Application toolbar to both
save and activate the domain. The Create Object Catalog Entry
screen is displayed.
<LI>Press the Local Object button. You are returned to the Dictionary:
Maintain Domain screen.
<LI>Press the Back button on the Standard toolbar. This returns
you to where you began this procedure, the Dictionary: Initial
Screen.
</OL>
<P>
<CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1>
<TR VALIGN=TOP><TD WIDTH=150><CENTER><B>Trouble</B></CENTER></TD><TD WIDTH=213><CENTER><B>Possible Symptoms</B></CENTER>
</TD><TD WIDTH=213><CENTER><B>Solution</B></CENTER></TD></TR>
<TR VALIGN=TOP><TD WIDTH=150>Can't create domain</TD><TD WIDTH=213>When you press the Create button, nothing happens.
</TD><TD WIDTH=213>Look at the status bar in the bottom of the window and press the button again. It is likely that you will see a message there.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=150> </TD><TD WIDTH=213>When you press the Create button, you see the message "System change option does not allow changes to SAP objects."
</TD><TD WIDTH=213>Change the domain name to start with y or z.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=150> </TD><TD WIDTH=213>When you press the Create button, you see the message "Enter access key."
</TD><TD WIDTH=213>Change the domain name to start with y or z.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=150> </TD><TD WIDTH=213>When you press the Create button, you see the message "You are not authorized to make changes."
</TD><TD WIDTH=213>Request development authorization from your security administrator.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=150> </TD><TD WIDTH=213>When you press the Create button, you see the message "already exists."
</TD><TD WIDTH=213>The name you entered already exists in the Data Dictionary. Choose a different domain name.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=150>Getting message</TD><TD WIDTH=213>"W: (calculated output length is smaller than specified)."
</TD><TD WIDTH=213>Blank out the Output Length field and press Enter and then Activate.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=150> </TD><TD WIDTH=213>"E: Value table does not exist."
</TD><TD WIDTH=213>Blank out the Value Table field and press Enter and then activate.
</TD></TR>
</TABLE>
</CENTER>
<P>
<H4>Obtaining SAP Documentation on Domains</H4>
<P>
There are many places to obtain SAP documentation on the features
of domains.
<P>
If you wish to see documentation describing all data types and
their uses, put your cursor on the Data Type field and press F1.
You will see a dialog box containing highlighted fields. Click
on these highlighted fields for more details.
<P>
You can also consult the R/3 library help for additional documentation
on data types and other properties of the domain. To view this
documentation, from any screen choose the menu path Help->R/3
Library. You will see the main menu of the R/3 library. From there,
click on the following tabs: Basis Components->ABAP/4 Development
Workbench->ABAP/4 Dictionary->New Developments In The ABAP/4
Dictionary In Release 3.0.
<P>
For still more documentation on the data types in the domain,
from within the domain choose the menu path Help->Extended
help. Then click on Creating Domains, and then click on External
Data Type.
<P>
To obtain documentation that describes the mapping of domain data
types to ABAP/4 data types, display F1 help for the "tables"
keyword. (To do so, within the ABAP/4 editor, put your cursor
on the word <TT>tables</TT> and press F1.)
<H3><A NAME="DiscoveringDataElements">
Discovering Data Elements</A></H3>
<P>
Before actually creating a data element, I will describe the screen
you will use to create it.
<P>
Figure 3.8 shows the screen used to create a data element. Here
you specify the short text, domain name, labels, and a header,
which are explained in the following sections. Documentation can
also be created after the data element has been saved.
<P>
<A HREF="javascript:popUp('f3-8.gif')"><B>Figure 3.8 : </B><I>The Dictionary: Change Data Element screen</I>.</A>
<H4>Short Text Field</H4>
<P>
The Short Text field describes a business context for a domain.
For example, a "customer telephone number" is a specific
business context for a "generic telephone number" domain,
so it would be an appropriate description for a data element.
The end user will see this description if they request F1 help
for a field that was created using this data element.
<H4>Field Label and Header Fields</H4>
<P>
At the bottom of the screen shown in Figure 3.8 are four text
fields. The first three are field labels. When any field appears
on a screen (such as an input field on an input screen), one of
the short, medium, or long fields will appear to the left of it
as a field label. The programmer chooses one of these field labels
when he creates a screen. The contents of the Header field will
appear as a column header at the top of lists.
<P>
If the fields that you create with this data element will not
appear on any screens, uncheck the Maintain Field Labels check
box and press the Enter key. You will no longer see the Field
Label and Header fields. You will have to press Enter twice to
cause the fields to disappear if these fields contain values.
<H4>Data Element Documentation</H4>
<P>
After you save the data element, a Documentation button appears
on the Application toolbar so that you can store free-form text.
The user sees this text when he requests F1 help. In other words,
when a table field that uses this data element is displayed on
a screen, the user can place his cursor into that field and press
F1 to display the documentation you entered here.
<P>
When you see the Documentation screen, the first line will contain
the characters <TT>&DEFINITION&</TT>. This is a heading;
do not change this line. Type your documentation beginning on
line two.<P>
<CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
Data element documentation is often very useful to the programmer. By reading this F1 help, the programmer can determine the business usage of the data. Therefore, you should always create F1 help for the user via the Documentation button.</BLOCKQUOTE>
</TD></TR>
</TABLE>
</CENTER>
<P>
<H4>Creating a Data Element</H4>
<P>
In this section, you learn the bottom-up approach to creating
a data element.
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Create a Data Element" now.
<P>
Perform this procedure twice to create the -<TT>lifnr</TT>
and -<TT>name1</TT> data elements.
Help with common problems is given in the Troubleshooter that
follows it. If you have trouble with any one of the steps, don't
forget to consult the Troubleshooter.
<OL>
<LI>Begin at the Dictionary: Initial Screen. (To get there from
the SAP main menu, follow the menu path Tools->ABAP/4 Workbench,
Development->ABAP/4 Dictionary.)
<LI>Type the data element name in the Object Name field.
<LI>Choose the Data Elements radio button.
<LI>Press the Create button. The Dictionary: Change Data Element
screen appears.
<LI>Type short text for the data element.
<LI>Type a domain name and press the Enter key. If the domain
exists and is active, its data type and length will appear. If
you don't see a data type and length after pressing Enter, verify
the name of the Data Element. If the name is correct, verify that
it is active by opening a new session (use menu path System->Create
Session) and displaying it in the Data Dictionary.
<LI>Enter field labels in the Field Label Short, Medium, Long,
and Header fields. The value in the Short field should be a maximum
of 10 characters, Medium should be a maximum of 15, and Long should
be a maximum of 20. The value in the Header field should be the
same length or shorter than the output length in the domain.
<LI>Press the Save button on the Standard toolbar. The Create
Object Catalog Entry screen is displayed.
<LI>Press the Local Object button. You are returned to the Dictionary:
Change Data Element screen. The Status fields contain the values
<TT>New</TT> and <TT>Saved</TT> and the message "Saved without
check" appears at the bottom of the window in the status
bar. The Documentation button (among others) appears on the Application
toolbar.
<LI>Press the Documentation button. The Change Data Element: Language
E screen is displayed. Here you can type end user documentation.
This documentation is displayed when the user requests F1 help
for fields created using this data element. The first line contains
the characters <TT>&DEFINITION&</TT>. This is a heading;
do not change this line. Type your documentation beginning on
line two. Press the Enter key to begin each new paragraph.
<LI>Press the Save Active button on the Application toolbar to
save your text. The message "Document was saved in active
status" appears in the status bar.
<LI>Press the Back button on the Standard toolbar. You are returned
to the Dictionary: Change Data Element screen.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -