📄 ch02.htm
字号:
<BR>
<H4>Exploring the Standard Toolbar</H4>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "Exploring the Standard Toolbar"
now.
<P>
The Standard toolbar controls are shown in Figure 2.5.
<P>
<A HREF="javascript:popUp('f2-5.gif')"><B>Figure 2.5.</B><I>These are the controls on the Standard tool-bar within the ABAP/4 editor</I>.</A>
<P>
The Standard toolbar controls (refer to Figure 2.3), in order,
are:
<UL>
<LI>Enter: Pressing the Enter button has the same effect as pressing
the Enter key. It is also the split line function. To split a
line of code, position the cursor at the point where you want
to split the line and press Enter.
<LI>Command Field: This accepts transaction codes and various
other commands.
<LI>Back and Exit: Both return you to the ABAP/4 Editor: Initial
Screen. If you have unsaved changes, you will be prompted to save
them.
<LI>Cancel: Returns you to the ABAP/4 Editor: Initial Screen without
saving your changes. If you have unsaved changes, you will be
prompted to save them.
<LI>Print: This will print the source code of your program. When
you press it, the Print Parameters screen is displayed. To receive
your output, be sure that the Print Immed. check box is checked.
<LI>Find: Provides search and replace functionality. When you
press it, the Search/Replace screen is shown. A more detailed
explanation follows below.
<LI>Find Next: This is a handy shortcut for finding the next occurrence
of a string.
<LI>First Page, Previous Page, Next Page, and Last Page: These
enable you to page up and down through the source code.
<LI>Help: Displays a dialog box from which you can obtain help
about the editor and ABAP/4 syntax, among other things. Position
your cursor on an ABAP/4 keyword or a blank line before pressing
the Help button. For more information, see the section titled
"Getting Help" later in this chapter.
</UL>
<P>
<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=288><CENTER><B>DO</B></CENTER></TD><TD WIDTH=288><CENTER><B>DON'T</B></CENTER>
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>DO save your program before entering a /n command in the command field. Otherwise, you will lose your changes.
</TD><TD WIDTH=288>DON'T close the editor window by pressing the X button in the top right-hand corner of the window. You will lose unsaved changes.
</TD></TR>
</TABLE>
</CENTER>
<P>
<H4>Using Find and Replace</H4>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "Using Find and Replace" now.
<P>
Press the Find button on the Standard toolbar and the system will
display the Search/Replace screen (see Figure 2.6). Enter the
string you want to find into the Find field.
<P>
<A HREF="javascript:popUp('f2-6.gif')"><B>Figure 2.6.</B><I>This is the Search/Replace screen. It enables you to find and change character strings in your program</I>.</A>
<P>
There are several options on this screen to control the find process:
<UL>
<LI>As a String will cause your string to be found anywhere in
the program.
<LI>As a Word will find it only if blanks or punctuation surround
it on either side within the source code.
<LI>Upper/Lower Case will make the search case-sensitive.
</UL>
<P>
The Find field has some unusual qualities:
<UL>
<LI>To search for a string that contains embedded blanks, simply
type the string along with the blanks into the Find field. Do
not enclose the string in quotes. If you do, the quotes will be
considered part of the search string.
<LI>To perform a wildcard search, use the characters <TT><B>+</B></TT>
and <TT>*</TT>. <TT><B>+</B></TT>
will match any single character, and <TT>*</TT> will match any
string of characters. However, <TT>*</TT> can only be used as
a wildcard at the beginning or end of a string; within the body
of a string it does not act as a wild card. For example, the search
string <TT>wo+d</TT> will find <TT>word</TT> or <TT>wood</TT>;
the string <TT>j++n</TT> will match <TT>john</TT> or <TT>joan</TT>,
but not <TT>jan</TT>. <TT>*an</TT> will find <TT>ian</TT>, <TT>joan</TT>,
or even <TT>an</TT>. Since <TT>*</TT> embedded within a string
doesn't act as a wildcard, to find the string <TT>select * from</TT>,
type exactly <TT>select * from</TT>. Notice that a string having
<TT>*</TT> at the beginning or end produces the same results as
the same string without the <TT>*</TT>; the <TT>*</TT> wildcard
therefore is not particularly useful.
<LI><TT>-</TT><B> </B><TT>.</TT><B> </B><TT>,</TT><B> </B><TT>:</TT><B>
</B><TT>;</TT> are special characters. If your string <I>starts</I>
with any of these characters, you must enclose it within delimiters.
You can choose any of these same characters for a delimiter as
long as it does not appear within your search string. For example,
<TT>:hh</TT> begins with a special character. To find this string,
enter <TT>-:hh-</TT> or <TT>.:hh.</TT> or <TT>,:hh,</TT> or <TT>;:hh;</TT>.
<LI>The character <TT>#</TT> is also special. To find a string
containing <TT>#</TT> anywhere within it, you must substitute
<TT>##</TT> for each <TT>#</TT> that occurs in the string. For
example, to find the string <TT>a#b</TT>, use the search string
<TT>a##b</TT>.
</UL>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "Setting the Scope of a Search or Replace
Function" now.
<P>
To set the scope for a search or replace function, follow these
steps:
<OL>
<LI>On the Search/Replace screen, type the string you want to
find in the Find field.
<LI>Choose the In Current Source Code radio button.
<LI>Choose the Fm Cursor radio button to begin the search at the
current cursor location. Alternatively, you can choose the From
Line radio button and enter starting and ending line numbers for
the search.
<LI>Press the Continue button. The cursor is placed to the left
of the first matching string.
<LI>Press the Find next button to locate the next matching string.
</OL>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Find All Occurrences of a String"
now.
<P>
To find all occurrences of a string:
<OL>
<LI>On the Search/Replace screen, type the string you want to
find in the Find field.
<LI>Choose the In Program radio button.
<LI>Press the Continue button. A summary of the occurrences found
is displayed on the Global Search In Programs screen.
<LI>Double-click on a line to see it in the context of the source
code.
<LI>Press the Back button to return to the Global Search In Programs
screen.
<LI>Press the Back button once more to return to the source code
editor.
</OL>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Search and Replace in the Source
Code" now.
<P>
To search and replace in the source code:
<OL>
<LI>On the Search/Replace screen, type the string you want to
find in the Find field.
<LI>Tickmark Replace By and enter a replacement string in the
Replace by field.
<LI>Press the Continue button. The ABAP/4 Editor: Edit Program
screen is displayed with the cursor positioned to the left of
the next matching string.
<LI>To replace it, press the Replace button. The string at the
cursor location is replaced and the cursor is positioned at the
next matching string.
<LI>To go to the next position without replacing, press the Next
Hit button. The cursor is positioned at the next matching string.
<LI>To replace all remaining matches from the current cursor position
to the end of the source code, press the No Confirmation button.
</OL>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "How to Search and Replace Via a Summary
Screen" now.
<P>
To search and replace via a summary screen:
<OL>
<LI>On the Search/Replace screen, type the string you want to
find in the Find field.
<LI>Tickmark Replace By and enter a replacement string in the
Replace by field.
<LI>Choose the In Program radio button.
<LI>Press the Continue button. The Global Replace In Programs
screen is displayed with the cursor positioned on the first matching
string. All lines containing matching strings are displayed and
the matching strings are highlighted.
<LI>To replace the string at the cursor position, press the Replace
button. The string at the cursor location is replaced and the
cursor is positioned at the next matching string.
<LI>To go to the next position without replacing, press the Next
Hit button. The cursor is positioned at the next matching string.
<LI>To replace all remaining matches from the current cursor position
to the end of the source code, press the No Confirmation button.
</OL>
<P>
If you replaced any strings, you must save your changes before
returning to the source code editor. To do so, press the Save
button in the Standard toolbar, and then press the Back button.
If you want to cancel your changes, press the Cancel button instead
of the Save button.
<H4>Exploring the Application Toolbar</H4>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "Exploring the Application Toolbar of
the ABAP/4 Editor" now.
<P>
Before proceeding, maximize your window (if it is not already).
You may not see the buttons at the far right of the Application
toolbar if your window is smaller than the maximum size.
<P>
The Application toolbar controls are shown in Figure 2.7.
<P>
<A HREF="javascript:popUp('f2-7.gif')"><B>Figure 2.7.</B><I>The Application toolbar controls</I>.</A>
<P>
The Application toolbar controls, in the order they appear on
the toolbar, are as follows:
<UL>
<LI>Display <-> Change: Changes the screen from display
mode to change mode. Press it again to change it back to display
mode.
<LI>Check: Checks the syntax of the current program.
<LI>Where-Used List: When you press this button while your cursor
is on any variable name, it will display all the lines of code
that use it.
<LI>Stack: Displays the contents of the current navigation stack.
<LI>Cut: Deletes the line containing the cursor and places it
in the buffer.
<LI>Copy To Buffer: Copies the contents of the line containing
the cursor to the buffer.
<LI>Insert From Buffer: Inserts the contents of the buffer to
a new line above the current cursor position.
<LI>Insert Line: Inserts a blank line above the current cursor
position.
<LI>Select: Selects a single line or a block of lines for moving,
cutting, and pasting. Place your cursor on the first line of the
block and press Select. Place your cursor on the last line of
the block and press Select again. The lines contained in the block
will turn red. You can now cut, copy, or duplicate the block of
code the same way you did for a single line. To deselect the selected
lines, choose the menu pathEdit->Deselect.
<LI>Undo: Reverses your last change. Only one level of undo is
available.
<LI>ABAP/4 Help: Provides help about the editor and about ABAP/4
in general.
<LI>Pattern: Enables you to insert an automatically generated
ABAP/4 statement. For example, to insert a write statement that
writes out the contents of a variable named <TT>v1</TT>, press
the Pattern button, choose the Write radio button, press the Continue
button, enter the variable name in the Fld field, and then press
the Copy button. A <TT>write</TT> statement will be inserted at
the current cursor position.
<LI>Concatenate: Joins two lines together. To use it, place your
cursor at the end of a line and press the Concatenate button to
concatenate the next one to it. To split a line, position your
cursor where you want the split to occur and press the Enter key.
<LI>Duplicate Line: Duplicates a single line or an entire block
of code if one is selected (refer to the Select button, above).
<LI>Move Line: Moves lines left and right. To move a line, put
your cursor at the target position and press the Move Line button.
To move a whole block of code, mark the block and place your cursor
on the first line of the block at the position to which it should
be moved, and then press the Move Line button. To move it to the
left, place your cursor to the left of the beginning of the line
and press the Move Line button.
<LI>Mark Line: Places a bookmark on a line. You can display all
marked lines with the menu path Goto -> Markers.
</UL>
<H4>Using Cut and Paste<BR>
</H4>
<CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -