📄 ch02.htm
字号:
To bring a line to the top of the editor window, double-click between words or at the end of the line. Don't double-click on a word though; that won't work. An alternative method is to place your cursor at the end of a line and press the F2 key.</BLOCKQUOTE>
</TD></TR>
</TABLE>
</CENTER>
<P>
<P>
In most Windows applications, there is one Clipboard for cut and
paste operations. In R/3, there are five clipboards. Table 2.1
describes them all.
<P>
<CENTER><B>Table 2.1 Cut and Paste Buffers</B></CENTER><CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1>
<TR VALIGN=TOP><TD WIDTH=144><CENTER><B>Called</B></CENTER></TD><TD WIDTH=144><CENTER><B>Used for</B></CENTER>
</TD><TD WIDTH=144><CENTER><B>How to Copy to It</B></CENTER></TD>
<TD WIDTH=144><CENTER><B>How to Paste from It</B></CENTER></TD>
</TR>
<TR VALIGN=TOP><TD WIDTH=144>The Buffer</TD><TD WIDTH=144>Cut and paste within a program
</TD><TD WIDTH=144>Press the Cut or Copy buttons in the editor
</TD><TD WIDTH=144>Press the Insert From Buffer button</TD></TR>
<TR VALIGN=TOP><TD WIDTH=144>The X,Y,Z Buffers</TD><TD WIDTH=144>Cut and paste between two programs
</TD><TD WIDTH=144>Menu path: Block/ Buffer->Copy to X Buffer
</TD><TD WIDTH=144>Menu path: Block/Buffer->Insert X Buffer
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=144>The Clip- board</TD><TD WIDTH=144>Cut and paste between:
<BR>
- two R/3 sessions
</TD><TD WIDTH=144>Menu path: Block/Buffer-> Copy to Clipboard
</TD><TD WIDTH=144>Menu path: Block/Buffer->Insert from Clipboard to insert the Clipboard contents as new lines into the
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=144> </TD><TD WIDTH=144>- R/3 and other Windows apps (e.g. Notepad)
</TD><TD WIDTH=144> </TD><TD WIDTH=144>program at the cursor position. Or Ctrl+V to paste over top of the existing lines. With Ctrl+V, data will be truncated if it won't all fit on the current screen.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=144> </TD><TD WIDTH=144>- copy code from F1 help to the editor editor<BR>
- copy more than one line of code
</TD><TD WIDTH=144>1- Click once<BR>
2- Ctrl+Y<BR>
3- Drag and mark<BR>
4- Ctrl+C
</TD><TD WIDTH=144> </TD></TR>
</TABLE>
</CENTER>
<P>
<P>
In the first row of Table 2.2 is program-specific buffer, simply
called <I>the buffer</I>. It lets you copy within a program. To
use it, place your cursor on a line or mark a block and press
the Cut, Copy, or Insert From Buffer buttons. The buffer's contents
are lost when you leave the editor.
<P>
The X, Y, and Z buffers are used to copy code from one program
to another. Use the Block/Buffer menu to access them. Although
they are three separate buffers, they are all used in the same
way. Their contents are retained after you leave the editor, but
they are lost when you log off.
<P>
The Clipboard is the same as the Windows Clipboard. Use it to
cut and paste into other Windows applications such as MSWord or
Notepad. It is also used to copy text from F1 help screens (see
the following section titled "Getting Help").
<P>
In addition to the buttons on the Application toolbar and the
menus, you can use standard Windows functions to perform cut and
paste operations. To highlight a word or line, drag your cursor
across it, or hold down the Shift key and tap the left or right
arrow keys (you can only highlight one line at a time using this
method). To highlight multiple lines, click once on the screen
with the mouse and then press Ctrl+Y. The pointer will change
to crosshairs. Drag the crosshairs to highlight the section you
want to copy. Press Ctrl+C to copy the highlighted text to the
Clipboard, or press Ctrl+X to cut. Paste from the Clipboard using
Ctrl+V.
<H4>Using Other Convenient Editor Functions</H4>
<P>
Table 2.2 contains a summary of commonly used editor functions.
All functions are accessed from the ABAP/4 Editor: Edit Program
screen unless otherwise noted.<BR>
<P>
<CENTER><B>Table 2.2 Other Convenient Program and Editor
Functions</B></CENTER><CENTER>
<TABLE BORDERCOLOR=#000000 BORDER=1>
<TR VALIGN=TOP><TD WIDTH=288><CENTER><B>To…</B></CENTER></TD><TD WIDTH=288><CENTER><B>Do…</B></CENTER>
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Get help on the editor</TD><TD WIDTH=288>Choose the menu path Help->Extended Help.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Get help on any ABAP/4 keyword</TD><TD WIDTH=288>Put your cursor on a keyword within the code and press F1.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Save your program</TD><TD WIDTH=288>Press F11.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Execute your program</TD><TD WIDTH=288>Press F8.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Display function keys</TD><TD WIDTH=288>Right-click anywhere in the screen area of a window.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Move the cursor to the command field</TD><TD WIDTH=288>Press Ctrl+Tab.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Bring any line to</TD><TD WIDTH=288>Double-click on whitespace (at the end of the line), or place your
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>the top of the screen</TD><TD WIDTH=288>cursor on whitespace and press F2.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Insert a line</TD><TD WIDTH=288>Press the Enter key with your cursor at the beginning or end of a line.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Delete a line</TD><TD WIDTH=288>Put your cursor on the line and press the Cut button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Mark a block of code</TD><TD WIDTH=288>Place your cursor on the first line of the block and press F9 (select). Then place it on the last line of the block and press F9 again.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Delete a block of lines</TD><TD WIDTH=288>Select the block and press the Cut button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Repeat a line or block</TD><TD WIDTH=288>Press the Duplicate Line button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Split a line</TD><TD WIDTH=288>Position your cursor at the split point and press the Enter key.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Join two lines together</TD><TD WIDTH=288>Position your cursor at the end of the line and press the Concatenate button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Copy lines within the current program</TD><TD WIDTH=288>Mark a block. Press the Copy To Buffer button. Then position your cursor at the point where the code should be inserted, and press the Insert From Buffer button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Copy lines to another program</TD><TD WIDTH=288>Mark a block. Choose the menu path Block/Buffer->Copy to X buffer. Open a new program and choose the menu path Block/Buffer ->Insert X buffer. (You can also use the Y and Z buffers the same way.)
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Copy to or from the Windows Clipboard</TD><TD WIDTH=288>Mark a block. Choose the menu path Block/Buffer->Copy to clip-board. Then choose the menu path Block/Buffer->Insert clipboard.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Comment out a block of lines</TD><TD WIDTH=288>Mark a block, and choose the menu path Block/Buffer->Insert comment
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Uncomment a block of lines</TD><TD WIDTH=288>Mark a block, and choose the menu path Block/Buffer->Delete comment.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Print your program</TD><TD WIDTH=288>Press the Print button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Print your program's output</TD><TD WIDTH=288>While viewing the output, choose the menu path System->List->Print.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Find and repeat find Shift code left and right
</TD><TD WIDTH=288>Press the Find and Find Next buttons. Put your cursor on the line to be moved, in the column you want to move it to. Then press the Move Line button (F6). To move a block, position your cursor on the first line and then press the Move Line button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Undo the last change</TD><TD WIDTH=288>Press the Undo button. There is only one level of undo.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Automatically format source code</TD><TD WIDTH=288>Choose the menu path Program >Pretty Printer.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Download a program to a file on your PC</TD>
<TD WIDTH=288>Choose the menu path Utilities->Download. </TD>
</TR>
<TR VALIGN=TOP><TD WIDTH=288>Upload a program from a file on your PC</TD>
<TD WIDTH=288>Choose the menu path Utilities->Upload.</TD>
</TR>
<TR VALIGN=TOP><TD WIDTH=288>Save a temporary copy of your program</TD><TD WIDTH=288>Choose the menu path Program->Save Temp. Version. The temporary copy is deleted when you save the program.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Retrieve the temporary copy of your program
</TD><TD WIDTH=288>Choose the menu path Program->Get Temp. Version. You can retrieve the saved copy any number of times until you save the program.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Jump directly to the editor</TD><TD WIDTH=288>From any screen, type /nse38 in the command field and press Enter.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Copy a program</TD><TD WIDTH=288>From the ABAP/4 Editor: Initial Screen, choose the menu path Program->Copy.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Rename a program</TD><TD WIDTH=288>From the ABAP/4 Editor: Initial Screen, choose the menu path Program->Rename.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Delete a program</TD><TD WIDTH=288>From the ABAP/4 Editor: Initial Screen, choose the menu path Program->Delete.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Save your changes under a new program name</TD>
<TD WIDTH=288>While editing a program, choose the menu path Program->Save As.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Display two programs at the same time</TD><TD WIDTH=288>Starting on any screen, open a new window using the menu path System->Create new session. In the new window, go to the ABAP/4 Editor: Initial Screen, enter the second program name, and press the Display or Change button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Compare two programs for differences</TD><TD WIDTH=288>From the ABAP/4 Editor: Initial Screen, choose the menu path Utilities->Splitscreen editor. Enter two program names and press the Display button. To display the first difference, press the Next Difference button. To align both programs at the next identical line, press the Align button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Compare two programs on different systems</TD>
<TD WIDTH=288>From the ABAP/4 Editor: InitialScreen, choose the menu path Utilities->Splitscreen editor. Press the Compare Diff. Systems button. Enter two program names and a system id and press the Display button.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Save a version of a program</TD><TD WIDTH=288>From inside the editor, choose the menu path Program->Generate version. The current program is saved in the version database.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Retrieve a program version</TD><TD WIDTH=288>From the Editor Initial screen, choose the menu path Utilities->Version management. The Versions Of Object Of Type REPS screen is displayed. Deselect the active version and tickmark the version to restore. Press the Retrieve button and then press the Back button. Press the Yes button and the current version becomes the -1 generation, and a copy of the selected version becomes the current version.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Compare program versions</TD><TD WIDTH=288>From the Editor Initial screen, choose the menu path Utilities ->Version management. The Versions Of Object Of Type REPS screen is displayed. Tickmark the versions you want to compare and press the Compare button. The Compare Programs: All screen is displayed. Scroll down to view the differences.
</TD></TR>
<TR VALIGN=TOP><TD WIDTH=288>Print your program</TD><TD WIDTH=288>Choose the menu path Program->Print. On the next screen, specify a printer and tickmark the Print Immed. check box.
</TD></TR>
</TABLE>
</CENTER>
<H2><A NAME="GettingHelp"><FONT SIZE=5 COLOR=#FF0000>
Getting Help</FONT></A></H2>
<P>
<img src="../button/screencam.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/screencam.gif">
<P>
Start the ScreenCam "Getting Help" now.
<P>
For a complete tutorial on the editor:
<OL>
<LI>Go to the ABAP/4 Editor: Edit Program screen.
<LI>Choose the menu path Help->Extended Help. The SAP R/3 Help
screen is displayed.
<LI>Click on the text ABAP/4 Editor. The BC ABAP/4 Development
Workbench Tools screen is displayed.
<LI>Click on any underlined text for help on that topic.
</OL>
<P>
There are two basic types of help in the editor, <I>F1 help</I>
and <I>R/3 Library help</I>. F1 help is also known as the <I>ABAP/4
keyword documentation</I>.
<P>
<IMG SRC="../button/newterm.gif" tppabs="http://ebooks.cs.biu.ac.il/0672312174/button/newterm.gif">
<P>
F1 help describes the syntax of ABAP/4 keywords and gives examples
of their use. It is text-based and resides in tables within the
R/3 database.
<P>
R/3 Library help is far more extensive and contains overviews
of and procedures for creating development objects. It is Windows-based
help and resides outside of the R/3 database, usually on a CD-ROM.
<H3><A NAME="ObtainingFHelp">
Obtaining F1 Help</A></H3>
<P>
F1 help is useful for looking up syntax and often contains useful
code samples.
<P>
To obtain F1 help:
<OL>
<LI>Go to the ABAP/4 Editor: Edit Program screen.
<LI>Place your cursor on the ABAP/4 keyword you want help for.
<LI>Press F1. The Display Hypertext screen is displayed.
</OL>
<P>
Within F1 help, highlighted words are hypertext links. Clicking
on them takes you to more information.<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 can use the FindIt utility on the CD-ROM to find even more code samples.</BLOCKQUOTE>
</TD></TR>
</TABLE>
</CENTER>
<P>
Within the help there are often code samples. To cut and paste
them into your program, press Ctrl+Y, and then mark a block of
code by dragging your cursor across it from the top left-hand
corner to the bottom right-hand corner. Let go of the mouse and
press Ctrl+C. Press the Back button to return to the ABAP/4 Editor:
Edit Program screen and paste into your program using Block/Buffer->Insert
Clipboard. Or you can paste <I>over top of your code</I> using
Ctrl+V. (Ctrl+V doesn't paste <I>into</I> the source, it pastes
<I>onto</I> the screen, so it won't paste past the bottom of the
visible page.)
<H3><A NAME="ObtainingRLibraryHelp">
Obtaining R3 Library Help</A></H3>
<P>
R/3 Library help is stored in Windows help files. To view it:
<OL>
<LI>From any screen, choose the menu path Help->R/3 Library.
The R/3 System Online Help screen is displayed.
<LI>For help on ABAP/4, click on the text Basis Components. The
Basis screen is displayed.
<LI>Click on the text ABAP/4 Development Workbench. The ABAP/4
Development Workbench screen is displayed.
<LI>From here you can get detailed help on almost any aspect of
programming in ABAP/4. Click on the topic that you want help for.
</OL>
<P>
Additionally, help can be obtained from the ABAP/4 Editor: Initial
Screen. To view it:
<OL>
<LI>Go to the ABAP/4 Editor: Initial Screen.
<LI>Choose the menu path Utilities->ABAP/4 key word doc. The
Display Structure: ABAP/4-SAP's 4GL Program Language screen is
displayed.
<LI>Press the Find button on the Application toolbar. The Search
Titles screen is displayed.
<LI>Type the text you want to find in the Find field.
<LI>Press the Continue button. The first line containing that
text is highlighted.
<LI>Double-click on the highlighted line to display more information,
or press the Continue Search button on the Standard toolbar to
locate the next occurrence.
</OL>
<P>
Help can also be obtained from within the editor while you are
editing the source code. Choose the menu path Utilities->Help
on. Here, you can get the following types of help:
<UL>
<LI>Editor help
<LI>ABAP/4 overview
<LI>ABAP/4 keyword
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -