Smartforms
explain in details
Smart Forms are used in SAP to create and maintain forms for mass printing. The Smart Forms offers the following advantages:
OVERVIEW
The architecture of the smart form
is given below:
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.
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.
Creating Forms Using SAP Smart Forms
When creating a form one must:
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 one step.
Describing the Form:
The user defines the form using
a smart form. Use the tools of the form builder as listed below:
The flow
control is used to print the pages and elements.
Form Logic (Introduction)
In the form builder one can describe a smart form by a set
of nodes. To do this, one 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.
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:
To define
the text formats, one can use the Smart Styles.
The from painter:
The form painter offers the following
functions:
The PC Editor:
The pc editor offers the following
functions:
The Table Painter:
The table painter offers the following
functions:
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 one 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:
This allows one 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.
Basic elements of a form
Creating pages:
Each form consists of one 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.
Creating windows:
One 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.
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:
There are three text types:
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
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:
Including SAPscript texts: One
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:
One 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 one wants to contain the text and choose create->text
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.
Displaying a static table
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 one to position text and a graphic side by side. The template node is also used for label printing. To use a template one must do the following:
Define
the table layout:
The table layout is used to determine the following,
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 one can combine the related nodes by appending them under a folder node. The width of each cell
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 one can combine the related nodes by appending them under a folder node.
Back to:
ABAP Menu:
Return to :-
(c) www.gotothings.com All material on this site is Copyright.
|