Você está na página 1de 25

Advanced Form Development

PDF download from SAP Help Portal:


http://help.sap.com/saphelp_nw70/helpdata/en/dd/599838fd4a892ae10000009b38f8cf/content.htm
Created on January 04, 2017

The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help
Portal.

Note
This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.

2017 SAP SE or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP SE. The information contained herein may be changed without prior notice. Some software products marketed by SAP
SE and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are
provided by SAP SE and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP
Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set
forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional
warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE in
Germany and other countries. Please see www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Table of content

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 1 of 25

Table of content
1 Advanced Form Development
1.1 Special Node Types
1.1.1 Commands
1.1.2 Complex Section
1.1.3 Program Lines
1.2 Processing a Form
1.2.1 Output Control: Overview
1.2.2 Processing Pages
1.2.3 Processing Windows
1.2.3.1 Main Window
1.2.3.2 Copies Window
1.2.3.3 Final Window
1.2.4 Processing Loops and Tables
1.2.5 Summary
1.3 Summing Up Different Currencies
1.3.1 Calculating and Printing Grand Totals
1.3.2 Calculating and Printing Subtotals
1.4 Delivery and Translation
1.5 Parameters of the Generated Function Module
1.5.1 Default Settings (Standard Output)
1.5.2 Control Structure
1.5.3 Output Options
1.5.3.1 Options for Fax Output
1.5.3.2 Spool Settings
1.5.3.3 Options for XML/HTML Output
1.5.4 Querying the Output Result
1.5.4.1 XML/HTML Output Structure

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 2 of 25

1 Advanced Form Development


The functions and features covered in this section either are of interest only for a particular circle of SAP Smart Form users or their description would have
gone beyond the scope of the first part of the documentation.

1.1 Special Node Types


This section describes node types to be used by advanced SAP Smart Forms users.
The
command node contains both simple commands (dynamic page break and initializing an outline paragraph) and commands for special usage (inserting print
controls, spool attributes).
You can process
program lines within the form. This enables you to calculate totals and call individual routines.
The
complex section unites the attributes of different nodes. Before the new node types for tables, templates, and loops were introduced, you used complex
sections to deal with these contructions. Older forms still use this node; but for new forms you should prefer the new node types.

1.1.1 Commands
Use
Command nodes contain commands for different application purposes. In most cases, you need the command node to insert a dynamic page break within the
main window.

Features
Command Name

Description

Go to New Page

Dynamic page break. This command is allowed only within a main window.

Reset Paragraph Numbering

Initializes the counter of the specified outline paragraph and all paragraphs on
inferior outline levels. It ignores paragraph formats without outline level.

Insert Printer Control

Sends a print control to the output device. Print controls are administered in
the spool administration; during printing they are converted into printer-specific
escape sequences. For general information, refer to
Print Controls. In addition, you can use any existing
Controls.

Spool Attributes

SAPscript Print

You can use the table control in this group box to enter your own spool
attributes:
As
Attribute Name you can enter a new name for an attribute (without inverted
commas and without ampersands ('&')). This attribute is appended to the
spool request that you use to print your form.
As
Attribute Value specify either a literal (in inverted commas) or a field name
(without inverted commas and without ampersands ('&')). For a field name, the
value of the spool attribute is determined dynamically.
The attributes are appended to the spool request. You can display them in the
spool request overview (transaction
SP01 ) using function Request Information on the Free Attributes tab.
The purpose of free attributes is to append application-specific information to
the spool request, for example the first digit of a postal code for postage
optimizing. You can evaluate the attributes using database table
TSP02A (see also report RSPOPRNT ).

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 3 of 25

1.1.2 Complex Section


Use
The node type Complex section is a real all-purpose node. It allows you to combine the tab pages of the node types
Folder, Template, Table, and Loop in any way.
We generally recommend not to use this node type any longer. The node types Folder , Template , Table , and Loop directly offer the
correct tabs and, in addition, within the navigation tree, you can recognize these node types immediately.

Procedure
Create a node of type Complex section in the
navigation tree of the Form Builder.
Enter a unique name for the node and a description (for example, template with data).
Determine the general purpose of the complex section. To do this use the General Attributes tab:
Select
U nstructured if you need only the Events tab to display header and footer areas. In this case, you can use the Data tab for repeated processing.
Select Table if you need the
Table tab. In this case, you can use the Data tab for repeated processing.
Select Template if you need the
Template tab. In this case, you cannot use the Data tab for repeated processing.
1. To read data from an internal table using the
Data tab mark the Repeat Processing field in the Data box.
If, due to changing the selection, tab pages would disappear, the Smart Builder offers a warning beforehand.

Result
You can now use the selected tab pages.

1.1.3 Program Lines


Use
You use program lines nodes to enter free ABAP code. These nodes are evaluated at the moment they are processed according to their position in the tree. If
you insert program lines at the appropriate position in the tree structure, you can use it, for example, to calculate subtotals and grand totals in tables.
Program lines nodes are not intended to print output in the form. Therefore, they have no Output options tab.

Integration
When generating the function module, the program lines node becomes a subroutine in ABAP. SAP Smart Forms then calls this subroutine according to its
position in the navigation tree.

You can use the program lines node to call your own subroutines, which you must have defined on the Form Routines tab of the node Global
Definitions.

Visibility Rules
You can use the following variables:
Global fields (fields from the global definitions or from the form interface), which you enter in the tables Input parameters and Output parametersof
the General Attributes tab.
Variables that you define locally within the program lines node.
Global Fields as Input/Output Parameters
Distinguishing between input and output parameters enables the global check to execute a data flow analysis. Since both input and output variables are global,
changes of these variables in the program lines node have global effects. This distinction between input and output parameters thus is of importance only for
the check, but does not restrict the visibility of the specified fields.
Local Variables

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 4 of 25

As you do in a FORM routine, you can use the DATA statement within program lines nodes to define and use local variables. They are visible only within the
program lines node in which they are defined.

Prerequisites
You must be familiar with ABAP programming.

See also:

ABAP Programming (BC-ABA)

Features
Editor Functions
The inline editor corresponds to any ABAP editor and offers the following functions:
Run syntax check
Statement patterns
Pretty Printer

See also: Checking and Testing a Smart Form

Available ABAP Statements


You can use all ABAP statements that are allowed in ABAP subroutines. Consequently, statements such as PARAMETERS or SELECT-OPTIONS are not
allowed. In addition, there are statements that are allowed by the syntax check but make no sense in the SAP Smart Forms context, for example, LEAVE TO
SCREEN.
The syntax check is customized for SAP Smart Forms only as far as the fields defined in the parameter interface are concerned.

1.2 Processing a Form


As illustrated under
Form Logic: Introduction, you use the tree structure in the Form Builder (which at the same time serves as navigation tree) to describe the form logic of your
form and to determine when to print texts, graphics, and other elements in your form. The Smart Form you describe in the Form Builder is nothing but a
description of what you want to print. To really print these contents, you activate your Smart Form and thus generate a function module that contains the
appropriate ABAP statements. When generating this function module, SAP Smart Forms processes the tree structure of the Smart Forms, meaning that it
processes all nodes of the form. It then uses the generated ABAP program coding to actually print the form contents.
For each node type there is an appropriate output control , which is reflected in the generated program coding and, of course, in the output. To fully
understand the form logic, you must know when which output areas are processed. The elementary nodes are not explained here because their only task is to
fill these output areas.
Classification of the different output controls
Output Control

