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

📄 ch16.htm

📁 这个是sap开发语言abap的教育文档
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">


<!--

function popUp(pPage) {
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '</head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 figDoc.write(zhtm);
 figDoc.close();
 popUpWin.focus();
 }

//-->


</SCRIPT>

        <META NAME="GENERATOR" Content="Symantec Visual Page 1.0.1">
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
        <TITLE>Sams Teach Yourself ABAP/4&reg; in 21 Days -- Day 16- Formatting Techniques, Part 2</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<CENTER>
<H1><IMG SRC="../button/sams.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/sams.gif" BORDER="0"></H1>
</CENTER>
<CENTER>
<P><A HREF="../ch15/ch15.htm" tppabs="http://pbs.mcp.com/ebooks/0672312174/ch15/ch15.htm"><IMG SRC="../button/previous.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/previous.gif" BORDER="0"></A>
<A HREF="../index.htm" tppabs="http://pbs.mcp.com/ebooks/0672312174/index.htm"><IMG SRC="../button/contents.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/contents.gif" BORDER="0"></A> 
<A HREF="../ch17/ch17.htm" tppabs="http://pbs.mcp.com/ebooks/0672312174/ch17/ch17.htm"><IMG SRC="../button/next.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/next.gif" BORDER="0"></A> 

<H1>Sams Teach Yourself ABAP/4<sup>&reg;</sup> in 21 Days</H1></CENTER>
<HR SIZE=4>




<H1>Day&nbsp;16</H1>
<H1>Formatting Techniques, Part 2</H1>


<UL>
<LI><A HREF="#ChapterObjectives">
Chapter Objectives</A>
<LI><A HREF="#ListFormattingStatements">
List Formatting Statements</A>
<UL>
<LI><A HREF="#UsingthenewlineStatement">
Using the new-line Statement</A>
<LI><A HREF="#UsingthenewpageStatement">
Using the new-page Statement</A>
<LI><A HREF="#Usingnewpageprint">
Using new-page print</A>
<LI><A HREF="#UsingtheskipStatement">
Using the skip Statement</A>
<LI><A HREF="#UsingthebackStatement">
Using the back Statement</A>
<LI><A HREF="#UsingthepositionStatement">
Using the position Statement</A>
<LI><A HREF="#UsingthesetblanklinesStatement">
Using the set blank lines Statement</A>
</UL>
<LI><A HREF="#Summary">
Summary</A>
<LI><A HREF="#QampABR">
Q&amp;A<BR>
</A>
<LI><A HREF="#Workshop">
Workshop</A>
<UL>
<LI><A HREF="#Quiz">
Quiz</A>
<LI><A HREF="#Exercise">
Exercise 1</A>
</UL></UL>

