You are on page 1of 61

Introduction to

SMARTFORMS

Page 1 of 61

Table of Contents

INTRODUCTION
PURPOSE OF THIS INTRODUCTION.
WHO WILL BENEFIT.
PREREQUISITES
REFRESHER ON SAPSCRIPT
SMART FORMS: WHAT IS IT?
SMARTFORMS VS SAP SCRIPT
MAIN ADVANTAGES OF SMART FORMS
FEATURES INTRODUCED BY SAP IN SMART FORMS
ARCHITECTURE OF SAP SMARTFORM
HANDS ON SCREEN SEQUENCE
SMARTFORMS..
PAGE AND WINDOWS
SMARTSTYLE
TEMPLATE
CONFIG SETTING...
REFRESHER ON SMARTFORMS : SUMMARY

Page 2 of 61

3
3
3
3
3
4
4
4
5
7
12
28
38
54
58

Introduction
Purpose of this Introduction
This introduction is intended to allow a quick entry into the work with the Smart Forms. SAP introduced
SmartForms in 1998 to overcome the limitations in SAP Scripts. This document would help a beginner to
start from scratch and generate his own Smart Forms. There is a self help screen sequence to guide the
beginners to create Smartforms of their own and gain confidence
Who will benefit
All SAP users. Most of the new projects would be using this technology. Clients would increasingly
demand smartforms to be used rather than sapscript.
Prerequisites
The user should know SAP Script. In this document I would briefly compare SAP script with SAP SMART
Forms, highlighting the prominent features before moving on to how to work with SMART Forms, which is
our focus.
Refresher on SAP Script

SAP Script is SAP text management and form printing tool. By this we make an output look beautiful
which is cumbersome to do by a report program.
SAPscript consists of the following components:
An editor for entering and editing text Styles and forms for designing the print layout
A composer, which is the central module for output formatting
A programming interface for integrating SAPscript components in your own application programs
and programming the output using forms
Various database tables for storing texts, styles and forms

NOTE

WE
WE can
can insert
insert picture
picture or
or Logo
Logo (Company
(Company Logo)
Logo) in
in the
the output,
output, which
which is
is not
not possible
possible by
by report
report
program.
program.

Smart Forms: What is it?


We use SAP Smart Forms to create and maintain forms for mass printing in SAP Systems. SmartForms are
easier to develop, maintain and transport than SAP Script.
As output medium SAP Smart Forms support a printer, a fax, e-mail, or the Internet (by using the generated
XML output).In addition to the tool, SAP delivers a selection of forms for central business processes like
forms in the applications SD,FI, HR and CRM of the R/3 Release.
Page 3 of 61

SmartForms Vs SAP Script


Multiple page formats are possible in smartforms which is not the case in SAPScripts
It is possible to have a smartform without a main window.
Labels cannot be created in smartforms.
Routines can be written in smartforms tool.
Smartforms generates a function module when activated.
Main Advantages of Smart Forms:
SAP Smart Forms offer the following advantages:
Creating and maintaining forms requiring half the time
Adapting forms without any programming knowledge due to entirely graphical user interface
Web Publishing using the generated XML output
The SAP Smart Forms has replaced the SAPscript forms. SAPscript forms will also be supported in the
future; you can use them without making any changes for years to come. You can use SAPscript texts in the
Smart Forms. Migration of SAPscript forms into Smart Forms is supported.
Features introduced by SAP in Smart Forms:
The smart forms allow the user to execute simple modifications to the form and in the form logic by
using simple graphical tools.
To print a form the user will need a program for the data retrieval and a smart form that contains the
entire form logic. As these two are separate we should adapt the smart form if changes to the form logic is
necessary. The application program passes the data via a function module interface to the smart form. When
activating the smart form the system automatically generates the function module and at the runtime
process this.
The user designs the form using the graphical form painter and the graphical table painter. The form
logic is represented by the hierarchical structure that consists of individual nodes, such as nodes for global
settings, nodes for texts, nodes for output tables or nodes for graphics. To make any changes we have to use
the Drag&Drop, Cut&Paste. These actions do not include writing of coding lines or using a script language.
For web publishing, the system provides a generated XML output of the processed form.
We can insert static and dynamic tables. These include the line feeds in the individual table cells,
triggering events for table headings and subtotals and sorting data before output.
The smart forms allow the user to include graphics, which can be displayed as a part of the form or as
background graphics. During printout the user can suppress the background graphic as and when necessary.
The smart forms also supports the postage optimizing.