Classification

General rules

Essential for form development

For printing Pages


For printing windows
For loops and tables

Important for printing totals

For elementary nodes

Represent the visible output during processing

If you consider the output controls of all node types together, you find the rules for processing a Smart Form (see:
Summary).

1.2.1 Output Control: Overview


The output control is determined by the inferior nodes of the root node
Pages and Windows in the Form Builder. The nodes of the tree have different types and different characteristics as well (type of processing, number of inferior
nodes, and so on). To most of the nodes you can assign output options and conditions (one exception, for example, is the program lines node, which has no
output options since its content is not printed).
Processing an output control means processing the inferior nodes of the root node in the sequence in which they appear in the tree. A node itself is processed

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 5 of 25

as follows:
1. If a condition is assigned to the node, the system evaluates the condition. If the condition is false, the node including its inferior nodes is not processed.
2. The system executes the action assigned to the node (such as printing a text in the window, processing program lines).
3. The system processes the directly inferior nodes of the node in the tree. The processing sequence in this case depends on the node type (for example,
sequentially from top to bottom, only at certain events, alternatively, repeatedly).
4. If output options are assigned to the node, then these options apply for any output described by the node and its inferior nodes. If you assign individual
output options to an inferior node (such as an individual style), these options overwrite the output options of the superior node for that inferior node.
Conditions
You can use the following conditions for processing a node:
Simple IF condition (using AND and OR)
Complex IF condition (using
program lines)
Event queries (for example, Only on First Page , At Page Break and so on)
Any combinations thereof
Output Options
You can determine the following
output options:
Assignment of a
Smart Style. In this case, the Smart Style set for the superior node is never used for output described by this node.
Page protection. Any output triggered by the node and its inferior nodes must be printed on one page; no page break is allowed.
Box and shading. Any output triggered by the node and its inferior nodes are framed or shaded as specified. For inferior nodes of tables and templates,
no boxes or shadings are allowed. Boxes in these cases are pre-determined by the line type.
Specifying lines and cells of a template for output. You can specify in which line and/or cell you want the output of the inferior node to appear.

1.2.2 Processing Pages


Start Page
Every form description consists of one or several
draft pages. You create draft pages as directly inferior nodes of the root node Pages and Windows . The first inferior node of the root node is the start page,
where the form processing starts.

Processing the Output Areas of a Page


SAP Smart Forms processes a draft page by processing all output areas of this page in the sequence determined in the navigation tree. Output areas in this
case are the directly inferior nodes of the page node, that is, window nodes, graphic nodes, and address nodes with their own output area.

Ending the Processing of a Page


Processing of a draft page ends as soon as the processing of all output areas is finished:
For graphic and address nodes this means that the graphic or address was printed. If the output area was too small for the address, the remaining output
is truncated on the print page.
For a secondary window, processing ends after all inferior nodes of this window have been processed. If the secondary window was too small, the
remaining output is truncated on the print page.
For a main window, processing ends as soon as its output area is full. Unlike with the secondary window, its output is resumed on the next page.

Next Pages
There are two ways to specify the next page following the current page:
Use the Next page list box of the page node to enter the next draft page you want to process. A page that contains a main window can point to itself. If
you specify nothing but the next page, SAP Smart Forms triggers an automatic page break as soon as the page is full. If the processing ends on this
draft page, the next page set here it is not called.
Use a command node to insert a dynamic page break within a main window. As for any other node type, you can specify conditions to be fulfilled in
order to trigger the manual page break. The page to which you branch using this method is called a dynamic next page.
Note the restrictions for using both manual page break and next page:
Method

On Page With Main Window

On Page Without Main Window

Dynamic page break using the command node

Allowed,
but only within the main window

Not allowed

Specifying a next page in the page node

Required

Optional

Specifying the current draft page as next page


(page pointing to itself)

Allowed

Not allowed

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 6 of 25

For a page without main window, never specify the same page as next page, because this would trigger an endless loop. In such a case, the
system terminates processing after printing three pages.

Last Page
Form processing ends with the last page. The last page is reached if
on a draft page without main window no static next page is specified (for draft pages with main window, you must specify a static next page)
the draft page has a main window and
all inferior nodes of the main window have been processed and
no further manual page break has been processed in the main window

1.2.3 Processing Windows


General Characteristics
Each page contains one or more windows. The formatting options for the texts and data within a window are taken from a Smart Style (see also
Smart Styles). The provision of the texts depends on the data and is described by an output control, similar to any other node type. Every window points to an
output control.
You can print a window including its entire content on several different pages by copying the window onto another draft page. In the navigation tree of the Form
Builder, these windows then have the same technical name and point to the same output control. However, you cannot use one window more than once on the
same draft page (for example, at different positions in the layout). All the windows on one draft page must have different names and point to different output
controls.
As for most nodes, you can determine conditions and output options for windows as well. When printing one window on several draft pages, each window can
have its own conditions and output options, even though they point to the same output control. This enables you to use the same window on different pages
with identical content but at different positions.

See also:
Copies and Links in the Navigation Tree

Window Types
You can define the following window types in a form:
one
main window
one or more secondary windows
one or more
copies windows
one or more
final windows
individual output areas for graphics or addresses
For graphics and addresses the above general characteristics apply as well. However, since they can have no inferior nodes, you only have to consider their
elementary characteristics.
The main difference between main and secondary window is the page break behavior: While in a main window a page break automatically occurs as soon as
the end of the window is reached, in a secondary window the remaining output is truncated; there is no page break.
The window types final window and copies window have the same characteristics as a secondary window. Final windows are processed only after all the
nodes in the tree have been processed. Copies windows can be used to explicitly print a particular content only on the copy or only on the original.

1.2.3.1 Main Window


You can identify only one window of a form as main window. You use the main window to spread output over several print pages, which is a prerequisite for
printing
tables. The output control of the main window triggers an automatic page break as soon as the main window is full, that is as soon as in the main window no
space is left for printing outout.
However, the main window "keeps in mind" the exact location at which the output was interrupted. On the next page, the output control resumes printing at
exactly this position as soon as in the processing tree the main window is reached again. The subsequent print pages may also include other windows or

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 7 of 25

output areas; they are printed unless a condition suppresses them.


Depending on your needs, it may make sense to use the main window either only on one draft page or on several draft pages.

