⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch15.htm

📁 这个是sap开发语言abap的教育文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:
Most printers cannot print more than 132 characters on a line. If you think your users may want to print the output list, try not to exceed 132 characters per line.</BLOCKQUOTE>

</TD></TR>
</TABLE>
</CENTER>
<P>
<P>
The page number is printed in the top-right corner of the list.
The default number of lines per page is 60,000-the maximum allowed.
You can use <TT>line-count</TT> to override this number. For example,
to specify 55 lines per page, enter <TT>report line-count 55</TT>.
Specifying <TT>line-count 0</TT> means use the maximum (60,000).
<P>
The user can specify the number of lines per page that is appropriate
for the printer when he or she prints the report.<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
You can also set the <TT>line-count</TT> in the middle of the report, so different pages can have different numbers of output lines. To do this, use the <TT>new-page</TT> statement (covered later). It can also be used to set the number of lines per-page before any output is generated.
</BLOCKQUOTE>

</TD></TR>
</TABLE>
</CENTER>
<P>
<TT>line-count</TT> is not usually used with reports that are
viewed online. For example, suppose R/3 incremented the page number
each time you pressed the page down key. If the user generates
a report, scrolls to page 3, and then resizes the window, will
he still be on page 3? Obviously, the ability to resize the window
makes it difficult to make rules about page numbers online. You
could try making the page size equal to the window height when
the report was run. But if the user resizes the window after the
report has been generated, the page breaks will no longer match
the window height. The user will see gaps in the output and the
beginning of pages in the middle of the window. To avoid these
problems in online reports, use the default value for <TT>line-count</TT>.
<P>
Listing 15.5 shows a sample program that illustrates the use of
<TT>line-count</TT> and <TT>line-size</TT>.
<P>
<IMG SRC="../button/input.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/input.gif">
<HR>
<P>
<B>Listing 15.5&nbsp;&nbsp;line-count and line-size<BR>
</B>
<BLOCKQUOTE>
<PRE>
1  report ztx1505 line-size 132 line-count 55.
2  tables ztxlfc3.
3  select * from ztxlfc3 order by lifnr bukrs gjahr shbkz.
4      on change of ztxlfc3-lifnr.
5          write / ztxlfc3-lifnr.
6          endon.
7      on change of ztxlfc3-gjahr.
8          write /10 ztxlfc3-bukrs.
9          endon.
10     write: /20 ztxlfc3-gjahr,
11                ztxlfc3-shbkz,
12                ztxlfc3-saldv,
13                ztxlfc3-solll,
14                ztxlfc3-habnl.
15     endselect.
</PRE>
</BLOCKQUOTE>
<HR>
<P>
<IMG SRC="../button/output.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/output.gif">
<P>
The code in Listing 15.5 produces the output shown in Figure 15.5.
<P>
<A HREF="javascript:popUp('f15-5.gif')"><B>Figure 15.5 :</B> <I>This is the effect of the line-count addition</I>.</A>
<P>
<IMG SRC="../button/analysis.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/analysis.gif">
<UL>
<LI>On line 1, <TT>line-size</TT> sets the number of output columns
to 132. This sets a fixed number of output columns independent
of the output window width. The user can use the scroll bar at
the bottom of the window to view the output off to the right.
<LI>On line 1, <TT>line-count</TT> sets the number of lines per
page to 55. This causes a problem when the user scrolls down.
This would not occur if the default value for <TT>line-count</TT>
had been used. Another problem can occur when the user prints
the list. If the printer does not print exactly 55 lines per page,
the page breaks will be incorrect in the printed output. Again,
by using the default <TT>line-count</TT> this problem can be avoided,
because the user specifies the number of lines per page when he
or she selects a printer.
</UL>
<H4>Printing List Output</H4>
<P>
Start the ScreenCam &quot;How to Print List Output&quot; now.
<P>
To print the output from Listing 15.5, first run the report, and
then follow this procedure:
<OL>
<LI>From the output list, click the Print button on the application
toolbar. If it is not available, choose the menu path System-&gt;List-&gt;Print.
The Print Screen List screen will be displayed.
<LI>In the Output Device field, type your printer ID. You can
obtain a list of all printers defined to your system by placing
your cursor in this field and then pressing F4.
<LI>Place a tickmark in the Print Immed check box.
<LI>Click the Print button on the application toolbar. You are
returned to the list, and the message <TT>Spool request (number
nnnnn) created</TT> appears at the bottom of the window.
</OL>
<P>
<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
Your Basis Consultant can also define a fax machine as a print destination. To fax a report, specify Choose a Fax Machine ID instead of a Printer ID in the Output Device field.</BLOCKQUOTE>