Page 4 of 61

Architecture of SAP Smart Form : Schematic Flow


Data Retrieval

SMART
SMART
FORM
FORM

APPLICATION
PROGRAM
Activat
e

Database
Selection

Function
Module
Call
ABAP
FUNCTION
MODULE
Later
Selection

Database
Form Description

OUTPUT
OUTPUT
(Printer)
(Printer)

Page 5 of 61

In a smart form we describe:


The layout of the form (element positions on a page).
Individual elements to be displayed, for ex: text, graphics, addresses, tables etc.,
The form logic, for example to read the application data from internal tables, to introduce conditions
and to control the process flows.
A form interface to transfer the application data to form definition.
When a smart form is activated , the system generates a function module that encapsulates all the attributes
of the smart form.
As soon as the application program calls the function module, the smart form uses the module interface to
transfer any table data previously selected and to print the form according to the form description.
All these will become clearer once we go through the self help screen sequence in the subsequent pages.

Page 6 of 61

Hands on Guide: This is a self-help guide lucidly illustrated with tips, meant for beginners.
We first go to SAP Menu: The path is SAP Menu Tools Form Printout Smart Forms
The transaction code (T code): Smart Forms

click

Lets use forms starting with BC as SAP has created these for training purposes.

Page 7 of 61

Lets use BC470_FLOWS to demonstrate the various elements of Smart Forms.

click

We now arrive at the Display Form screen, which is divided, into 3 main sections:
Navigation window, Form painter and Maintenance window. We will discuss each of these in detail

Navigation window consist of nodes and sub nodes. They contain all the elements (text, window
etc) that belong to sap forms.
Page 8 of 61

Maintenance window shows attributes of the elements


Form printer window shows the layout of the page.

Global setting is at the form level. You can access these from anywhere in the smart form
You can change the language by changing this field in Form Attribute: this will change the text
language (but not the layout).

NOTE

SAPscript
SAPscript does
does not
not allow
allow changing
changing the
the language.
language. SAP
SAP FORMS
FORMS gives
gives the
the user
user
this
this option.
option.
Also
Also whenever
whenever we
we create
create smart
smart forms,
forms, SAP
SAP creates/generates
creates/generates aa function
function module.
module.

Form interface tells us what are the import and export parameters, exceptions, tables etc that we
pass to the function module. These we can add but we cannot change/modify the default values
Page 9 of 61

Lets add a Global Database for practice. I have created NUMC_DATE through TYPES

new type created in TYPES

Page 10 of 61

Global definition is what we define in smart form. We can define our own variable, constants etc. that we
can access in the code that we write. Here we would use we of the types, which we have defined earlier
(char_fifteen) to declare CLERK.
What we created in
Types is being used to
declare a variable.

Diff between TYPE and TYPES


TYPES: What we create: char, constants etc. TYPE is used to choose from standard SAP data type
Page 11 of 61

Pages and Windows


In smart form, page is at the highest level: SAP processes the first page, next page and then Terms
General Terms and Conditionsif u wish to change the order, just drag and drop the sequence.

1 OF 10 ETC

initialize or increase counter


Page 12 of 61

Conditional breaknext page of next page become term page (SAP stops processing /
execution of this page)

U can define print mode globally for all the pages instead of declaring this at each page

Page 13 of 61

Now lets create our own smart form Lets copy a standard smart form [BC470_FLOWS]of SAP
and create ZBC470_FLOWS_AVID. Then we would play around with its different elements.

Lets create a new page in our object.

Page 14 of 61

This is the page we created. Lets name it as Test1.

I have changed the sequence by dragging and drop. Now Test1 appears before the First Page.

NOTE

Printing
Printing will
will take
take place
place on
on the
the basis
basis of
of next
next page
pagefield.
field.
Page
15the
of sequence
61
But
processing
will
happen
as
per
in
navigation
But processing will happen as per the sequence in navigation window!
window!

For background picture and graphics you can pick up either black and white or color bitmap images and are
stored in the form of standard texts. We take a detour from the smartform screen and open Form Graphics
screen. Transaction code: Se78

Now lets go back to the main screen Background Pic

Page 16 of 61

Here there are 3 options : Black and white, color and dynamic bitmap pictures. We name the background
picture and choose the determine dynamically option.