Activities
Main Window on One Draft Page
This is the default. The main window appears only on one draft page, which points to itself using the Next page attribute of the page node. The system
processes this draft page again and again until it reaches the end of the main window. Depending on the size of the output in the main window, SAP Smart
Forms then produces one or several print pages.
In this case, form printing ends at the end of the main window. If you want to print more pages, you must use the command node to include a
dynamic page break as the last inferior node of the main window.
Main Window on Several Draft Pages
Even though only one main window per form is allowed, you can copy it to several draft pages. Each main window then points to the same output control. You
use this technique if you want the pages on which a table with items is printed to have different layouts. Height and position of the main window may differ on
the different pages, but the width must remain the same throughout.
There are two ways to reach the second draft page:
If you want to branch to the second draft page immediately after printing the first draft page with the main window, enter this second draft page as next
page of the first one in the page node attributes. If the main window is not filled completely on the first draft page, the specified next page is not
processed.
If you want to branch to a different draft page later, for example, after printing a particular output, insert a dynamic page break at this position.
The draft page specified like this is processed even if the main window was not filled completely (for example, because at the end of the form you want
to print General Business Terms).
The draft page to which you branched is processed from the beginning. As soon as it starts processing the main window, SAP Smart Forms resumes printing
at the break location (after an automatic page break) or directly after the executed command node (after a dynamic page break).

1.2.3.2 Copies Window


Use
You use the copies window to define an output area for the print output, whose content you want to appear either only on the copy or only on the original. This
allows you to flag copies as copies when the form is printed.

Prerequisites
You use this window type only if you want to print copies of your form. In the
spool dialog in the Number input field of the Copies group box enter the number of copies (including the original).

Features
You can determine where to print the inferior nodes of a copies window:
Both on the original and on the copies (
Original and Copies )
Only on the original (
Only Original )
Only on the copies (
Only Copies )
You can use the
system fields SFSY-COPYCOUNT or SFSY-COPYCOUNT0 to query whether the current output is the original or, respectively, which number the copy has.
Extras
You frequently
print a graphic on the copies to flag them as copies. If, independent of the copy, the graphic is always the same, SAP Smart Forms can buffer the graphic
before printing the page and thus increase performance. To do this, you must flag the copies window accordingly:
If you mark
Identical Copies SAP Smart Forms buffers the output to increase performance. Within such a window, any queries of the system fields SFSY-COPYCOUNT
or SFSY-COPYCOUNT0 have no effects.
If you mark
Different Copies SAP Smart Forms generates the contents again for each copy. You use this option if, for example, you want to number your copies
consecutively (Copy 1, Copy 2, Copy 3, and so on).

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 8 of 25

1.2.3.3 Final Window


Use
You may want to display or query values on the first page that are determined only during processing. For example, you may want to name the grand total in
the letter text of an invoice. However, this amount is determined only after listing all individual items. Or you may want to query on the first page within a
condition the total number of pages, which the system calculates only after processing all pages.
In such a case, you use the final window: Processing first skips all windows of this type in the tree and works its way to the end of the tree. Only after the
actual processing is finished, the final windows are processed in the order in which they appear in the tree (from top to bottom). Now any information is
available that is known only at the end of the form processing.

Integration
As of Release 6.10 you can set this window type using a radio button on the General Attributes tab. For Releases 4.6C and 4.6D you must first upload a
Support Package. Selection of this window type differs for these releases. For more information, refer to Note 359009 in SAPNet.

Activities
Create a window.
To set the window type, use the
Window Type list box on the General Attributes tab.

1.2.4 Processing Loops and Tables


Overview
When you use a loop or table node, you usually specify an internal table. SAP Smart Forms reads the table line by line to retrieve the data. Since the number
of entries in such a table can be too large to fit onto one page, use a
main window for table output.
When you print a table, the size of a table is determined dynamically. The output control must consider several heights to calculate a page correctly:
The height of the footer. The height of the header area is not important, since it is always printed at the beginning of the main window.
The height of a table line , meaning the output from all nodes using a certain line type. The height of a table line depends on the highest cell in the line;
the height of a cell depends on its content.
The height of a line . Within a table cell, you can print output that covers several lines. If you want all lines of a table line to be printed together, you
must set the
No Break indicator for this line type.
When processing a table, SAP Smart Forms does not calculate the space required for the entire table in advance, but determines for each line whether it still
fits onto the current page.
Footer
With
table output, besides using the main area for output of table lines, you will frequently print a header and footer. If the footer is printed at the end of each page,
the output control must consider the footer height when determining the position of the automatic page break. Therefore, you must specify a height for the
footer output. If you don't, then the output control cannot reserve any space at the end of the main window and thus not print the inferior nodes of the footer
before the page break.
Automatic Page Break vs No Break
The output control triggers an automatic page break to print contents on several pages. As a form developer, you may not want the system to automatically
break a page, for example, if you want to print all lines of a table on one page. For these table lines, you must specify
No Break with the line type to prevent the system from breaking up the table at the end of the main window for space reasons. If there is not enough space left
on the current page, the entire table will be printed on the next page.

For all other output, you can use the output option
Page Protection instead of No Break .

Processing
Requirements for Automatic Page Breaks
During output SAP Smart Forms must determine dynamically whether the output still fits onto the current page. Otherwise it must trigger a page break. When
processing tables, this is of special importance, since the table lines are not printed immediately after the corresponding node is processed. Whenever a new
line starts, the output control must determine the height of it. To do so, it stores the entire line in a buffer. The following examples illustrate why:

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 9 of 25

The cells within a table line contain data that may be printed on one as well as on several lines. If the line type is protected against page break,
all cells of the table line must be printed on the page. This depends on the height of the highest cell within the table line.

Even if the table line type is not break-protected, a subsequent cell might contain a graphic which is higher than the first cells.
These examples illustrate that the output control can determine the height of each line only by analyzing the entire line in the buffer.
Process Flow
For form development not every detail of the output control is important. We want to concentrate on two questions: When is the footer processed? How is the
automatic page break determined?
1. If you activated output at the beginning of the table or at a page break, the header is processed and printed.
2. With the
old table node, output of the first inferior node, for which the output option New Line is marked, determines the end of the current line as well as the beginning
of a new line. With the new table node you specify the end of the line by explicitly creating table lines. In both cases, SAP Smart Forms calculates at this
event wheter to execute an automatic line feed:
1. If the buffer already contains a table line, this is the line of the previous loop pass. With the beginning of the new line, the output control can now check
whether the buffered line still fits onto the current page, thereby considering the yet unprinted footer (provided it must be printed before the page break):
If there is enough space left on the page, the buffered line is printed.
If there is not enough space left, the output control processes the footer and prints it. Then the output control processes all subsequent windows of
the page and triggers a page break. It prints the buffered line after the page break.
1. The output control buffers the table line of the current loop pass to determine its height. However, this line is printed only during the next loop pass.
3. After processing the last inferior node, processing resumes with the first inferior node of the table (in the main area, with new table nodes).
Program Lines Nodes
Nodes of type program lines must be considered separately:
Program lines nodes cannot be buffered. The output control executes them directly while they are processed (unlike table lines, where the buffered line
is printed during the next loop pass). This affects subtotals that are printed at the end of a page above the footer.
Program lines nodes have no output. With the old table node this has the effect that they do not represent the start of a new line for the output control.
This means that all program lines nodes that appear before the next node that contains output are processed even though the line of the last loop pass
has not yet been completed. With the new table node this is different because you specify the line end by explicitly creating table lines.
The program lines nodes within a table or loop are processed in the desired sequence and only once per loop pass. But note that due to the mechanism
described above they are executed out of sync with the output (with the new table node as well).

