Summary -

In this topic, we described about the below sections -

Smart form is a GUI tool that used to create and maintain forms for sending across and mass printing. The tool can develop the smart forms that supports printing, faxing, e-mailing or XML generated outputs.

The transaction code is SMARTFORMS. Smart forms are client independent objects and are advanced version of SAP Scripts. Smart Forms are easier to develop, transport and maintain when compared to the the SAP Script.

Smart form provides an interface to build, maintain the logic and form layout. The smart form tool allows to modify forms by using simple graphical tools instead of programming. The application program passes the data to the Smart Form via a function module interface. The function module interface automatically created by the system at the time of activating smart form.

There is no control transfer between program and form. If by any chance the control is transferred to function Module, it never come back.

Static and dynamic tables can be inserted in smart forms. This includes line feeds in individual table cells, triggering events for table heading, data subtotals, sorting before output.

Smart form allows to include graphics as a part of the form or as backgrounds of the form. If the graphic used as a background, then it can be supressed during the printing if required.

Smart Form Architecture -

Below diagram represents the smart form architecture -

Smart Form Architecture

Example -

Simple example to create smart form with some basic text in ABAP.


Step-1: Go to SMARTFORMS transaction to create the smart forms. It opens 'SAP smart forms: Initial Screen'. Enter the form name starting with Z or Y.

Creating Smart Form example

Step-2: Create form in two ways.

  • Creating new form.
  • Creating forms from SAP standard forms available in the system.

In this case, we are creating the form from SAP standard form SF_EXAMPLE_02. So click on copy icon highlighted in the below screen to provide existing standard form.

Creating Smart Form example

Step-3: Enter the source object as SF_EXAMPLE_02, target object as ZTCF1 and click on Continue icon.

Creating Smart Form example

Step-4: Enter the package information and click on local object to copy the SF_EXAMPLE_02 to ZTCF1. 'Form SF_EXAMPLE_02 copied to ZTCA1' message displayed on status bar.

Step-5: ZTCF1 form created in the above step. So, click on change to modify the smart form ZTCF1. It opens the below screen.

Creating Smart Form example

Step-6: Right click on 'MAIN Main Window' and select Create Text to add the text to the main window apart from template text.

Creating Smart Form example

Step-7: Name the text and enter the text in the form body like below.

Creating Smart Form example

Step-8: Click on Save and activate the form ZTCF1.

Step-9: Click on Test (F8), it opens 'Function builder: Initial screen' with a function module prefilled in it.

Step-10: Click on Change button if you want to do modifications. Otherwise, click on activate button to activate the function module.

Step-11: Execute the function module by clicking the execute (F8) icon. Print dialog box got displayed.

Step-12: Enter Printer name as LP01, Click on Print preview button to view the form output.

Creating Smart Form example

The above process generates the output like below –

Creating Smart Form example