Ads

ABAP Smartforms Tutorials

ABAP Smartforms Tutorials


Here ,  i am explaining the basic definitions of smart forms tutorials and their use in the applications.
We use SAP Smart Forms to create and maintain forms for mass printing in SAP Systems.

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 replace the SAP script forms.

Features SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort.

To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic.

As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary.

You design a form using the graphical Form Painter and the graphical Table Painter.

The form logic is represented by a hierarchy structure that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.

Features 

Features SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort.

To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic.

As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary.

When activating the Smart Form, the system automatically generates a function module.

You design a form using the graphical Form Painter and the graphical Table Painter.

The form logic is represented by a hierarchy structure that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.

You can check individual nodes as well as the entire form and find any existing errors in the tree structure.

General Concepts on smart forms Printing


 Form printing covers creating and maintaining a form for mass printing in SAP Systems.

This includes design and layout of the form as well as form logic.

The layout determines the page structure, that is the number of differently structured pages and the positions of the output areas on these pages.

Within the output areas, you use tables, paragraphs, paragraph formats and character formats to structure and format texts and data.

The form logic controls the dynamic formatting of the form.

Forms can be: Order confirmations Invoices Account statements Checks Salary statements Delivery notes Customs forms Industry-specific forms, such as quality forms in automobile manufacturing The concepts on form printing presented below are independent of any tool.

Structure of a smart forms

 A form consists of pages, output areas, addresses, graphics, and data or text contents.

To further structure and format text and data, use paragraphs with the paragraph and character formats.

For certain customers, we display their flight bookings with prices in a table in a window.

The invoice also contains other windows for the company logo, the sender address, the customer address, company-specific data, bank data, and pagination.

This address appears only on the first page and is preceded by the sender address in small font.

A window containing company-related data in several fonts and font sizes.

The second page contains the current page number and the total number of pages in the document.

Pages of a  smart forms

On the pages of a form you determine the page layout and the sequence of pages with different structures.

The page layout includes the page format and the position of the windows on a page.

The first page of an invoice, for example, contains the address, which you do not want to display on the next page; and you want to display the General Terms of Business on the last page.

For each page, you must specify a next page to make the page sequence clear.