The section
Summing Up Different Currencies describes how you can use program lines nodes to print correct totals.
The procedure described there is required only if you want to sum up values with different currencies or measurement units. Otherwise you can use the
Calculations tab of the new table node and avoid pondering about how to process the loop.

1.2.5 Summary
The overview below lists the exact rules for processing a form:
1. Processing starts with the start page (the first page in the tree).
2. Processing of a page is executed in the sequence of the assigned windows in the tree.
3. Processing a window means processing the output control of the window (see also
Output Control).
Processing of the main window on a page is finished:
1. If the main window is filled completely on the page and the output control has not yet been processed to the end or
2. If the output control has been processed to the end or
3. If a manual page break (see also
Page Sequence and Numbering) is reached.
1. Processing of a secondary window is finished:
1. If the secondary window is completely filled on the page or
2. If the output control has been processed to the end.
1. After all windows of a page are processed, processing of the page is finished.
2. A page break to a new page occurs as soon as the processing of a page is finished and
1. The output control of the main window has not yet been completely processed or
2. A manual page break was executed in the output control of the main window or
3. The page does not contain a main window.
1. The new page is the static next page. If a new page is called by a manual page break with page specification within the main window (dynamic next
page), the system processes this page.
2. Processing of the form ends if the processing of a page is finished and

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 10 of 25

1. On this page the output control of the main window has been finished and no manual page break occurred at the end or
2. On this page the output control of the main window has not been finished but there is no next page (neither static nor dynamic) or
3. This page does not contain a main window and no static next page exists.
The manual page break is executed only in the main window, which means that you can specify it only in the output control of the main
window.
For pages without a main window the system goes to the static next page after processing all windows. If there is no next page, processing
stops.
For particular applications it is possible to repeat the processing described above (one main window and several secondary windows), so that
actually a form with several main windows is created. The main windows all point to the same output control.

1.3 Summing Up Different Currencies


Use
When printing tables you can execute calculations on two ways:
1. The Calculations tab of the table node supports the operations Total , Average Value , and Number on application data.

See:
Calculations
You can execute calculations manually using program lines nodes. However, this is necessary only for calculations on values that can have different
currencies or measurement units.
This section, as an example, describes how to sum up different currencies:
How to calculate subtotals according to a certain sort criterion and display them separately by currencies
How to calculate a grand total on different currencies and display it at the end of a table
How to calculate a subtotal of the grand total on different currencies and display it before a page break
You can use these calculations for
printing old tables as well as for the new table nodes (see: Printing Tables).

Integration
You usually calculate totals within data loops of the loop or table nodes. For
grand totals or subtotals of the grand totals at the end of a page use the footer for output. The output control of the footer (see: Processing Loops and Tables)
in this case requires a calculation of the total that is in sync with the output.
For
subtotals by sort criterion use events for summing that are triggered after a break in the sort level.

1.3.1 Calculating and Printing Grand Totals


Use
You want to calculate a grand total for a column of your table and print it. If you wish, you can print the grand total at the end of the table and subtotals at the
end of each page.

If you do not want to calculate totals for different currencies or quantity units, use the Calculations tab of the table node (see:
Calculations).
The solution described here refers to
printing old tables. However, it can easily be adapted for the new table node type.

Form
SF_TOTALS in the system illustrates how to print grand totals for different currencies using the old or the new table types. Use application program
SF_TOTALS to call this form.

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 11 of 25

Prerequisites
You are already printing the table using the table node, for which you now want to print a grand total.

Procedure
To print a subtotal of the grand total before a page break, the subtotal must be calculated in a special way. However, you can also use this method if you only
want to print the grand total at the end of the table.
We will use the flight data model to explain this summing method. A table containing the flights of the airline carriers is already being printed in a form. The
corresponding internal table (
T_SFLIGHT ) is defined in the form interface and has type TABLE OF SFLIGHT . To print a table line, you have defined field GS_SFLIGHT of type SFLIGHT
as a global field. You now want to calculate the total on the flight prices, taking into account that the airlines use different currencies to indicate their prices.
1. Create three additional fields in the global definition:
GT_TOTAL
of type TABLE OF SFLIGHT
GS_TOTAL
of type SFLIGHT
GS_4NEXT_ADDITION
of type SFLIGHT
In the navigation tree, you are already printing the table in the main window using table node B. To keep it simple, the table output in our example (see
below) consists only of the nodes C (containing the price) and E (containing the currency). Enhance the form logic as follows:
Form logic for calculating the grand total
Navigation Tree

Node
Attributes/Contents/Conditit
ons
Output parameters
: GT_TOTAL,
GS_4NEXT_ADDITION

Program lines:

refresh gt_total.
clear: gs_total,
gs_4next_addition.
Loop
:
internal table T_SFLIGHT
INTO GS_SFLIGHT

&GS_SFLIGHT-PRICE&
C
Input parameters
: GS_SFLIGHT,

GS_4NEXT_ADDITION

Output parameters :
GT_TOTAL,
GS_4NEXT_ADDITION

Program lines :
if not gs_4next_addition is initial.
collect gs_4next_addition into
gt_total.
endif.
gs_4next_addition-price =
gs_sflight-price.
gs_4next_addition-currency =
gs_sflight-currency.

&GS_SFLIGHT-CURRENCY&
E
Footer

Make sure to assign enough


height to the footer.
F

Condition: only at end of


section
Input parameter
: GS_4NEXT_ADDITION
Output parameter :
GT_TOTAL

Program lines :
if not gs_4next_addition is initial.
collect gs_4next_addition into
gt_total.
endif.

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Loop
:
internal table GT_TOTAL
INTO GS_TOTAL

Page 12 of 25

&GS_TOTAL-PRICE&
H
&GS_TOTAL-CURRENCY&
I

Result
If the table output covers several pages, a subtotal of the grand total appears at the end of each page. If you want to print a total only at the end of the table,
include the condition
only at end of section into the loop node ( G).

Discussion
Some steps within the form logic are self-explanatory:
To be able to calculate the price in accordance with the currency, we need the internal table
GT_TOTAL . We can then use the ABAP statement COLLECT to add up the values, thereby easily assigning each new value to the correct currency. Each
entry in table GT_TOTAL corresponds to the totals value in one currency.
At the beginning of the table, all summing fields must be cleared (node A).
When printing the footer, we use loop G to print the totals sorted by currencies.
Other steps, in contrast, are hard to understand at first sight, for example, what do we need field
gs_4next_addition for?. Why don't we simply add the current value of gs_sflight to the corresponding value in the internal table GT_TOTAL ?
The reason for this lies in the output control for
loops and tables. Determining the page break requires the output control to buffer table lines before printing them. The output control needs the height
specifications of the entire line before it can determine when to trigger the automatic page break. The program lines nodes, in contrast, are not buffered but
executed directly during processing.