</TD></TR>
</TABLE>
</CENTER>
<P>
<P>
Default printer settings are specified in your user profile. Use
the menu path System-&gt;User Profile-&gt;User Defaults to change
them. These settings will be used each time you print a report.
<P>
<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
To send a report to multiple printers at the same time, ask your Basis Consultant to install a printer pool (he must run report <TT>RSPO0051 </TT>first, and then define a printer of type P-pool-using transaction <TT>SPAD</TT>). Then, when you print, choose this printer pool from the list of printers. This functionality is available in release 3.0F and later.
</BLOCKQUOTE>

</TD></TR>
</TABLE>
</CENTER>
<P>
<H4>Working with the Spool</H4>
<P>
When you click the Print button, your output is sent first to
the R/3 spool, and then to the operating system's spool. If you
didn't tickmark Print Immed, the list output is held in the R/3
spool-it is not sent to the operating system spool. It remains
there until you delete it, or print it with the delete option
turned on (the Delete After Print check box on the Print Screen
List screen), or until it ages enough for a cleanup job to delete
it. Cleanup jobs are scheduled by the Basis Consultant; they usually
delete spool files older than 2 weeks. For the exact length of
time in your shop, contact your Basis Consultant.
<P>
To view output on the spool, use the following procedure.
<P>
<img src="../button/screencam.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/screencam.gif">
<P>
Start the ScreenCam &quot;Working with the Spool&quot; now.
<OL>
<LI>From any screen, choose the menu path System-&gt;Services-&gt;Print
Requests. The Spool: Request Screen is displayed.
<LI>Enter criteria to find your output. Your user Id (entered
in the User Name field), Client, and a From Date are usually sufficient.
<LI>Press Enter. The Spool: Requests screen is displayed. It contains
a list of the matching entries on the spool.
<LI>To display the output for one entry, place a tickmark beside
it, and then click the Display button.
<LI>To display the output for multiple entries, place tickmarks
beside Multiple Entries or use the menu path Edit-&gt;Choose All.
Then click the Display button. The first entry is displayed. To
view the next entry, click the Next Spool Request button on the
application toolbar. To view the preview entry, click the Prev.
Spool Request button.
<LI>To print an entry, Click the Print button.
</OL>
<P>
If you didn't tickmark Delete After Print on the Print Screen
List screen, the output remains in the spool. This allows you
to reprint it later. This is useful if your printer has a lot
of personality.
<H3><A NAME="CreatingPageHeadersandFooters">
Creating Page Headers and Footers</A></H3>
<P>
By default, the Title from the Program Attributes screen appears
as the title at the top of your report. You can create your own
titles by using one of two methods:
<UL>
<LI>Standard page headers
<LI>The <TT>top-of-page</TT> event
</UL>
<H4>Creating Standard Page Headers</H4>
<P>
Using standard page headers is the easiest way to create report
headers. The following procedure describes the easiest way to
create them.<P>
<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>CAUTION</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
This procedure won't work if you change your program and try this procedure without saving your changes first. When you choose the menu path to add the headers, you will instead see a dialog box indicating that you are not allowed to change an SAP program. This happens if you haven't saved your changes because then you are actually running a temporary copy of the original-one that contains your changes. The name of this copy doesn't start with Y or Z, so R/3 won't let you change it.</BLOCKQUOTE>

