0% found this document useful (0 votes)
342 views

Sap Smart Forms: BY Sangeetha Mohan AUG 19,2002

SAP Smart Forms allow users to create customized forms for various business documents like invoices, statements, and delivery notes. Smart Forms use a builder to design forms visually with fields, text, images, and tables. Forms are generated dynamically using ABAP code. The builder provides templates to lay out pages and windows. Fields are used to insert dynamic data from databases. Tables can display application data in rows and columns. Smart Forms integrate with SAP applications and provide a flexible way to output business documents.

Uploaded by

msreddy_m5490
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
342 views

Sap Smart Forms: BY Sangeetha Mohan AUG 19,2002

SAP Smart Forms allow users to create customized forms for various business documents like invoices, statements, and delivery notes. Smart Forms use a builder to design forms visually with fields, text, images, and tables. Forms are generated dynamically using ABAP code. The builder provides templates to lay out pages and windows. Fields are used to insert dynamic data from databases. Tables can display application data in rows and columns. Smart Forms integrate with SAP applications and provide a flexible way to output business documents.

Uploaded by

msreddy_m5490
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 27

SAP SMART FORMS

BY
SANGEETHA MOHAN
AUG 19,2002

1
Overview

•Smartforms Basics

•Smartforms and SAPscripts

•Demo

2
General Concepts on Form Painting

Forms can be:


Order Confirmations
Invoices
Account Statements
Checks
Salary Statements
Delivery notes
Custom forms

3
SMART FORMS - ARCHITECTURE

Smart Form Web Browser

Printer
ABAP
Application Function
program module
(generated)

Fax

Database

Data retrieval Form logic Output device

4
SMARTFORMS Builder Components

1. Form Builder
The three frames of Forms builder screen are the :
Navigation menu
Maintenance frame
Form Painter frame

2. SMARTFORM Print Form template


A Smart Form print form is designed using the Smart form Builder.This form does not create the final
output . The Smart Form function module , generated by Smart Form print form creates the output.

3. SMARTFORM Function module


The Smart Form function module is the code generated automatically when activating the Smart Form
print form. Each time a change is made in the print form in the form builder ,the change needs to be
activated in the form builder before taking effect in the output.

4. SMARTFORM Print Program


The Smart Form print program is where the majority of data extraction occurs.Typically one Smart Form
print program should be associated with one type of form.

5
SMART FORM Form Builder

Selected node

Navigation tree Maintenance frame Form Painter


6
CSC Proprietary 12/09/21 03:58 AM 008_fmt_wht 6
Control Flow and Conditions

Control
flow Nodes with condition(s)
are marked

Condition must be met


before node is processed

7
CSC Proprietary 12/09/21 03:58 AM 008_fmt_wht 7
Nodes - Overview

Output areas
Node type Description
Page A page of the form.
Window Output area on a page. There are main windows and subwindows.

Elementary nodes (without successors)


Node type Description
Text To print any texts .
Graphic To position graphics in the form.
Address To include an address. The system reads the address data directly from
the database tables and formats them for print output.

Table output
Node type Description
Template Output of a table containing static data
Table Output of a table containing application data

Flow control
Node type Description
Command Executes special commands (next page, paragraph numbering, printer
control)
Loop Processes successor node repeatedly.
Alternative Branches depending on condition.

Other nodes
Node type Description
Folder Combines successor nodes to logical groups
Program lines Executes ABAP Code
Complex section Combines all attributes of the node types template, table, loop, folder

8
Attributes of the Node Types

General Attributes
Shows contents or description of the
node
Output options
Contains attributes such as position,
style, box and shading

Conditions
Allows to display the node only if
certain conditions are true

9
Pages and Windows

10
Pages and Windows

SMART Forms consists of one or more pages. The first page in the tree structure is the start
page (when we create a form, the start page already exists).

Windows are output areas for all output data.. After we created a form, a main window already
exists on the first page.

11
PC Editor

PC Editor is used to enter and format texts and fields

12
Texts and Fields - Concepts

For text output a text node is used

Three text types


Text elements (locally in form)
Text modules (for reusing texts)
Include texts (for including SAP script texts)

No commands in text nodes


Besides text only fields are allowed
SAP script commands in Include texts are ignored

Fields are global variables of a form


Interface parameters: Data transferred from application program
Global data: Additionally required variables (e.g. for work areas)
System fields: For special purposes (e.g. date, page number)

13
Texts and Fields - Field list and Inline Editor

Drag & Drop

14
Field List
Formatting options for fields
Syntax Description
Skips <offset> places of the field value (character fields only). If the offset is
&field+<offset>&
greater than the length of the value, nothing is displayed.
&field(<length>)& Sets the output length to <length>.
&field(S)& Suppresses the sign
&field(<)& Displays the sign to the left of the number

&field(.<nat.number>)& Limits output of decimal places to <nat.number>


Displays the field value with the fixed exponent <nat.number>. The mantissa is
&field(E<nat.number>)&
adapted to this exponent by shifting the decimal character and inserting zeros.
Suppresses thousand indicators when displaying fields of types DEC , CURR ,
&field(T)&
INT , and QUAN .
&field(Z)& Suppresses leading zeros of numbers
&field(I)& Suppresses display of initial values
&field(K)& Deactivates a conversion routine specified in the Data Dictionary.
Right-justified display. Use this option only when specifying an output length as
&field(R)&
well.
&field(F<filler>)& Replaces left-justified blanks in the value by the fill character <filler>.
The system takes the field value as a sequence of words separated by blanks.
Option C shifts these words to the left and leaves only one blank inbetween as
&field(C)&
separator. Any leading blanks are suppressed. This effect corresponds to that of
the ABAP statement CONDENSE.