See also:
Processing Loops and Tables
The output control recognizes that the last table line is finished as soon as it starts processing the next line. To synchronize the calcuation of the total with its
output, the calculation must be delayed. And for this reason we need the additional field
gs_4next_addition :
1. Within the loop, the total is calculated after the first output (node D). The node can even be positioned further down in the tree. The important fact is that
the output control has recognized that a new table line starts (with the new table type, this is achieved by explicitly creating table lines). If this last line
does not fit onto the page, the output control jumps to the footer processing. In this case, node D is not processed. This would not have happened if
node D had been inserted before node C.
2. If no new table line starts, the value of the last line above node D is added to the total. Since
gs_4next_addition is empty at the beginning, we must query this in the programming. Otherwise, the COLLECT statement would use an empty currency in
GT_TOTAL . Then, we temporarily store the current value of gs_sflight in gs_4next_addition , before we add it to the total in the next loop pass. This means
that we do the same thing that the output control does with the table line: We buffer the value of this line.
After all table lines have been processed, one last calculation is missing, which we execute in the footer. To make sure that this last addition happens
only at the end of the table output, we enter the appropriate condition in the program lines node. Here, again, we query whether
gs_4next_addition is empty to catch the case that T_SFLIGHT might have no entries.

1.3.2 Calculating and Printing Subtotals


Use
You want to print subtotals in accordance with a value in a different column. This column is then called the
sort criterion.

If you do not want to calculate totals for different currencies or quantity units, use the Calculations tab of the table node (see:
Calculations).
The solution described here refers to
printing old tables. However, it can easily be adapted for the new table node type.

Form
SF_TOTALS in the system illustrates how to print grand totals for different currencies using the old or the new table types. Use application program
SF_TOTALS to call this form.

Prerequisites
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 13 of 25

You are printing a table using the table or loop node.

Procedure
We assume that you are already printing an internal table
T_SFLIGHT of type TABLE OF SFLIGHT . Now we want to print the table sorted by airline and include a subtotal of the price after each airline.
1. Define two global fields for summing:
GT_SUBTOTAL
of type TABLE OF SFLIGHT
GS_SUBTOTAL
of type SFLIGHT
Go to the Data tab of the table node. In the
Sort Criteria group box enter the fields by which you want to sort. In our example, this is the CARRID column. If you already sorted the table before you
passed it to the form, mark Aleady Sorted so that SAP Smart Forms does not have to sort the table again.
Before printing the table lines of an airline carrier, you must clear the summing fields. To do this, mark the checkbox
Event on Sort Begin for the criterion. In the navigation tree ( B) an event node appears whose inferior node you can use to clear the fields at the appropriate
event (program lines node C).
Within the loop calculate the subtotal. To do this, you need another program lines node (E).
To print the subtotal after finishing the items of an airline, mark the checkbox
Event on Sort End of the sort criterion. Another event node ( G) appears in the navigation tree, whose inferior node you can use to print the subtotal.
The facts explained above result in the following form logic:
Form logic for calculating a subtotal according to a criterion
Navigation Tree

Node
Attributes/Contents/Conditio
ns
Loop
:
internal table T_SFLIGHT
INTO GS_SFLIGHT

Sort criteria:
Field name: CARRID
Event on Sort Begin/End:
marked

CARRID Beginning of sort


level

Output parameters:
C
GT_SUBTOTAL ,
GS_SUBTOTAL .
Program lines:
REFRESH GT_SUBTOTAL.
CLEAR GS_SUBTOTAL.
&GS_SFLIGHT-PRICE&
D
Input parameter
: GS_SFLIGHT
Output parameter :

GT_SUBTOTAL

Program lines :
data: ls_sflight type sflight.
ls_sflight-price = gs_sflightprice.
ls_sflight-currency = gs_sflightcurrency.
collect ls_sflight into gt_subtotal.

&GS_SFLIGHT-CURRENCY&
F
CARRID End of sort level
G
Loop
:
internal table GT_SUBTOTAL
INTO GS_SUBTOTAL

&GS_SUBTOTAL-PRICE&
I
J

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

&GS_SUBTOTALCURRENCY&

Page 14 of 25

Result
The subtotal (for each airline carrier) is printed before a break in the sort level.

1.4 Delivery and Translation


Transport Object
SAP Smart Forms and Smart Styles are stand-alone development objects. This means that for every Smart Form and for every Smart Style a TADIR entry is
created. The corresponding transport objects are called
SSFO for Smart Forms (R3TR SSFO name)
SSST for Smart Styles (R3TR SSST name)
For creating and maintaining TADIR entries and transport objects, use the Transport Organizer as you would for any other development object. When creating
a Smart Form or a Smart Style, you must assign it to a development class. If the development class is not temporary, the Transport Organizer delivers the
Smart Form or Smart Style to other systems in the usual way.

Client-Independency
SAP Smart Forms and Smart Styles are client-independent objects.

Translating Texts
SAP Smart Forms and Smart Styles take part in the usual translation process for development objects. The transport objects SSFO and SSST are known to
the translation tools and appear in the relevant worklists. For a Smart Form, you can translate the following texts:
All long texts of nodes
The contents of all text nodes
To translate these texts, use the general procedures for translating long texts.

Master Language and Language Vector


When you create a Smart Form, the master language is your logon language. You create the form and any language-specific texts (descriptions, texts) in the
master language.
The language vector indicates the languages into which the form must be translated.

Standard Forms
Depending on the applications of the SAP System in which you want to use SAP Smart Forms, a number of standard forms is provided. Customers can adapt
any of these forms to their special requirements. However, since the system does not log modifications to the standard forms, the customers should copy the
standard form, modify this copy, and then link it to the application. This procedure prevents the loss of the modified data when, during an upgrade, an updated
version of the standard form is transferred.

1.5 Parameters of the Generated Function Module


The function module generated from a Smart Form provides a number of standard parameters. After you created a Smart Form these parameters appear
directly in the form interface of the Smart Form and cannot be changed. When you call the module from within your application program, you can use these
parameters, for example, to specify the output device (printer, FAX, e-mail) or to adapt the spool dialog.

Overview
From the function module's point of view there are import (kind K=
I ) and export parameters (kind K= E ):
Parameter Name

Type

Description

ARCHIVE_INDEX

TOA_DARA

ARCHIVE_INDEX_TAB

TSFDARA

SAP ArchiveLink parameter for


archiving forms (see also: Archiving)

ARCHIVE_PARAMETERS

ARC_PARAMS

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 15 of 25

CONTROL_PARAMETERS

SSFCTRLOP

Control structure for the general


control of the form putput (output
medium, output with/without dialog,
language, and so on)

MAIL_APPL_OBJ

SWOTOBJID

MAIL_RECIPIENT

SWOTOBJID

MAIL_SENDER

SWOTOBJID

Business Communication Interface


(BCI) parameter for sending forms as
e-mail (see also: Sending Forms as EMail or Telefax)

OUTPUT_OPTIONS

SSFCOMPOP

Structure with output options for


output to spool, as FAX, or in XSF
format

USER_SETTINGS

TDBOOL

If the parameter is set ('X'), SAP


Smart Forms copies the user defaults
for the Spool Control , which you set
under SystemUser Profile Own
Data ( Output Device, Print
Immediately, Delete after Output ). If
it is not set, SAP Smart Forms
instead evaluates the following
parameters of the structure for the
output options (
SSFCOMOP ):
Printer settings (
TDDEST , TDPRINTER ,
RQPOSNAME )
TDIMMED
(Print immediately)
TDDELETE
(Delete after output)

DOCUMENT_OUTPUT_INFO

SSFCRESPD

This structure contains nothing but the


TDFPAGES field of type TDFPAGES
, which contains the number of printed
form pages

JOB_OUTPUT_INFO

SSFCRESCL

After
form output you can use this structure
to query which actions produced
which results (see: Querying the
Output Result)

JOB_OUTPUT_OPTIONS

SSFCRESOP

This structure contains a subset of


the fields of
OUTPUT_OPTIONS : the fields that
the user is allowed to change. It
enables you to determine whether
your settings have been modified.

1.5.1 Default Settings (Standard Output)


If you select Standard Output as output format (see
Output in OTF Format), SAP Smart Forms fills the following standard parameters (parameters not mentioned below are initial):
Structure

Parameter Name

Value

(
Import Parameters)

USER_SETTINGS

'X'

Control Structure

DEVICE

'PRINTER'

LANGU

(Logon language)

TDSCHEDULE

'IMM' (Send Immediately)

TDSENDDATE

(Current send date)

TDSENDTIME

(Current system time)

TDARMOD

'1'
(Print only)

TDTITLE

'Print:'

TDNOARCH

'X'

TDDATASET

'SMART'

TDSUFFIX1

(Short name of the output device from user

Output Options
( Options for Fax Output)

Output Options
Spool Settings

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 16 of 25

settings)
TDSUFFIX2

(Logged user)

TDDEST

(Output device from user settings)

TDPRINTER
RQPOSNAME
TDIMMED

(Spool control from user settings)

TDDELETE
TDLIFETIME

'8'

TDCOPIES

1.5.2 Control Structure


Import parameter of the generated function module:
CONTROL_PARAMETERS
Component type: SSFCTRLOP
Back to Overview.
Parameter
Name

Component Type
Data Type(Length)

Description

NO_OPEN

TDSFFLAG
CHAR(1)

NO_CLOSE

TDSFFLAG
CHAR(1)

You use these parameters to


include several forms into one print request. When
calling the generated functions modules, set the
parameters as follows:
1st call:
NO_OPEN = SPACE.
NO_CLOSE = 'X'.
nth call:
NO_OPEN = 'X'.
NO_CLOSE = 'X'.
last call:
NO_OPEN = 'X'.
NO_CLOSE = SPACE .

DEVICE

TDDEVICE
CHAR(8)

Output device. Possible values: '


PRINTER ', ' TELEFAX ', ' MAIL '. If you do not
enter a vlaue in this field, SAP Smart Forms sends
the output to the printer (' PRINTER ' is default).

NO_DIALOG

TDSFFLAG
CHAR(1)

Suppresses all output dialog windows.


SAP Smart Forms requires an output
device, which you must specify either
statically in the form or in the user
profile or in the
TDDEST parameter or in the XSFOUTDEV
parameter of the Output Options. If you do not
specify an output device, SAP Smart Forms opens
the spool dialog even if NO_DIALOG is set.

PREVIEW

TDPREVIEW
CHAR(1)

If you specified
NO_DIALOG='X' , you can set this parameter to at
least branch to the print preview.

GETOTF

TDGETOTF
CHAR(1)

If this parameter is set, SAP Smart Forms only


returns the OTF table without printing, displaying, or
faxing the form. Therefore, you should use the
NO_DIALOG parameter to suppress the spool
dialog. The application program can use the field
JOB_OUTPUT_INFO-OTFDATA (export parameter)
to access the OTF table.
If you set the
XSFCMODE parameter (for XSF output) of the
Output Options, then this parameter is ignored.

LANGU

TDSPRAS
LANG(1)

Laguage in which to print the form.

REPLANGU1

TDSPRAS
LANG(1)

If the form does not exist in the language specified


in

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 17 of 25

REPLANGU2

TDSPRAS
LANG(1)

REPLANGU3

TDSPRAS
LANG(1)

STARTPAGE

TDOBJNAME
CHAR(30)

LANGU , SAP Smart Forms evaluates these fields


in the given sequence for the second choice.

Usually, the first draft page of the Smart Form is


the start page, with which the processing of the
form logic starts. You can use this parameter to
overrule this standard setting.

1.5.3 Output Options


Import parameter of the generated function module:
OUTPUT_OPTIONS
Component type: SSFCOMPOP
Back to overview.
This structure contains:
Options for fax output
Spool settings with options for:
Archiving (determining the storage mode)
Print preview (configuring functions in the print preview)
Name of the spool request
Spool control (print, delete, spool retention time, and so on)
Cover page
Page selection and copies
Options for XML/HTML output

The
URLCALL parameter is used internally only.

Static and Dynamic Settings


The Form Builder contains a range of form attributes that you can use to determine the
output format and possibly also the output medium, statically in the form. You find these attributes on the Output Options tab of the Form Attributes
node.
You can override these settings using the output options:
Overriding the Output Format
Desired Output Format

Settings for Overriding

Standard output

XSFCMODE = 'X'.
XSF = SPACE.
XDFCMODE = 'X'.
XDF = SPACE.

(OTF)
XSF

XSFCMODE = 'X'.
XSF = 'X'.
XDFCMODE = SPACE.

XSF+HTML

XSFCMODE = 'X'.
XSF = 'X'.
XSFFORMAT = 'X'.
XDFCMODE = SPACE.

XDF

XDFCMODE = 'X'.
XDF = 'X'.
XSFCMODE = SPACE.

After you have overriden the output format, SAP Smart Forms ignores all other static settings in the form as well. The table below shows which parameters
match which input fields in the Output box of the form attributes:
Matching Parameters for Static Attributes
Output Format

Input Field in Form

Parameter of Structure SSFCOMPOP


(possible settings)

XSF

Output mode
(for XDFOUTMODE='S')

XSFOUTMODE ('S'|'A')

Output device

XSFOUTDEV

Output mode

XSFOUTMODE ('A')

XSF+HTML

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 18 of 25

XDF

BSP page/URL

XSFACTION

Output mode

XDFOUTMODE ('S'|'A')

Output mode
(for XDFOUTMODE='S')

XDFOUTDEV

The default setting for the output format in the form is Standard Output (OTF) . For more information about the parameters for this
case, see
Default Settings (Standard Output).

1.5.3.1 Options for Fax Output


These options only apply when you set the
DEVICE parameter of the control structure to 'TELEFAX'. Instead of the spool dialog, SAP Smart Forms then opens a telefax dialog. You can preassign
values to the fields in this dialog using the TDTELELAND, TDTELENUM, TDSCHEDULE, TDSENDDATE, TDSENDTIME and TDARMOD fields (see Options
for Archiving ).
Back to:
Output Options
Options for FAX Output
Parameter Name

Component Type
Data Type(Length)

Description

TDTELELAND

LAND1
CHAR(3)

Country key, for example


'US'. Used for automatic determination of country
code.

TDTELENUM

SKTELNR
CHAR(30)

Telecommunications partner. For information about


the format, see the documentation for data element
SKTELNR.

TDTELENUME

SKTELNR
CHAR(30)

Telecommunications partner. For information about


the format, see the documentation for data element
SKTELNR.

TDFAXUSER

SO_USR_NAM
CHAR(12)

Name of the SAPoffice user

FAXFORMAT

CHAR3
CHAR(3)

Field of length 3 bytes

TDSCHEDULE

SKSCHEDULE
CHAR(3)

Scheduled for sending:

TDSENDDATE

SKDATE
CHAR(8)

Desired send date

TDSENDTIME

SKTIME
CHAR(6)

Desired send time

'IMM': immediately
'NIG': at night

For more information, see the


SAPconnect documentation.

1.5.3.2 Spool Settings


You can use the following parameters to adjust the
spool processing dialog on an application-specific basis and to preassign values in dialog.
Back to:
Output Options
Options for Archiving
The Spool Control box is located in the spool dialog window. It contains a combo box that allows the user to choose the archiving mode ( Print only , Archive
Only , Print and Archive ). The parameters in the table below refer to this combo box.
Parameter Name

Component Type

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Description

Page 19 of 25

Data Type(Length)
TDARMOD

SYARMOD
CHAR(1)

Presets the value of the combo box:

TDNOARMCH

TDNOARMCH
CHAR(1)

If set, the user can no longer change the preset


value in the combo box.

TDARCCOP

TDARCCOP
CHAR(1)

Indicates whether copies are to be archived

Parameter Name

Component Type
Data Type(Length)

Description

TDTITLE

TDTITLE
CHAR(50)

Title in dialog window

TDNOPREV

TDNOPREV
CHAR(1)

No print preview. Suppresses the relevant


pushbutton.

TDNOPRINT

TDNOPRINT
CHAR(1)

No printing from within print preview. Deactivates


the relevant pushbutton.

TDNOARCH

TDNOARCH
CHAR(1)

No archiving from within print preview. Deactivates


the relevant pushbutton.

TDIEXIT

TDIMMEXIT
CHAR(1)

Usually, the user can print or fax from within the


print preview without exiting it. If this parameter is
set, the system terminates the spool dialog and
returns control to the application after the printer
icon has been chosen.

'1': Print Only


'2': Archive Only
'3': Print and Archive

See also:
Archiving.
Options for Print Preview

Texts for Spool Request


Use these parameters to fill in the input fields in the Spool Request box of the spool dialog.
Parameter Name

Component Type
Data Type(Length)

Description

TDDATASET

RSPO0NAME
CHAR(6)

TDSUFFIX1

RSPO1NAME
CHAR(4)

These parameters preset the three parts of the


Name input field. For more information, see the F1
help in the dialog or the documentation for the
relevant data element.

TDSUFFIX2

RSPO2NAME
CHAR(12)

TDCOVTITLE

SYPRTXT
CHAR(68)

Presets the Title input field. This text also


appears on the cover page (see below).

Parameter Name

Component Type
Data Type(Length)

Description

TDDEST

RSPOPNAME
CHAR(4)

TDPRINTER

RSPOPTYPE
CHAR(8)

Short name of the output device (


TDDEST), short name of the device type
(TDPRINTER), and long name of a printer in the
host system (RQPOSNAME ). For more
information, see the documentation for the relevant

RQPOSNAME

RSPOPRNAME
CHAR(50)

Options for Spool Control

data elements and the


CCM-PRN).

SAP Printing Guide (BC-

If the
USER_SETTINGS parameter of the control
structure is set, these parameters are ignored.
TDNEWID

SYPRNEW
CHAR(1)

Presets the checkboxes in the Spool Control box


of the spool dialog:

TDIMMED

SYPRIMM
CHAR(1)

TDDELETE

SYPRREL
CHAR(1)

TDFINAL

RSPOFINAL
CHAR(1)

TDNEWID
: New Spool Request
TDIMMED
: Print Immediately
TDDELETE
: Delete after Printing
TDFINAL
: Spool Request Completed

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 20 of 25

If the
USER_SETTINGS parameter of the control
structure is set, the TDIMMED and TDDELETE
parameters are ignored.
TDLIFETIME

SYPEXPI
CHAR(1)

Presets the Spool Retention Time in days.

TDAUTORITY

SYPRBER
CHAR(12)

Presets the Authorization field in the Spool


Request box. If this field contains an authorization,
only users with the specified authorization are
allowed to display the contents of the spool
request. For more information, see Note 29666.

Parameter Name

Component Type
Data Type(Length)

Description

TDCOVER

SYPRSAP
CHAR(1)

Controls the setting of the combo box for the cover


page:

Options for the Cover Page

SPACE
: no cover page is printed
'X'
: cover page is printed
'D'
: default (printer setting)
TDRECEIVER

SYPRREC
CHAR(12)

Text output on the cover page for the Recipient


field

TDDIVISION

SYPRABT
CHAR(12)

Text output on the cover page for the Department


field

Parameter Name

Component Type
Data Type(Length)

Description

TDCOPIES

TDSFCOPIES
NUMC(3)

Presets the Number input field in the Copies


box.

TDGROUP

TDGROUP
CHAR(1)

Sets the Group (1-1-1, 2-2-2, 3-3-3) checkbox in


the Copies box.

TDPAGESLCT

TDPAGESLCT
CHAR(60)

Presets the Page Selection input field.

Page Selection and Copies

1.5.3.3 Options for XML/HTML Output


Besides the standard format for print output (OTF), SAP Smart Forms offers the following
output formats:
XSF (XML for Smart Forms), see
Output in XSF Format
HTML (Hypertext Markup Language, see
Output in HTML Format
XDF (XML Data for Forms), see
Output in XDF Format.
The parameters below refer to these output formats. It is not possible to generate several different output formats in one call of the generated function module.
Back to:
Output Options

Options for XSF Output


Parameter Name

Component Type
Data Type(Length)

Description

XSFCMODE

SSFXSFCMOD
CHAR(1)

Use this parameter to determine which settings you


want to evaluate for XSF:
XSFCMODE = SPACE
: SAP Smart Forms copies the static settings in
the form, see Output Options. The XSFFORMAT

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 21 of 25

parameter is set automatically for HTML output


(see below).
XSFCMODE = 'X'
. Instead of the static settings, SAP Smart Forms
evaluates the parameters XSF, XSFOUTMODE,
and XSFOUTDEV.
This parameter does not determine whether there is
an XSF output, but rather whether the settings
made in the form or those made in this structure
are evaluated.
XSF

SSFXSF
CHAR(1)

If set and if
XSFCMODE = 'X' (see above), the generated
output is XSF, otherwise it is OTF or XDF. You
cannot have more than one output format at the
same time. For an output in HTML format, XSF
output must have been activated.

XSFOUTMODE

SSFXSFOMOD
CHAR(1)

Use this parameter to specify the output mode:

RSPOPNAME
CHAR(4)

Prerequisite:
XSFOUTMODE = 'S'.
Determines the output device in the spool (usually
a printer name of type
XSF). If TDDEST is filled as well, the system
ignores XSFOUTDEV.

XSFOUTDEV

XSFOUTMODE=A
(Application): You get XSF output using the export
parameter JOB_OUTPUT_INFO-XMLOUTPUTXSFDATA.
XSFOUTMODE=S
(Spool): SAP Smart Forms creates a spool request
for XSF output and returns its ID using the export
parameter JOB_OUTPUT_INFO-SPOOLIDS.
See:
Querying the Output Result.

Output in HTML Format


Output in HTML format enables you to develop
Web forms for Internet applications. The following parameters only have an effect if XSF output was activated before (see below).
Parameter Name

Component Type
Data Type(Length)

Description

XSFFORMAT

SSFXSFFRMT
CHAR(1)

Prerequisite:
XSFOUTMODE = 'A'.
If set, SAP Smart Forms uses an XSLT program to
create CSS and HTML output, in addition to XSF.
The CSS style sheet is embedded in the HTML
output. See:
Output in HTML Format and XML/HTML Output
Structure.

XSFACTION

SSFACTION
CHAR(255)

Prerequisite:
XSFFORMAT = 'X'.
Determines the URL to which you want to pass the
values of the HTML form. See also:
Evaluating Form Input.

Options for XDF Output


The XDF document contains all data that you pass at the interface of the Smart Form.
Parameter Name

Component Type
Data Type(Length)

Description

XDFCMODE

SSFXDFCMOD
CHAR(1)

Use this parameter to determine which settings you


want to evaluate for XDF:
XDFCMODE = SPACE
: SAP Smart Forms copies the static settings in
the form (see Output Options).
XDFCMODE = 'X'
. SAP Smart Forms evaluates the parameters XDF,
XDFOUTMODE, and XDFOUTDEV instead of the
static settings.
This parameter does not determine whether there is
an XDF output, but rather whether the settings
made in the form or those made in this structure
are evaluated.

XDF

SSFXDF

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

If set and if

Page 22 of 25

CHAR(1)

XDFOUTMODE

XDFOUTDEV

XDFCMODE = 'X' (see above), the output is XDF,


otherwise it is OTF or XSF. You cannot have more
than one output format at the same time.

SSFXDFOMOD
CHAR(1)

Use this parameter to specify the output mode:

RSPOPNAME
CHAR(4)

If you have set


XDFOUTMODE to 'S', you can use this parameter
to specify an output device for the spool output
(usually a printer name of type XSF). If TDDEST is
filled as well, XDFOUTDEV is ignored.

XSFOUTMODE=A
(Application): You get XDF output using the export
parameter JOB_OUTPUT_INFO-XMLOUTPUTXSFDATA (this is not a typing error!).
XSFOUTMODE=S
(Spool): SAP Smart Forms creates a spool request
for XDF output and returns its ID using the export
parameter JOB_OUTPUT_INFO-SPOOLIDS.
For XDF output, SAP Smart Forms creates a spool
request and returns its ID using the export
parameter
JOB_OUTPUT_INFO-SPOOLIDS.
See:
Querying the Output Result.

1.5.4 Querying the Output Result


Export parameter of the generated function module:
JOB_OUTPUT_INFO
Component type: SSFCRESCL
Back to Overview.
Parameter Name

Component Type
Data Type(Length)

Description

OUTPUTDONE

TDOUTDONE
CHAR(1)

If set, output of the form has been executed


(printer, fax, mail)

ARCHDONE

TDARCDONE
CHAR(1)

If set, archiving has been executed

USEREXIT

TDEDEXIT
CHAR(1)

Last executed user function:

TDFORMS

TDSFFORMS
NUMC(5)

Number of printed forms. This number is larger than


1 only if you included several forms into one spool
request using the parameters
NO_OPEN and NO_CLOSE of the control structure
(see also: Printing Several Forms in One Print
Request.

TDNEWID

SYPRNEW
CHAR(1)

The New Spool Request parameter was set before


printing, so that a new spool ID was created.

SPOOLIDS

TSFSPOOLID

Table containing spool IDs

FAXIDS

TSFFAXID

Table containing fax IDs

MAILIDS

TSFMAILID

Table containing mail IDs

OTFDATA

TSFOTF

Table containing OTF output

XMLOUTPUT

SSFXMLOUT

XML/HTML output structure

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

'B'
: Back button (green arrow)
'E'
: Exit button (yellow arrow)
'C'
: Cancel button (red cross)
SPACE
: Other function

Page 23 of 25

1.5.4.1 XML/HTML Output Structure


XML output is controlled using the
Options for XML/HTML Output in the Output Options.

Overview

Smart Forms generates the tables shown in blue during the


HTML output. The TrfResult structure (at the top right of the diagram above) contains the HTML that can be displayed in the browser. The CSS style sheet is
embedded into this HTML.

Components
XML Output Structure
Structure XMLOUTPUT (Type: SSFXMLOUT)
Parameter Name

Component Type
Data Type(Length)

Description

XSFDATA

TSFIXML
Table of
RAW(1024)

XSF output or XDF output in binary format without


layout information. The output is encoded according
to ISO 10646 (UTF-8).

XSFLENGTH

TDIXMLLEN
INT4(10)

Length of the XSF or XDF output.

XSFTYPE

SFHTTPTYPE
STRING

MIME type of the XSF or XDF output.


Default value: text/xml.

XSFDOCPTR

SSFDOCPTR
Ref To
IF_IXML_DOCUMENT

Reference to an iXML document for XSF or XDF


output, which concurs with the Document Object
Model (DOM). See:
XML Library.

STSHEET

SSFSTYLS

CSS style sheet for formatting the Web form (see


below).

TRFRESULT

TRFRESULT

HTML output with embedded CSS style sheet (see


below).

CSS Style Sheet (STSHEET)


Structure StSheet (Type: SSFStyls) in the Output Structure
Parameter Name

Component Type
Data Type(Length)

Description

FMTNAME

STRING

Contains a generated GUID for the CSS style


sheet, for example
E587886A3852424EAD11E6BEE1ADF467.css.

FMTTYPE

SFHTTPTYPE
STRING

MIME type of the CSS style sheet.


Default value: text/css.

FMTCONTENT

TSFSTBODY
Table of
STRING

CSS style sheet in ASCII format.

FMTLENGTH

TDIXMLLEN
INT4(10)

Length of the CSS style sheet.

HTML Output (TRFRESULT)


Structure TrfResult (Type: TrfResult) in the Output Structure
Parameter Name

Component Type

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Description

Page 24 of 25

Data Type(Length)
TYPE

SFHTTPTYPE
STRING

MIME type of the CSS style sheet.


Default value: text/html.

CONTENT

TSFIXML
TABLE OF
RAW(1024)

HTML with embedded CSS style sheet.

LENGTH

TDIXMLLEN
INT4(10)

Length of the HTML output.

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 25 of 25

Você também pode gostar