Print your documents by using SAP Smart Forms

Print your documents by using SAP Smart Forms

Reading time: 3 min
Keywords: Smartforms, SAP
Author: Christos Athanasakis

Smartforms is a SAP common-used tool to print large numbers of documents with a consistent design such as invoices or delivery notes.
It includes utilities for designing forms and defining the interface to the application programs that use forms for their data output.

Compared to SapScript, the classic (predecessor) form processing tool, Smartforms provide considerable advantages:

  • It is much easier to create and edit a form, because the tool offers more functions. For example, you can create static or 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 smartforms allow the user to include graphics, which can be displayed as elements of the form, or in the background(Logo’s, background pictures).
  • You can make changes using Drag n Drop and Cut n Paste.
  • Particular tasks, such as retrieving additional data within forms, do not require you to use special scripting language commands. You can insert Normal ABAP code.

SAP Smartforms in Applications

To create or maintain an SAP Smart form, you must take under consideration 3 basic steps:

  • Form customization.
  • Application program customization. This is necessary if you want to modify spool settings or read additional data that is to be output in all documents of a printing operation.
  • Save the Changes in customizing.

The architecture of SAP Smartform

Smartforms transaction environment

Smartforms transaction screen

The screen contains 3 panels.

The one on the left is the navigation panel. It is a navigation tree in which you can create all the nodes that your form must contain:

  • Pages
  • Windows
  • Text elements
  • Graphics/Logos
  • Static templates
  • Dynamic Tables

In the middle, we have the maintenance panel, where you can customize the attributes of each node you create in the navigation tree.

The panel on the right is the form builder where you can drag and drop your windows and adjust their dimensions.

ABAP Application/Driver program

In the driver program, you must think of 2 main sections:

  • Fetching data from database tables using queries (SQL)
  • Defining smartform call (Passing parameters)

When you create a smartform, a function module, with a specific name, is automatically generated. It contains the interface of the smartform (Import/Export parameters).

Customizing

When you are finished with the form creation and the driver program, go to your transaction customizing and make your configuration. For example, if you want to use your smartform in QM (QM01, QM02, QM03), then you define a shop paper, print program and form.
Quality Management -> Quality Notifications -> Notification Processing -> Print Control

SAP QM configuration/customization tree

In QM customization, by default, you can only set a SapScript form in shop paper definition. So, in order to use your smartform, you can create a simple SapScript form which contains only one command line calling your driver program (which contains the smartform call).

To sum up the processes:

  • The transaction checks in customizing which program to call.
  • The program then fetches the data, calls the appropriate function module generated and triggers the form processing flow. The interface is filled with the data read.
  • The form processor is called in the background. It is responsible for formatting the texts according to the layout information stored in the form, filling fields with values at runtime and placing the completed document in the spool.

Conclusion

If you need to create or edit your print documents with SAP Smartforms, IT-TELESIS team is always up to date and ready to offer you at any time support by both remote, spot consulting and/or onsite sessions.

References:

SAP Learning hub – BC470