<HR>
<H2><A NAME="ChapterObjectives"><FONT SIZE=5 COLOR=#FF0000>
Chapter Objectives</FONT></A></H2>
<P>
<IMG SRC="../button/analysis.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/analysis.gif">
<P>
After you have completed this chapter, you will be able to
<UL>
<LI>Use the formatting statements <TT>new-line</TT>, <TT>new-page</TT>,
<TT>skip</TT>, <TT>back</TT>, <TT>position</TT> and <TT>set blank
lines</TT>.
<LI>Send output to the spool using <TT>new-page print</TT>.
</UL>
<H2><A NAME="ListFormattingStatements"><FONT SIZE=5 COLOR=#FF0000>
List Formatting Statements</FONT></A></H2>
<P>
There are several statements commonly needed to format a list:
<UL>
<LI><TT>new-line</TT>
<LI><TT>new-page</TT>
<LI><TT>skip</TT>
<LI><TT>back</TT>
<LI><TT>position</TT>
<LI><TT>set blank lines</TT>
</UL>
<H3><A NAME="UsingthenewlineStatement">
Using the new-line Statement</A></H3>
<P>
Use the new<TT>-line</TT> statement to cause the output of the
next <TT>write</TT> statement to begin on a new line. Unlike <TT>skip</TT>
or <TT>write /</TT>, consecutive <TT>new-line</TT> statements
do not cause a blank line to appear in the output list.
<H4>Syntax for the new-line Statement</H4>
<BLOCKQUOTE>
<PRE>
new-line [no-scrolling].
</PRE>
</BLOCKQUOTE>
<P>
The <TT>no-scrolling</TT> addition locks the next line in place.
Horizontal scrolling has no effect on lines that have been locked
in this way.
<P>
Listing 16.1 illustrates the use of the <TT>new-line</TT> statement.
<P>
<IMG SRC="../button/input.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/input.gif">
<HR>
<P>
<B>Listing 16.1&nbsp;&nbsp;The NEW-LINE Statement<BR>
</B>
<BLOCKQUOTE>
<PRE>
1  report ztx1601 line-size 255.
2  tables: ztxlfa1, ztxlfc3.
3  select * from ztxlfa1.
4      new-line no-scrolling.
5      write: ztxlfa1-lifnr, ztxlfa1-name1. &quot;this line won't scroll right
6      select * from ztxlfc3 where lifnr = ztxlfa1-lifnr.
7          write: /14 ztxlfc3-bukrs, ztxlfc3-gjahr, ztxlfc3-shbkz,
8                  40 ztxlfc3-saldv, ztxlfc3-solll, ztxlfc3-habnl.
9          endselect.
10     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 16.1 produces the following output:
<BLOCKQUOTE>
<PRE>
1000       Parts Unlimited
             1000 1990 A                    1,000.00         500.00
             1000 1991 A                        0.00       5,000.00
             1000 1992 A                    1,000.00      11,000.00
             1000 1993 A                        0.00      10,000.00
             1000 1994 A                        0.00       1,000.00
             1000 1995 A                    1,000.00       1,150.00
             1000 1995 Z                        0.00       9,000.00
             1000 1996 A                    1,000.00      50,000.00
             1000 1996 Z                    5,000.00           0.00
             1000 1998 Z                    4,000.00           0.00
             3000 1998 A                        0.00      10,000.00
1010       Industrial Pumps Inc.
             1000 1994 A                        0.00       1,000.00
             1000 1995 A                        0.00       1,500.00
             1000 1996 A                    1,500.00           0.00
1020       Chemical Nation Ltd.
             1000 1995 A                        0.00       2,000.00
             1000 1996 A                        0.00           0.00
1030       ChickenFeed Ltd.
1040       Motherboards Inc.
             1000 1990 A                      100.00       3,000.00
             1000 1997 A                      100.00       1,500.00
             2000 1997 A                        0.00         500.00
             2000 1998 A                    1,000.00         300.00
             3000 1998 A                        0.00       2,400.00
</PRE>
</BLOCKQUOTE>
<P>
<IMG SRC="../button/analysis.gif" tppabs="http://pbs.mcp.com/ebooks/0672312174/button/analysis.gif">
<P>
Lines 7 and 8 write vendor detail lines that are wider than the
screen. Scrolling to the right allows you to see the right portion
of the lines, but the vendor name and number stay within view.
This happens because the <TT>write</TT> statement on line 5 is
preceded by the <TT>new-line no-scrolling</TT> statement on line
4.
<H3><A NAME="UsingthenewpageStatement">
Using the new-page Statement</A></H3>
<P>
Use the <TT>new-page</TT> statement to
<UL>
<LI>Cause the output of the next <TT>write</TT> statement to begin
on a new page. Consecutive <TT>new-page</TT> statements do not
generate blank pages.
<LI>Turn titles and headers on or off.
<LI>Vary the line count or line size from one page to the next.
<LI>Turn printing on and off.
</UL>
<H4>Syntax for the new-page Statement</H4>
<BLOCKQUOTE>
<PRE>
new-page [no-title | with-title]
         [no-heading | with-heading]
         [line-count n(m)]
         [line-size k]
         [print on | print off]