15
System fields of Smartforms

Field name Description


&SFSY-DATE& Displays the date according to the format in in the user master record.
&SFSY-TIME& Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE& Inserts the number of the current print page into the text. according to the
the format of the page number (for example, Arabic, numeric) in the page
node.
&SFSY-FORMPAGES& Displays the total number of pages for the currently processed form. This
allows to include texts such as ‘Page x of y’ into output.
&SFSY-JOBPAGES& Contains the total page number of all forms in the currently processed
print request.
&SFSY-WINDOWNAME& Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME& Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK& Is set to ' X ' after a page break
&SFSY-MAINEND& Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION& Contains the name of the raised exception.

16
Table Output - Graphical Table Painter

Table node is used to pass any


internal table data that is filled
in the data retrieval program.
To display table contents, read
each line of the table
separately in a loop, then
process and display it.
Tables nodes generally are
created in the main window.

17
Paragraph and Character formats

A paragraph format contains information on indents, spacing, font settings, text color,
tabs, numbering and outline. Each paragraph format must have a unique name. In the PC
Editor, assign these formats to a text or a field .
Alignment (default: left)
Indent
Spacing (default value for line spacing of the first line)
Text flow
Page protection
Use this attribute to determine whether or not to display a paragraph completely on one page. Mark it
to avoid that a paragraph is split up by a page break. If on the current page (only in the main window)
there is not enough space left for the paragraph, the entire paragraph appears on the next page.
Next paragraph
Use this attribute to link the subsequent paragraph to the current paragraph.

Character format is used to assign special output attributes to sections of texts or character
strings within a paragraph. For a character format, choose among the following attributes:
Superscripting/subscripting the character string
Barcode
Font attributes (font family, font size, bold/italic, underlined, color)

18
Paragraph and Character formats (contd….)

Paragraph and Character formats are created using transaction SMARTSTYLES

19
Processing a Form
Steps:-
Activate the smart form after the form design is completed.This activation will initiate the generation of a
function module that handles all of the form’s processing.
In the data retrieval program(SE38) select all data that should be displayed in the form.After that the
data retrieval program must call the generated function module to print the form.
Generated function module name of the Smart Form

An useful SAP function module for Smart Form driver program


SSF_FUNCTION_MODULE_NAME - It returns the name of the generated function module: This will help not to hard code
the generated function module name.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'


EXPORTING
FORMNAME = '<form name>'
IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.
20
Data retrieval Program - sample code
report ZDEMO2.
parameter: p_form type tdsfname default 'ZSAN_SMART1'.
data: customers type ty_customers , fm_name type rs38l_fnam
* get data
select * from scustom into table customers order by primary key.
* print data
call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = p_form
importing fm_name = fm_name
exceptions no_form =1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
* error handling
message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. exit. endif.
* now call the generated function module
call function fm_name
exporting
* archive_index =
* archive_parameters =
* control_parameters =
* mail_appl_obj =
* mail_recipient =
* mail_sender =
* output_options =
* user_settings = 'X'
customers = customers
* importing document_output_info =
* job_output_info =
* job_output_options =
exceptions formatting_error = 1
internal_error =2
send_error =3
user_canceled =4
others = 5.
if sy-subrc <> 0.
* error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 21
endif.
SMART Forms and SAPSCRIPTS

Smart Forms SapScripts

Transaction : SMARTFORMS Transaction : SE71

Multiple Page format is possible Multiple page format is not possible

Main Window is optional Main window is mandatory

Routines and ABAP code can be ABAP code cannot be written inside
written inside the smatforms tool . the SAPscript.

A function module is generated No other object is generated when


when the Smart forms is activated. SAPscript is activated.

22
Converting a SAPSCRIPT to SMARTFORM

Procedure
Migrating a SAP script form
Go to the SAP Smart Forms initial screen (transaction SMARTFORMS ).
In the Form field enter the name of the Smart Form to create.
Choose Utilities --> Migrate SAP script form.
The dialog window Migrate SAP script Form appears.
Enter the name and the language of the source form (SAP script).
Choose Enter.
This takes to the change mode of the SAP Form Builder.
If the selected SAP script form does not exist in the selected language, a dialog window appears on which
select one of the existing languages.
Now change the design of the form and of the form logic. To activate the Smart Form choose Activate.
Converting a SAP script style
Go to the Smart Styles initial screen (transaction SMARTSTYLES ).
In the Style name field enter the name of the Smart Style to create.
Choose Smart Styles --> Convert SAP script style.
Enter the name of the SAP script style to convert.
Choose Enter.
A list of the converted styles appears.
Choose Back. Now change the Smart Style (Change).To activate the Smart Style choose Activate.
Mass Migration of SAP script Forms
In Reporting(SE38) select the program SF_MIGRATE and execute it.
Select the names and the language of the SAP script forms and choose Execute. The system creates the
Smart Forms under the names of the SAP script forms plus the extension _SF.
It displays a list of the migrated forms.
To change and adapt a form, go to transaction SMARTFORMS . Then activate the changed Smart Form.

23
What is next in forms?

SAPSCRIPTS

SMARTFORMS
INTERACTIVE WEBFORMS (from ver 6.10 only)

24
Interactive Webforms

Add additional fields


for input:

Add buttons to submit


the form:

25
Sources of Information

SAP Library in Help Portal (http://help.sap.com/)


Basis (SAP Web Application Server)
-> Basis-Services / Communication Interfaces (BC-SRV)
-> SAP Smart Forms (BC-SRV-SSF)

Example Smart forms and programs in our system(AS1)

SF_EXAMPLE_01 & SF_EXAMPLE_02

26
Questions/Comments

27

You might also like