You are on page 1of 18

SmartForms

Sap-scripts Vs Smartforms......
Driver Program
Fetch data.
Create structures
for Header data.
Create itab
for Item data.
Open Form.
Loop at itab.
Write Form.
Endloop.
Close Form.

Sapscript Layout

Display data.
Main window

Header
Windows

Sap-scripts Vs Smartforms......
Application Program

Smart Form

Fetch data.
Create structures
for Header data.
Create itab
for Item data.
Get FM name for
your Smartform.
Call FM passing
Header & Item data.

Header data
Structures
Itab

.
Loop.
Endloop.

Why Smartforms?
Advantages...
An easy to use Graphical User Interface.
Easy creation and maintenance of Forms resulting in less programming
effort.
Data retrieval and Form Logic are separate.
Web publishing is possible using a generated XML output of the Form.
Graphics can be included as part of the Form or as Background graphics.
Easy migration of Sap-scripts to Smartforms.

What else is new?...


Easy insertion of company logos etc.
Flow logic is represented by a tree structure,in the form of
nodes.Thus, change in printing order is easy using node drag &
drop.
Syntax check for individual nodes.
Address node can be used to insert an address into the Form.
Abap coding is possible using the Program Lines node.
Formatting options can be separately defined & maintained
using Smartstyles.
Individual cells/windows can be easily framed.

Step-by-Step....
Creation of Smartform Layout.

Study of requirements.
Uploading of Bitmap image, if any.
Development of Driver program
Development of Layout.
Attachment of Driver & Smartform to
relevant transaction, if required.
Testing!

Background Graphics.
Step1: Create Bmp image.
If layout is available in the form of pre-printed stationary, scan and store
as type Bmp.
If layout is in form of excel, convert into Bmp. Or draw required
outlines in paint directly.
Step2: Upload into SAP.
Go to transaction SE78, give an object name. Click import. Give path
name. Press Enter!
Step3: Include in Smartfrom.
Go to Page. Select tab- Background picture. Get list of images using
Search help.Double click to select .

Application / Driver Program


First half consists of data retrieval. It can be
included inside a Form called from a Print Output
transaction if the layout is to be displayed using a
standard transaction.
In the second half 2 function modules are called SSF_FUNCTION_MODULE_NAME, to get
name of generated FM to pass data to Smartform.
CALL _______ ie ,
calling the Function module obtained.

Lets go into...

Components of Smartforms...

Form Builder
Form Painter
PC Editor
Table Painter
Style Builder
Field List

Form Logic
In the Form Builder, a Smartform is described by a set of
nodes forming a tree structure.
Initially, 3 nodes already exist:: Form attributes,interface &
global definitions.
Pages and windows are created using the node Pages and
windows.
Nodes are processed from top to bottom.
Node selection is by double-clicking.
Context menu: Clicking the right mouse button displays a
context menu.
Clipboard functions: Copy,Cut,Paste.

Form Painter
Form Painter is used to design the layout of the pages of a
smartform.
One can define the window or graphic positions and choose
sizes.
It offers a design area with ruler, grids, toolbar, zoom factors
etc.
It also provides the facility of placing a scanned graphic into
the background of the design area.
One can display or suppress the Form painter using a button.

PC Editor
It is similar to Text Editor in
Sap-scripts.
It offers the foll functions Enter,delete,select,copy,cut,paste texts.
Assign paragraph formats & character formats.
Include,change & delete fields.

It allows the options of


entering texts in Text Element
Include Text
Text Modules

Table Painter
It is used to design tables in a window,
generally the main window.
It helps draw columns,rows, in the required
format.
Allows selection of different patterns.
It allows you to design separate Header &
Footer formats.
It allows you to create templates for those
layouts, where data placement is fixed &
known before runtime.

Style Builder
In the Style Builder, you can collectively define
Smartstyles. In a Style, you define the paragraph and
character formats you require for your Smartform.
In the header data you maintain the default values of
a Smart Style.
You can choose among three attributes for the
character format : Superscripting / subscripting the character string
Barcode
Font Attributes.

Field List
Field List can be selected as on/off .
It is useful while writing fields within the
Form.
The field list displays :
all tables,structures & fields used in the
Smartform.
All system fields that you can use within the
Smartform.

Tips & traps !


Make sure that all the fields that have been mentioned in
the Form Interface are being passed in the Application
program.
Make sure that the no of columns defined in the Table line
type is equal to those appearing in the Loop.
All Qty & Currency fields have to be moved to type
Char & then passed to the Smartform.
For Include texts, tick check box for No error if no text
exists.
Check the order of all nodes.
Check that internal table name has not been mentioned in
both Loop & Table.
Check that table width is less than window width.

Thank You

You might also like