Copyright 2024 - BV TallVision IT

Whenever the output required involves different fonts, font sizes, positioning of data because of an address envelope, headers and footers, images (logo) or even watermarks, Smartforms provide the solution. In effect Smartforms is the successor of SapScript, which was also about getting your information to look the business on paper.

So only official output via Smartforms? Nope: it is also used in elaborate reporting, where a landscape format with many columns and possible line types are used. Smartform output is effectively produced in an OTF format (like SapScript) which can easily be converted to PDF as well, so our audience can also be reached via an email.

Transaction SMARTFORMS, check out the many many many examples available.

Would this be the only way form output can be implemented ? Nope, it's not. Before Smartforms, there was SapScript (transaction SE71) which is still in use today, although SAP recently announced it will no longer maintain SapScript tooling (8/7/2014). After SmartForms there is the Adobe forms and Adobe interactive forms. The non-interactive version of these forms can be developed on an SAP platform via transaction SFP - SAP Form Builder.

But wait - there is more: specifically for HR there is a transaction HRFORMS which also handles forms. Smartform output can be defined in the HRFORMS transaction, but another output type can also be defined there. The HR form editor (transaction PE51) embodies a form builder tool which answers HR specific needs.

Smartforms and Sapscripts can be called/issued from "the system", for which some customizing needs to be in place. Of course an Abap can create it's own Sapscript or Smartform call, but the most commonly used forms are linked to actual output types (e.g. NEU) as defined on table TNAPR.

So: if you know the name of the Smartform or Sapscript and you would like to know how (where) it is used, check out the TNAPR table !

Smartform output should be tested using actual prints, but during the development phase a lot can be done with the print preview button as well. Good for paper consumption and saves walking to the printer every time. The print preview by default shows a screen with buttons to zoom in and zoom out, however these are not available for regular prints. I found that when I wanted to capture the form output as a screen snapshot - the quality is quite poor.

Smartforms are created with the form designer, a development tool (transaction SMARTFORM) which shows a tree-like setup with folders for each window. A smartform has an interface via which data is passed on for formatted printing. Smartforms are started via a function (CALL FUNCTION) which is generated from the Smartform. Before starting a smartform, the name of this module needs to be determined. 

Smartforms

...define how your output can look on paper (or in PDF format). It can be started with transaction SMARTFORMS which shows...

Form

...for the name of the actual Smartform, which contains...

Form Attributes

...defining the page format (A4) as well as the..

Style

...defining default font (size), paragraphs (with fonts and tabs), character formats. Then there's also...

Form Interface

...which defines what data is to be presented as a set of parameters...

What you should do and not do when implementing Smartforms...

  • Do regard Smartforms as a "black box" for whatever you like to put on paper. A Smartform is about how your (paper) form is set up, with powerful layout tools. It should not be used to select data unless this data is e.g. a description with a value. The main selection for a SmartForm should be performed before the Smartform is called and the information that is passed on to the Smartform should be specified in the Smartform interface.
  • Don't ignore the above "Do"... And if you do decide to ignore it, please keep all selection steps grouped together in an Abap block that is executed right up front. If I'm asked to change one of your Smartforms and you've set up selection in several parts of the Smartform, I will find you and you'll have to offer me a coffee from a proper coffee machine.

A simple Smartform to PDF as a file - example. For demonstration purpose, a simple Smartform call is done which is processed via OTF info a PDF and stored on the presentation server. 

The page number and the number of pages are probably the most common system variables that are available in your smartform, but there are many more available to you - in SFSY

System parameters or variables for Smartforms are directly available from the SFSY structure:

Page &SFSY-PAGE& of &SFSY-FORMPAGES&

Check out the fields on structure SFSY in SE11 and get counting.

You've set up your Smartform, you used something like Page &SFSY-PAGE(C)& of &SFSY-FORMPAGES(C)& and the output is "Page 1 of 1" on every page... Double click on the "Page" node and check the properties. It should indicate "Increase counter".

Wouldn't it be great if Smartform output could contain click-link or hyperlink texts that would take the end user to some web site in his/her own browser ? It can be done ! This is an example where a Smartform is composed with a reference text, URL references are prepared before the Smartform is produced, then the output is transformed into a PDF file (on the presentation server) with working alias links. 

A brief introduction to the editor of Smartforms. The most relevant components are described. A SmartForm (like a SapScript form) consists of Pages (usually the "first" and "next", sometimes also a "last") which consists of windows. Each window has it's location (placement) on the end result. One of the windows is the more prominent one, as it can "roll" - that is, the contents of this window builds up and when the end of the window is reached, the next page (again with a MAIN window) is prepared.

When you compose your Smartform (or Sapscript form) you will be setting fields in a &SOMEFIELD& form, for which a wide variety of formatting options is available. Check them out: Note that the options are filled in just before the closing &-character, and options can be combined.

Your Smartform (or Sapscript) should potentially be made available in more than one language. When you are setting up your Smartform, make sure you know about how translations work. In a nutshell: 

When developing your form, you will fill in text elements which will have actual text. Text elements that contain text (in a language) can be translated. When the form is composed in an alternative language, it will try to pick up in the translated version of each text element in your form. So: do your thing, put actual texts on the form and finish it (in a certain language). Then work up a translation, in the Standard Translation Environment, transaction SE63.

The system uses SapScript forms (which is more often than not the case for FI) and a name change or company website reference or such needs to be applied. How should this be done ? Do you need to browse through each form and look up existing references ? This article describes what I did to check over 100 Sapscript forms / in automated fashion. 

Adobe has had forms as their business for a long time - and the adobe form is integrated and available from within SAP, with it's own transaction code and all. It's not as elaborate as the Adobe Interactive Form, but it covers all main functionality from the Smartform. Printed on paper or as .PDF file. 

In effect, the SmartForm is triggered by calling it's processing function module, a system-generated function module for which the name needs to be looked up. Also explains what OTF is about. The SmartForm parameters or Interface parameters need to be passed in the function module call.

Check out one of SAP´s demo Smartforms with a brief description of the AbapcadabrA author... Start transaction SMARTFORMS and enter SPPFDEMO_BOOK. This is our example Smartform - with guided tour:

You can assume the company you will be producing Smartforms for has a company-wide agreements for the font family and size to be used. Set them up in a Style which can be applied to your Smartforms...

A simple report that will download the SapScript Graphic or BDS (Business Documents Service) image to a local .bmp file. All graphics would need to be uploaded from e.g. a .bmp file but the original is often lost. Transaction SE78 does not provide the download functionality, so this development tool report does. 

Sapscript is the predecessor of Smartforms. But they are still around and require changes every now ant then. Thus: Sapscript in a nutshell:

Transaction SE71 can be used to maintain a Sapscript form. When you are about to create a new form, you should create a Smartform, but surely enough you will have some reason to work with Sapscript (e.g. change a SAP standard form like MEDRUCK).

You can call a routine in any program from a Sapscript window element, using the PERFORM ... ENDPERFORM statements. How does this work ? Read on...