Note: Runtime color .use the field with ampersand.


Page 17 of 61

Now after the Page, we create a new Window. There will be output options, attributes and conditions in
each window.

Page 18 of 61

Cannot use main in this field because SAP creates Main by default and doesnt allow main as name.

Difference in Main and Secondary Windows in a Form

NOTE

We
We cannot
cannot have
have more
more than
than 11 main
main window
window in
in aa page.
page. We
We can
can have
have multiple
multiple
secondary
windows
secondary windows
Whatever
Whatever uu print
print in
in secondary
secondary windowit
windowit has
has to
to be
be static.
static. (If
(If uu have
have 20
20 lines
lines in
in
aa PO
PO and
and there
there is
is page
page constraint
constraint the
the lines
lines get
get carried
carried forward
forward to
to next
next page
page in
in the
the
main
main window.
window. i.e.
i.e. In
In aa predecessor
predecessor and
and successor
successor type
type of
of content,
content, they
they will
will be
be
printed
printed in
in sequence
sequence in
in main
main window.
window. This
This is
is not
not allowed
allowed in
in Secondary
Secondary windows.
windows.

Page 19 of 61

You can have only we main page which u can stretch to multiple pages (you can copy and stretch it) but
you can have multiple secondary windows.

Inside the main window we can add text as introduction to customize the form output. In Smart Form
what you see is what you get.

Page 20 of 61

In the output, we have the option of sizing and positioning the main window along with different
shading and color choices.

We can have conditions.to be executed at run time We take an example to illustrate this.
Page 21 of 61

By default this will be AND.

Page 22 of 61

NOTE

Some
Some practical
practical examples
examples of
of conditions
conditions in
in aa window
window in
in Form
Form could
could be
be that,
that, on
on the
the
first
page,
we
want
the
Company
Logo
and
address
of
customer
but
on
first page, we want the Company Logo and address of customer but on
subsequent
subsequent pages
pages we
we dont
dont want
want customer
customer address.
address. Similarly
Similarly we
we may
may wish
wish to
to
have
have signature
signature only
only at
at the
the last
last page.
page. Appropriate
Appropriate conditions/flow
conditions/flow logic
logic can
can be
be
inserted
inserted here
here to
to take
take care
care of
of these
these situations.
situations. We
We can
can give
give flow
flow logic
logic for
for both
both
main
main and
and secondary
secondary windows.
windows.

Now we come to the last part of the Pages and Window Section i.e. the Address element.
Note: CAM = Central Address Management
e.g. Based on the country, we may take country specific format (e.g. in US the ZIP code is must, while
in India it is not a mandatory field.)

Page 23 of 61

Lets create a new address. It can be of 4 types: Personal, Official, Organization address or it may be
determined during runtime based on the selection parameter (Dynamically determined).

U need to find address number only and everything else will be populated
The attributes could be of 3 types: Text element, Include Text and Text module

We would then fill up text name: static or dynamic, text object (e.g. TEXT) and text id (e.g. ADRS)

Page 24 of 61

We then number the pages in the footer space provided

and write our code as text element.

Page 25 of 61

we can use the System Fields in Data Dictionary table SFSY compwents while writing
the logic for Smartform

Lets add a new text element TXT1 choosing appropiate paragraph and character formats.

Page 26 of 61

We can have our own smart style : paragraph as well as character formats. Lets check out a standard
style before creating our own!

The header data in each smart style allows us to configure font size, line and character spacing.

SAP provides different paragraph formats for standard, header and footer, centered and totals.
Page 27 of 61

Lets create a paragraph AV (which is deleted after the exercise).

Page 28 of 61

Now it comes in the form as the menu of Paragraph Formats in the SAP Smart Form.

Note : AV has come in the menu. Alignment is as per the paragraph format AV.

Page 29 of 61

NOTE

The
The newly
newly created
created paragraph
paragraph font
font (e.g.
(e.g. AV)
AV) wont
wont be
be part
part of
of global
global settings.
settings. If
If
we
change
the
form
attribute
-
output
options--
and
style
to
some
other
we change the form attribute - output options-- and style to some other
style
style (like
(like from
from BC470
BC470 to
to BC
BC 470_STYLS)
470_STYLS) this
this option
option would
would no
no longer
longer be
be
there.
there.

Lets create a new style (ZBC470_avi) with 2 paragraph formats and we character format

Page 30 of 61

Now I mention in form attribute my own style

I check out my output in the next page form.

Page 31 of 61

When you create a table, SAP automatically creates 3 areas: Header, Main and Footer. In Main Area,
there are many cells, which are processed record by record.

Click

In Main Area, we create different cells. In Table painter, we draw the format as per client requirement (e.g.
Heading, Sub Heading, Item, Sub Total, Grand Total etc.)
We use the table layout to determine:
The number of lines and cells
The height of each line
The width of each cell
The alignment of the table in the window
Whether and where to display separator lines or frames
We can either draw the table by visual aid or we can click on details button and set the area allotted to each
cell by filling in the measurements.

Page 32 of 61

Click

Page 33 of 61

In Data Painter, we can process the data before displaying it in SMARTFORM. SAP provides us with
the option of putting some basic logic. E.g. Loop, Where condition, Option of Row-by-Row selection,
Sort Condition, At the end of table processing: Events (provided by SAP).

Page 34 of 61

For easy navigation and access, SMARTFORM provides Field List option. We can activate that by
Utilities- Field List on/off.

We can put conditions/logic by putting ABAP code inside bookings main area, Program Lines. Here
we first declare the input and output parameters.

Page 35 of 61

Here we put the text element as per paragraph and character format. We may have a text which is
determined during run time (dynamic).

Now lets create our own table. Here we can put logic as per client requirement.

Page 36 of 61

NOTE

TEMPLATE:
TEMPLATE: Template
Template is
is used
used when
when we
we know
know the
the exact
exact size
size of
of the
the output
output or
or
the
the output
output is
is in
in aa fixed
fixed format.
format. E.g.
E.g. Tax
Tax form/
form/ cheques
cheques /airline
/airline form/railway
form/railway
ticket:
ticket: all
all these
these use
use templates.
templates.
Diff
Diff between
between table
table and
and template:
template: In
In Table
Table the
the height
height changes
changes dynamically.
dynamically.
We
call
a
row
a
line
in
template.
We call a row a line in template.

Whenever you wish to write your code in SAP Smartform, you have to create the proper flow logic. We use
command to code any conditions for going to the next page

Page 37 of 61

This is to terminate the current page and start processing the new page.

Page 38 of 61

In Smartform, We can process our own logic. We can call some table, select some data do standard data
manipulations through this. In navigation wndow, First Page-- Main Window -- Create -- Flow
Logic -- Program line. But it is advisable not to write programs here as it slows down the process. It is
advisable to write the code in print program.

This is very similar to table. If you wish to dynamically determine the output, we can loop at internal table

Page 39 of 61

Flow Logic: Alternative: In this we can embed If - else kind of logic.

Page 40 of 61

If what we type here is True then it will get processed under the True button.
We next explore another feature of Smartform: Folder

Folder is used to modularize the navigation; it has nothing to do with technical thing. The order you
mention in the folder is the order that SAP will process.
Page 41 of 61

There is an option given in Smartforms. We can migrate old SAPscripts to smartforms.


Note: We should check the text elements and make sure the flow logic works in the new format.

Here I am migrating a previously created SAP script to Smartform.

Page 42 of 61

In Function Module screen, (se37)

To get the function module name, after saving and activating the form, go to Environment function
module name. This function module name has to be given in the main program to call the form.
Else go to function module SSF_FUNCTION_MODULE_NAME and give the name of the program.

In
In the
the print
print program
program mentiwed
mentiwed below,
below, populating
populating certain
certain fields
fields from
from database
database tables
tables into
into itit creates
creates an
an
output
internal
table.
Once
the
output
internal
table
is
ready,
then
the
function
module
output internal table. Once the output internal table is ready, then the function module
SSF_FUNCTION_MODULE_NAME
SSF_FUNCTION_MODULE_NAME is
is called.
called. Here,
Here, in
in the
the import
import parameters,
parameters, the
the name
name of
of the
the smart
smart
form
is
given.
The
output
of
this
function
module
is
the
name
of
another
function
module.
form is given. The output of this function module is the name of another function module.
This
This function
function module
module is
is again
again called,
called, in
in this
this example,
example, the
the name
name of
of the
the function
function module
module is
is
"/1BCDWB/SF00000007.
"/1BCDWB/SF00000007.
So,
So, in
in case
case of
of smart
smart forms,
forms, we
we use
use 22 function
function modules
modules for
for the
the processing
processing of
of the
the smart
smart form.
form. Once
Once this
this
internal
internal table
table is
is thrown
thrown from
from the
the smart
smart form,
form, then
then in
in the
the layout,
layout, the
the required
required fields
fields can
can be
be displayed.
displayed.
CALL
CALL FUNCTION
FUNCTION 'SSF_FUNCTION_MODULE_NAME'
'SSF_FUNCTION_MODULE_NAME'
CALL
CALL FUNCTION
FUNCTION '/1BCDWB/SF00000007'
'/1BCDWB/SF00000007'

Page 43 of 61

Page 44 of 61

we have to mention this name (of function module) in the print program.

Supposing we want to print a Purchase Order:


We need to have a print program and a smart form name to be given in the customizing settings. Also in the
print program, we call the function name we got from above.
Lets check out the print program SAPBC470_PROGS.

Page 45 of 61

In this program we have the SSF_FUNCTION_MODULE_NAME. We execute the program.

This calls the SAP Smart form. We are checking the output in Monocolour.

Page 46 of 61

This is the way our smart form looks.

Page 47 of 61

SE37: We use the just created function module. /1BCDWB/SF00000007. We execute this.

Page 48 of 61

CHECK PRINT
PREVIEW

Page 49 of 61

We can set the background of the output as any file stored in our hard disk. We can call a graphics from
desktop or any other pic stored in the hard disk. Transaction code: SE78

Page 50 of 61

Now let us delve in to configuration settings to modify our smartform as per requirement.
Creating output type and assigning smart form name in spro
Spro > materials mgt > purchasing > messages > output control > message types > define
message types for Purchase order.

Page 51 of 61

We can create our own message type. We can define various options like transmission medium here like
Print, Fax, EDI etc.

Select we output type and double click on processing routine to get the following screen. It will execute the
print program as soon as we call neu message type. In the above screen, we can mention the name of the
smart form for that output type. Once this is dwe we can mention the output type in the purchase order
Page 52 of 61

me22n: Lets take an existing P.O.

Click

The Output is defined here in P.O.

Page 53 of 61

Page 54 of 61

Refresher on SMART FORMS


What we have discussed thus far, I will try to sum up:
Smart forms is very similar to SAP scripts. This is also a tool, which is extensively used to create
layouts, and then a separate print program is created. This print program is used to create the output internal
table, which in turn is thrown to the smart form where the field values are displayed.
SAP Smartforms can be used for creating and maintaining forms for mass printing in SAP Systems. The
output medium for Smartforms support printer, fax, e-mail, or the Internet (by using the generated XML
output).
These are the steps to create your own smartform:
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1
TYPE
Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2
TYPE
Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
Page 55 of 61

REPORT ZSMARTFORM.
* Calling SMARTFORMS from your ABAP program.
* Collecting all the table data in your program, and pass once to SMARTFORMS
* SMARTFORMS
* Declare your table type in :* Global Settings -> Form Interface
* Global Definintions -> Global Data
* Main Window -> Table -> DATA
*
* Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
*
http://sapr3.tripod.com
*
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
* At the end of your program.
* Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname
= 'ZSMARTFORM'
* VARIANT
=''
* DIRECT_CALL
=''
IMPORTING
FM_NAME
= FM_NAME
EXCEPTIONS
NO_FORM
=1
NO_FUNCTION_MODULE
=2
OTHERS
= 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
* EXPORTING
* ARCHIVE_INDEX
=
* ARCHIVE_INDEX_TAB
=
* ARCHIVE_PARAMETERS
=
* CONTROL_PARAMETERS
=
* MAIL_APPL_OBJ
=
* MAIL_RECIPIENT
=
* MAIL_SENDER
=
* OUTPUT_OPTIONS
=
* USER_SETTINGS
= 'X'
Page 56 of 61

* IMPORTING
* DOCUMENT_OUTPUT_INFO
=
* JOB_OUTPUT_INFO
=
* JOB_OUTPUT_OPTIONS
=
TABLES
GS_MKPF
= INT_MKPF
EXCEPTIONS
FORMATTING_ERROR
=1
INTERNAL_ERROR
=2
SEND_ERROR
=3
USER_CANCELED
=4
OTHERS
= 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
Additional Fonts for your SMARTFORMS
You can create additional fonts and style with transaction SMARTSTYLES
This can then be define in the paragraph and character formats, which you can then be assign to texts and
fields in the Smart Form.
The character formats includes effects such as superscript, subscript, barcode and font attributes.
Various Utilities and their functions in Smartforms
Creating Forms Using SAP Smart Forms
When creating a form we must:
Retrieve the application data
Describe the form
Pass the application data to the form
Retrieving the application data:
Write an ABAP program to retrieve data or include a retrieval routine into the application. This code
consists of statements that select data from databases according to certain selection criteria. Store the
retrieved data in internal tables, structures or variables and transfer it to the form in we step
.
Describing the Form:
The user defines the form using a smart form. Use the tools of the form builder as listed below:
Use the form painter to position the windows, graphics and addresses on a page.
Use the PC editor to write the texts.
Use the table painter to format the tables.
The flow control is used to print the pages and elements.
Form Logic
In the form builder we can describe a smart form by a set of nodes. To do this, we can build up a tree
structure on the left side of the user interface.
The node global settings and its three successors form attributes, form interface and global definitions
always exists for any newly created forms.
To describe the form logic, create the hierarchy under the node pages and windows.
The following rules apply to control the flow of the form output.
The nodes in the tree structure are processed from top to bottom.
Page 57 of 61

For each node there is a tab, this can be used to link the node to a condition. If the condition is
true, the system processes the node. If not, it skips the node and all its successors.
We should define a next page for each page.
Graphical User Interface
The basic ABAP programming skills are required only in special cases like calling a function module or for
complex and extensive conditions.
The SAP form builder of the smart form consists of:
Form painter for creating the layout of the form
PC Editor for entering texts and fields into output areas
Navigation free for maintaining the form logic
Table painter for creating templates and tables
Form check
To define the text formats, we can use the Smart Styles.
The Form Painter:
The form painter offers the following functions:
Design area with ruler, cursor with help lines, and he grid and main grid.
Display of the cursor position in the ruler, which can be suppressed and set.
Two level grid with engage function which can be customized.
When creating, changing and moving a window, the window size appears in the ruler.
Detachable toolbar containing the most important functions.
Autoscrolling when moving windows, placing windows in the background.
Zoom factors that can be set to any value and autozooming of the design area to the window
size.
Sensitive context menu.
Placing a scanned graphic into the background of the design area.
The PC Editor:
The pc editor offers the following functions:
Enter, delete, select, cut and copy texts.
Assign paragraph and character formats.
Include, change and delete fields.
The Table Painter:
The table painter offers the following functions:
Drawing lines and columns
Inserting , cutting , copying and deleting lines
Deleting cells
Changing cell size and moving cell separator lines
Splitting cells
Selecting table patterns
Style builder:
On the left of the style builder screen consists of the predetermined nodes (header data, folder for
paragraph formats, folder for character formats).
On the right we can see the maintenance screen with its tab pages. At the bottom the preview of the selected
font can be viewed.
Field list and Error list:
The field list displays the following data in the form a tree structure:
Page 58 of 61

All tables, fields and structures passed via the form interface.
System fields and the fields that are defined in the global definitions.
This allows we to check whether a correct field name has been entered or not and that the form knows the
field or not. To display the field list, in the form builder choose field list On/Off.
The error list contains the list of errors and warnings displayed at the bottom of the maintenance screen.
Node types:
When a form is created, the tree structure of the form painter contains two root nodes.
The successors of the global settings node are used to maintain form attributes, the form
interface and global definitions.
The successors of the pages and windows node to create the pages of the form, position elements
on these pages, and determine the sequence on how to process these created elements.
Basic elements of a form
Creating pages:
Each form consists of we or more pages. The first page in the tree structure is the start page and the
processing of the form starts with this page itself.
Open the context menu for existing page node and choose createpage
Enter a unique name for the node and a description
Determine the format and the mode of the page counter on the general attributes tab
Determine the print attributes of the page on the output options
Determine a background graphic for the entire page on the background tab
Creating windows:
We can set the size and position of the window graphically in the form painter. There are main windows
and subwindows. The difference between these two is that the output in a main window can cover several
pages.
Open the context menu for an existing page node and choosewindow
Enter a name for the node and a description
On the general attributes indicate whether the window is a main window. If sub window wants to
be created then leave the checkbox empty
Positioning texts on the form
The texts are displayed in the form using text nodes. The only exceptions are addresses. This uses its own
node.
The predecessor node of the text node determines its use:
Predecessor node
Used to
Sub window
[Position text on we or more pages]
Main window
[Display text in relation to other nodes in the main window, it may cover
several pages]
Template
[Displays texts for table cells of a static table]
Table
[Display table contents]
Header and footer
[Display column headings and grand totals in tables]
Event node
[Display subtotals in a table]
There are three text types:
Text element : to enter new text in the PC editor
Text module : to include a text module
Include text : to include an existing SAPscript text
Page 59 of 61

Entering texts in PC editor:


To create a text node call the context menu for that node in the tree structure that should receive the
text, then choose->text
Enter a unique name for the node and the node description
On the general attributes tab choose text element as text type
Enter the text in the PC editor
In the text node box choose whether the text should be started with a new paragraph or only
in a new line
Including text modules:
Text module of the text node is used to refer to an existing text module in the system. The text modules
can be used in two ways:
Refer to the text module. The text then appears read-only in the PC editor and is included
when the form is printed.
Copy the text module. The system then copies the text of the module and automatically
converts the text node into an editable text element.
To create a text node , call the context menu for that node in the tree structure that shall
contain the text and choose create->text
Enter a unique name for the node and a description
On the general attributes tab select the text type text module
Enter the name of the text module in the text name field
Including SAPscript texts:
We can use the text type include text node to refer to a SAPscript text that already exists in the system.
To identify the text the text name, object, id and the language is needed.
To create the text node call the context menu for that node in the tree structure that shall
receive the text and choose create -> text
Enter a unique name for the node and the node description
On the general attributes tab choose include text as text type
Inserting addresses:
We can use the address node to insert an address into the form. This guarantees that the address is
formatted according to the postal rules of the sender country.
To create an address node , call the context menu for that node in the tree structure that we
wants to contain the text and choose create->text
Enter a name for the node and a description
Determine the address type on the general attributes tab
For organizational addresses we have to specify the address number, for any other we have to
specify the person number and the address number
In the box additional addresses we can maintain other attributes to specify how to display the
address
Printing graphics:
Goto tcode se78 to import graphics into the SAP system. The transaction imports the graphics and
stores it in the BDS (business transaction server) and then it can be displayed in the form.
To create the graphic node , call the context menu for that node in the tree structure and
choose create->graphic
Enter a name for the node and the description
On the general attributes determine whether a colored or a black and white
Use the fields object , id and name to identify the graphic
Displaying a static table
Page 60 of 61

Use node type template to display a table whose layout and size is determined before the runtime of the
print program.
To create a template define a table layout to determine the cell structure for each line. The cells are
used to display the cell structure for each line. The cells are used to display the contents of the
successor nodes of the template node. This allows us to position text and a graphic side by side.
The template node is also used for label printing. To use a template we must do the following:
Define the table layout
Display the contents in the table cells
Define the table layout:
The table layout is used to determine the following,
The number of lines and cells
The height of each cell
The width of each cell
The alignment of the table in the window
Whether and where to display separator lines or frames
Create a template node and maintain the attributes width, horizontal alignment and vertical alignment.
Use the table control on the template tab to define the layout of the lines. Each line of the template
must have a definition.
Use the pattern box to select the desired table pattern.
Displaying contents in cells:
The template node defines the table layout. The successor nodes of the template determine the data to
be displayed in the table cells.
Combining nodes:
The more extensive the form becomes, the lesser clear becomes the node hierarchy in the tree structure.
To avoid this we can combine the related nodes by appending them under a folder node.
llet" style="margin-left:1.75in;text-indent:-.25in;mso-list:l8 level1 lfo23; tab-stops:list 1.75in">
The width of each cell
The alignment of the table in the window
Whether and where to display separator lines or frames
Create a template node and maintain the attributes width, horizontal alignment and vertical alignment.
Use the table control on the template tab to define the layout of the lines. Each line of the template must
have a definition.
Use the pattern box to select the desired table pattern.
Displaying contents in cells:
The template node defines the table layout. The successor nodes of the template determine the data to be
displayed in the table cells.
Combining nodes:
The more extensive the form becomes, the lesser clear becomes the node hierarchy in the tree structure. To
avoid this we can combine the related nodes by appending them under a folder node.

Page 61 of 61

You might also like