</PRE>
</BLOCKQUOTE>
<P>
where:
<UL>
<LI><TT><I>n</I></TT>,<I> </I><TT><I>m</I></TT>,<I>
</I>and <TT><I>k</I></TT> are
numeric variables or literals.
</UL>
<P>
The following points apply:
<UL>
<LI><TT>new-page</TT> can be used anywhere in the program. You
can use it even before the first <TT>write</TT> statement to set
the characteristics of the list output. Because it accepts variables,
it is more flexible than similar additions on the <TT>report</TT>
statement.
<LI><TT>no-title</TT> turns off the standard title on the following
pages. (The title is the first line of the standard page headers.)
<TT>with-title</TT> turns it on.
<LI><TT>no-heading</TT> turns off the standard column headers
for the following pages. <TT>with-heading</TT> turns it on.
<LI><TT>line-count</TT> sets the number of lines per page and
the number of lines reserved at the bottom of each page for a
footer. Either one of these values, or both, can be specified.
This was covered earlier in this chapter.
<LI><TT>line-size</TT> sets the number of output columns for the
following pages. The default is the current window width.
<LI><TT>print-on</TT> causes output from following <TT>write</TT>
statements to be sent to the spool instead of the list. Users
do not see this output unless they look in the spool. (View and
printing spool output was covered earlier in this chapter.) <TT>print-off</TT>
does the reverse.
<LI>Consecutive <TT>new-page</TT> statements do not generate blank
pages.
<LI><TT>new-page</TT> does not trigger the <TT>end-of-page</TT>
event. Therefore, a footer will not be printed at the bottom of
the current page if you issue the <TT>new-page</TT> statement.
</UL>
<P>
<CENTER>
<TABLE BORDER=1>
<TR VALIGN=TOP><TD WIDTH=600><B>TIP</B></TD></TR>
<TR VALIGN=TOP><TD WIDTH=600>
<BLOCKQUOTE>
If you want to cause a page break and trigger the end-of-page event, code reserve sy-linct lines. sy-linct contains the current number of lines per page. The output from the next <TT>write</TT> will appear at the top of a new page, and the end-of-page event will be triggered beforehand causing a page footer to be created.
</BLOCKQUOTE>

</TD></TR>
</TABLE>
</CENTER>
<P>
<H3><A NAME="Usingnewpageprint">
Using new-page print</A></H3>
<P>
At times there is a need for a report that both writes to the
output list and sends output to the printer at the same time.
For example, you may wish to write a report that shows a summary
to the user online, and send a detail report to the printer at
the same time. Use <TT>new-page print on</TT> to do this. The
output from all <TT>write</TT> statements that follow <TT>new-page
print on</TT> will not appear in the list. Instead, it will be
sent to the spool. Issuing <TT>new-page print off</TT> reverses
this effect. The output from all <TT>write</TT> statements that
follow it will again be seen in the list.
<P>
Each time <TT>new-page print on</TT> is executed
<UL>
<LI>The system displays the Print Parameters screen to the user
(shown in Figure 16.1). It prompts the user for parameters such
as the printer ID and Output Format.<BR>
<A HREF="javascript:popUp('f16-1.gif')"><B>Figure 16.1 :</B> <I>The Print Parameters screen</I>.</A>
<LI>If, on the Print Parameters screen, there is a tickmark in
the New Spool Request field it creates a new spool request. A
spool request is a separate list in the spool.
</UL>
<H4>Syntax for the new-page print on Statement</H4>
<BLOCKQUOTE>
<PRE>
new-page print on
    [no dialog]
    [new section]
    [immediately        immedflag]
    [destination        destid]
    [copies             numcopies]
    [layout             layoutid]
    [list name          listname]
    [sap cover page     coverpageflag]
    [cover text         title]
    [department         dept]
    [receiver           recievername]
    [keep in spool      keepflag]
    [dataset expiration numdays]
    [line-count         linesperpage]
    [line-size          numcolumns]
</PRE>
</BLOCKQUOTE>
<P>
where:
<UL>
<LI>Any of the italicized names in the proceeding code can be
a literal or a variable.
</UL>
<P>
The following points apply:
<UL>
<LI>Use <TT>no dialog</TT> to suppress the display of the Print
Parameters screen that asks the user for print parameters. The
user's defaults are used instead. If the user has not filled in
a printer ID in his defaults, the Print Parameters screen will
be shown even when you specify <TT>no dialog</TT>.
<LI>Use <TT>new section</TT> to restart page numbering, beginning
again at 1.
<LI>Use <TT>immediately 'X'</TT> to cause the list to be printed
immediately. The default is <TT>immediately ' '</TT>, which holds
the list in the spool.

⌨️ 快捷键说明

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