</TD></TR>
</TABLE>
</CENTER>
<P>
<P>
<img src="../button/screencam.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/screencam.gif">
<P>
Start the ScreenCam &quot;How to Create Standard Report Headers
from the List&quot; now.
<OL>
<LI>Start from the ABAP/4 Editor: Edit Program screen.
<LI>If you have made any changes, save your report. As mentioned
in the last Caution, you <I>must</I> do this for the following
steps to work.
<LI>Execute the report. You then see the list output.
<LI>Choose the menu path System-&gt;List-&gt;List Header. Input
fields appear at the top of the report-one for the header and
four for column headers.
<LI>Type a list and column headers in the white input fields.
<LI>Click the Save button on the application toolbar. The message
<TT>Changed texts active from next start of xxxxx in language
E</TT> appears. This means you will see the new headers the next
time you run this program.
<LI>Click the Back button twice. You are returned to the ABAP/4
Editor: Edit Program screen.
<LI>Execute the report again. You will see your new headers at
the top of the output.
</OL>
<P>
You may be asking yourself, where are these headers stored? Then
again, you may not be asking yourself this, but you're about to
find out anyway.
<P>
<IMG SRC="../button/newterm.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/newterm.gif">
<P>
The headers you just entered are stored with your program as <I>text
elements</I>. A text element is any character string that is displayed
in the list output. It might appear at the top as a header, in
the middle (as a character string that does not come from the
database), or at the bottom as a footer. SAP likes to provide
multi-lingual capabilities in its programs, so anything that might
need to be translated, for example report headers, are stored
separately from the source code as text elements. These elements
can be translated without changing the source code. In this section
we deal specifically with text elements for the report and column
headers, but there are others as well that will be dealt with
later.
<P>
Since the standard headers are stored as text elements, you can
see them and modify them by accessing the text elements of the
program. These are contained in the ABAP/4 Text Elements: Change
Title and Heading screen, shown in Figure 15.6.
<P>
<A HREF="javascript:popUp('f15-6.gif')"><B>Figure 15.6 :</B> <I>This screen contains the standard Titles
and Headers text elements</I>.</A>
<P>
Use the following procedure to view, change, or create standard
headers.
<P>
<img src="../button/screencam.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/screencam.gif">
<P>
Start the ScreenCam &quot;How to Create Standard Report Headers
Via Text Elements&quot; now.
<OL>
<LI>From the ABAP/4 Editor: Edit Program screen, choose the menu
path Goto-&gt;Text Elements. The ABAP/4 Text Elements screen is
displayed.
<LI>Choose the Titles and Headers radio button.
<LI>Click the Change button. The ABAP/4 Text Elements: Change
Title And Heading screen is displayed. The Title field contains
the title text you entered in the ABAP/4: Program xxxxx Attributes
screen. If the List Header field is blank, the Title is displayed
at the top of the list. The List Header field allows you to override
the Title and specify a header that is different from the report
title. Enter a List Header, and enter column headers at the bottom
of the screen in the Column Header fields. Click the buttons at
the bottom right of the screen to scroll left and right, to maximum
of 255 characters.
<LI>Press the Save button to save your changes.
<LI>Press the Back button. The ABAP/4 Editor: Edit Program screen
is displayed.
<LI>Execute your program. Your new title and headers appear at
the top of your report.
</OL>

Text elements can also be accessed from the ABAP/4 Editor: Initial
Screen by choosing the Text Elements button, and then clicking
the Change button. You may find it useful to review the section
on the components of an ABAP/4 program at this point (see Figure
2.1 in <A HREF="../ch02/ch02.htm" tppabs="http://pbs.mcp.com/ebooks/0672312174/ch02/ch02.htm" >Chapter 2</A> &quot;Your First ABAP/4 Program&quot;).
<p>
To review, on the ABAP/4 Text Elements: Change Title And Heading
screen, if the List Header field is non-blank, it is used as the
header. If it is blank, the Title field is used as the header.
<BR>
</BLOCKQUOTE>
<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><b>NOTE</b></TD></TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -