Smartform Learning
Smartform Learning
You can design and print forms in a SAP System using the Smart Form Technology.
Your ABAP program calls a smart form and then to print, spools are generated. You can
embed texts, images and other elements like barcodes in smart forms. SAP Smart Forms
is an advanced version of SAP Script Forms and replaces scripting in a SAP system for
form printing and integrating the output in an HTML format.
You can use different output formats in a Smart Form, some of these include –
Printing
Email
Fax or
Sending it over the internet in a HTML/XML output format.
A Smart Form tool allows you to modify forms by using simple graphical tools instead of
using any programming tool. This means that a user with no programming knowledge can
configure these forms with data for a business process effortlessly.
In a Smart Form, data is retrieved from static and dynamic tables. The table heading and
subtotal are specified by the triggered events and the data is then sorted before the final
output. A Smart Form allows you to incorporate graphics that can be displayed either
as a part of the form or as the background. You can also suppress a background graphic
if required while taking a printout of a form.
The SAP Smart Forms have been surprised with the use of interactive forms from Adobe.
Some examples of this standard Smart Forms available in a SAP System are as follows −
SF_EXAMPLE_01 represents an invoice with a table output for flight booking for
a customer.
In SAP Scripting, you must write the print program. However, in a Smart Form it
is not required to write a print program.
SAP Scripts are client dependent. However, Smart Forms are client independent.
You can create Smart Forms without using the main window. However, it is not
possible with the use of Scripts.
1
SAP Smart Forms
In SAP Scripting, you can use up to 99 main windows. However, in a Smart Form
it can have one main window.
When you activate Smart Forms in a SAP system, it generates the function module.
However, it is not generated in case of Script Execution.
It is also possible to create and design web forms using Smart Forms, but you
cannot design web forms using script.
The Smart Form concept is completely based on Graphical User Interface. However,
scripting includes some programming.
You can create, change and display a smart form using Transaction
SMARTFORMS. To style the smart forms, you can use Transaction
SMARTSTYLES. To write a SAP Script, use Transaction Code: SE71 to open form
painter and SE72 to add different style of texts and font in the Script Forms.
It is possible to maintain background graphics using Smart Forms, but not possible
with SAP scripting.
To design a smart form layout in a SAP system, use Transaction Code: SMARTFORMS
2
SAP Smart Forms
When you activate smart forms, it automatically generates function modules at the
runtime.
You can add background graphics to smart forms which can be displayed as a part
of the form.
You can display table structures and dynamic text framing using smart forms. You
can use SMARTSTYLES to add colored texts, images, barcodes, etc.
It is easy to make changes to the existing smart forms using drag/drop or cut/paste
feature. This doesn’t required you to enter script coding for making changes.
You can convert SAP Script forms to smart forms but vice versa is not possible.
3
SAP Smart Forms
The dynamic formatting of the form depends on the form logic that allows you to add the
conditional text in the form layout, which is displayed only when a certain condition is met.
You can define variable fields as per the condition type – first dunning use this text and
second dunning use other text and so on to process dynamic formatting.
Different form types can be created in a SAP System using smart forms and you can add
conditional text and different layouts as per the requirement.
Invoices
Account Statements
Salary Statement
Quality Forms
Checklist
Order Processing
Order Confirmation
Delivery notes and many more
In the next chapter, we will discuss in detail about the architecture of SAP Smart Forms.
4
2. SAP Smart Forms – Architecture
SAP Smart Forms
In a SAP Smart Form, you have multiple components where application data is different
from form definition. When a smart form is activated, a function module is generated and
data is retrieved from the database.
Form Layout: The form layout defines the position of elements on the pages and
where the objects will be displayed in the form output.
Form Logic: Form logic defines the data to be read from the database, to define
the condition and to control the flow of the form output.
Form Interface: A form interface in SAP smart form is used to transfer the
application data to form definition.
In the above image, you can see the Smart Form Architecture. When a smart form is
activated, a function module is generated. When application program calls the functional
module, the module interface is used to transfer the table data as per the form description
and to print the form.
5
SAP Smart Forms
You can also embed statements in the form description to select the data for form
processing. But, this is not recommended when you have to print the mass forms results
performance degradation.
It is also possible to print the data as tables on the form and to be merged with the
application data with the smart form. A single call to a smart form always generates one
form for printing. A different output type can always be selected such as – Fax, Print, email
or in HTML/XML format to a web browser.
6
3. SAP Smart Forms – StructureSAP Smart Forms
A smart form consists of multiple pages. There are different graphics such as the header
and company logo, while output areas and text to be displayed is in the output. You can
use the dynamic table structure to show the data or texts in the column, cell format, etc.
A common smart form example is a customer invoice for flight booking. The price details
with the flight booking is shown in the table in the main window and other windows contain
different elements like the company name logo, address of the customer and other
company or customer specific details.
The first page of the flight booking invoice contains booking company details, customer
letter if any and a table containing number of booking items. The table type is dynamic
and its length depends on the number of booking items in the table. The table header
includes column headings –
Serial number
Ticket number
Sectors
Flight name or number
PAX (passenger/s) name, etc.
While the table footer contains – the amount in Rupees, Net amount, etc.
7
SAP Smart Forms
When the table continues to the second page due to more number of items, the table
header and footer repeats on the next page as well. The page layout of this smart form
defines the page structure as A4, while A5 is the position of windows with data to be
displayed on each page.
Change
Display
Create
Enter the Form name and click on the Create button as shown in the following screenshot:
8
SAP Smart Forms
When you click on the Create button, this will open the SAP Form Builder screen which
is divided into three parts:
On the left side, you have a Navigation Window. This window contains all the elements
such as – text and graphics, which are part of a SAP Smart Form. You can see the hierarchy
of nodes and sub-nodes under the Navigation pane.
In the middle, you have a Maintenance Window. This window is used to set the attribute
value of each element in a smart form. You can define Output Options such as:
Position and Size (Left Margin, Upper Margin, Width, and Height)
Box and Shading
Frames
Shading, etc.
The Preview and Conditions tab includes – Field Name and Comparison Value.
9
SAP Smart Forms
On the right side, you have the Form Painter. A Form Painter defines the layout of the
page in a SAP smart form. When you create a smart form in a SAP system, a functional
module is generated. Under the Navigation pane, you have to two folders by default in
each form, these are:
Global Settings
Pages and Window
Global Setting
It contains the global settings of the smart form, such as:
Form Attributes
Form Interface and
Global Definitions
In the Form Interface, you can see all the data passed to the smart form from the print
program. While, the Global Definition contains the data that can be used throughout the
smart form.
10
SAP Smart Forms
Page
Window
Graphic
Address
11
SAP Smart Forms
The printing of a smart form takes place as per the next page field. While, the processing
of a smart form depends on the sequence defined under the Navigation pane.
Landscape
Portrait
A4 Size
A5 Size, etc.
You can have a different structure for each page in a smart form. As an example, the first
page can contain address, about company, logo, terms of business or any other
information that should come on the first page.
In a smart form, you need to define the next page for each page and a clear page
sequence. You can also call the same page multiple times to make the output recursive.
The page break is defined in the form logic using manual coding or you can also define it
via the main window and the sub window.
Each page contains two types of output areas, which are – Main window and Sub window.
These windows can be placed anywhere on the page and you can even overlap them. A
single window can be used on multiple pages.
12
SAP Smart Forms
13