The page break either is triggered automatically by the main window (see also Main Window and Sub windows or you code it manually into the form logic (see also Specifying the Page Sequence.

Many forms contain only two pages of different structure: the first page, which calls the next page, and the next page, which calls itself.

If the text does not entirely fit onto the second page, another document page is automatically displayed.

Main Window and Sub windows

 On a page, there are two different types of output areas for texts and data: the main window and the sub window.

You can choose a different size for the window on each page, except for the main window.

Main Window In a main window you display text and data, which can cover several pages.

As soon as a main window is completely filled with text and data, the system continues displaying the text in the main window of the next page.

You can define only one window in a form as main window.

In such a case, the system automatically terminates after three pages.

Text and data that do not fit into the sub window are truncated and not displayed.

Texts and Data in a Form


 You enter text in an editor.

This section describes the architecture of SAP Smart Forms and how to create a form.

Essential for creating forms is to understand the form logic.

If you create forms for an application, you want to include application data into the form.

The architecture of SAP Smart Forms separates application data retrieval from the actual definition of the form: In a Smart Form you describe: The layout of your form Individual elements you want to display the form logic you use, for example, to read application data from internal tables, to introduce conditions, and to control process flows a form interface to transfer application data to the form definition When you activate the Smart Form, the system generates a function module that encapsulates all attributes of the Smart Form.

As soon as the application program calls the function module, the Smart Form uses the modules interface to transfer any table data previously selected and to print the form according to the form description.

Architecture The form description can also contain statements that select further data during form processing.

Creating Forms Using SAP Smart Forms

Creating Forms Using SAP Smart Forms This section gives an overview of how to create a form in which to display application data from database tables.

For more detailed information on this procedure, see Using SAP Smart Forms.

Printing the Form Call a function module generated by Smart Forms to print your form.

The function module generates an XSF datastream that transfers, for example, the form description including the retrieved data to programs of third-party companies.

Store the retrieved data in internal tables, structures, or variables and transfer it to the form in one step.

While you initialize the form, you can format the data, which you passed to the form, for output in the form.

Formatting data in the form and not in the data retrieval program allows you to use one data retrieval program for several forms with different formatting routines.

Describing the Form

 You describe a form using a Smart Form.

To do this, use the Form Builder for each page, using other tools of the Form Builder: Use the Form Painter to position windows, graphics, and addresses on a page.

For an overview of the elements available on page level, see Node Types: Overview.

Use the flow control to control whether and when to print pages and elements.

Result When you activate your Smart Form, the Form Builder generates a function module that encapsulates the form description.

Form Logic

 In the Form Builder you describe a Smart Form by a set of nodes.

The node Global Settings as well as its three successors Form attributes, Form interface, and Global definitions always exist for any newly created forms.

To describe the Form logic, create a hierarchy under the node Pages and windows.

Depending on the node type, this could include: printing the node contents.

Executing the successors of a node according to other rules.

The nodes in the tree structure are processed from top to bottom.

For each node there is a tab, which you can use to link the node to a condition [Seite 80]. If the condition is true, the system processes the node.

Navigating in the SAP Form Builder


 The screen capture below shows the three different areas of the SAP Form Builder: The navigation tree on the left, the maintenance screen in the middle, and the Form Painter on the right.

If you select a tree in the node, the system updates the maintenance screen and marks the relevant window in the Form Painter.

Clipboard operations, such as cutting, copying to clipboard, pasting from clipboard Expanding and collapsing a sub tree Clipboard There are three clipboard operations: Copy Copies the selected node with all its successor nodes into the clipboard.

Cut Copies the selected node with all its successor nodes into the clipboard and deletes the copied nodes from the tree.

The system checks whether and where you are allowed to append the root node of the clipboard contents.

You can include windows and graphics on a page, determine their positions and choose the window sizes.

Basic of smart forms in sap


The Form Painter offers the following functions: Form Painter April 2001 27 Design area with ruler, cursor with help lines, and grid and main grid Display of the cursor position in the ruler, which you can suppress and set Two-level grid with engage function, which you can customise  at will When creating, changing, and moving a window, the window size appears in the ruler.

Advantages of Smart Forms They help adapting forms without any programming knowledge due to entirely graphical user interface When activating the smart form the system automatically generates the function module and at the run time.

In the next screen , enter a from name and click create All About Smart Forms The next screen is divided into three sections- All About Smart Forms Navigation window consist of nodes and sub nodes.

Processing will happen as per the sequence in navigation window! All About Smart Forms For background picture and graphics you can pick up either black and white or colour bitmap images and are stored in the form of standard texts.

You can 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 All About Smart Forms The Table shows the different line types which will be used in the table.

 Smart Forms Programming Flow When an SAP Smart Form template is created, a user creates the form layout, defines the required fields, conditions, and special programming instructions in the Smart Form template using the Smart Form Builder.

In case of smart forms, we use 2 function modules for the processing of the smart form.

All About Smart Forms SMART Styles A Smart Style contains: Header data containing the default values of a Smart Style Paragraph formats including indents and spacing, font attributes, tabs, and outline and numbering Character formats including effects, bar code and font attributes Colours and underlines for a paragraph or character format You can use the transaction 'smartforms' / 'smartstyles' to create a smart style.

Smart forms global settings


Go to transaction SMARTFORMS.
Give a name to your form ,with naming conversion Y or Z.Press CREATE button.

In the right hand side you can see a tree structure which contains 1) Global settings 2) Pages and windows which are automatically created.

1) Global settings node consists of a) Form Attributes b) Form Interface c) Global Definitions 2) Pages and windows node consists of a) First page b) Main window which are automatically created.

In FORM ATTRIBUTES you have two tab pages 1) General Attributes 2) Output options.
In the next up coming posts, i am going to post smart forms tutorials with screen shots in the simple steps.


Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced