Forms: SAPscript, Smart Forms and SAP Forms by Adobe
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
Every business document that leaves an SAP system on paper or as a PDF, such as an invoice, a purchase order or an expense claim confirmation, is produced from a form. A form is a template: it holds the fixed parts (logo, headings, column titles) and marks the places where data from the system is inserted. SAP has offered three generations of form technology, and a newcomer meets all three, because old forms keep running for many years. After reading this page you can tell the three apart, recognise how an ABAP program calls each one, understand how output management in SAP S/4HANA decides which form is printed, and choose a technology for a new requirement. The page is written against Standard ABAP release 8.16 in SAP S/4HANA 2025 FPS02 (on premise and Private Edition) and SAP S/4HANA Cloud Public Edition 2608. SAPscript, Smart Forms and the Form Builder belong to classic ABAP in on-premise systems and are not part of ABAP for Cloud Development (release 9.20, 2608). In the Public Edition, forms reach you as delivered templates that key users adapt. Forms need an SAP system and a form designer, so every listing on this page requires an SAP system and was not run here.
Before you read
-
Program Types and Structure: what an executable program and a function group are.
-
Function Modules and Function Groups: how a function module is called with
CALL FUNCTION, because every form is called that way. -
Classic Tools SE80 and SE11: how to find a form object in the Object Navigator.
-
ABAP Language Versions and Released APIs: why ABAP Cloud has no classic form tools.
Key terms
-
Form: a template for a printed or PDF document that mixes fixed text with fields filled at runtime.
-
Print program: the ABAP program that reads the data, chooses the form and hands the data to it.
-
SAPscript: the oldest SAP form technology, whose forms are edited in transaction SE71.
-
Smart Forms: the second generation, designed graphically in the Form Builder (transaction SMARTFORMS) and activated into a function module.
-
Adobe forms: the third generation, whose layout is designed in Adobe LiveCycle Designer and rendered to PDF by Adobe Document Services.
-
Output management: the S/4HANA framework that decides which document is produced, through which channel, with which form.
-
NAST: the message table behind the older output control, in which an application stores the outputs it wants to produce.
What a form is and who does what
A form never works alone. Two parts always cooperate.
-
The print program knows the business data. It reads the claim or the invoice from the database, decides the language and the output device, and passes the data to the form.
-
The form knows how the page looks. It has no database access of its own in the classic technologies; it only formats what it receives.
Keeping those two jobs apart is the reason forms exist: a consultant can change a layout without touching the data retrieval, and a developer can change the data retrieval without touching the layout. The three technologies differ in how the layout is described, how the data is passed over, and who renders the final page.
The three generations
SAPscript
SAPscript is the original technology. The SAP Library describes a SAPscript form as the description of the layout of the individual print pages. It is built from header data, paragraph and character formats, pages, windows and text elements, and it is created and changed in transaction SE71. A window is an area of the page, such as the address block or the footer. A text element is a named block of text inside a window that the print program calls by name.
The print program drives the form with function modules. OPEN_FORM opens the output and must be called before any other form function; CLOSE_FORM ends it, and without it the system prints or displays nothing. In between, WRITE_FORM writes one text element into one window. OPEN_FORM has the exceptions FORM (form not found or no active version), DEVICE (invalid output type), OPTIONS (invalid formatting options), CANCELED (the user cancelled on the print screen) and UNCLOSED (a form is already open).
* Classic SAPscript print program (shortened). Form name ZEXP_CLAIM is a fictitious customer form.
DATA ls_options TYPE itcpo.
ls_options-tddest = 'LP01'. " output device
ls_options-tdnewid = abap_true. " new spool request
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZEXP_CLAIM'
options = ls_options
dialog = abap_false
EXCEPTIONS
form = 1
device = 2
options = 3
canceled = 4
unclosed = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'CLAIM_HEADER'
window = 'MAIN'.
CALL FUNCTION 'CLOSE_FORM'.
This listing requires an SAP system; not run here. Source: SAP Library (NetWeaver 7.3): OPEN_FORM
The data reaches the form through global program variables whose names appear as &FIELD& symbols in the form text. That is the old, implicit way of passing data and the main reason the technology is hard to maintain: the form and the program share names, and nothing checks them.
Smart Forms
Smart Forms replaced SAPscript. The SAP Library says that Smart Forms replace SAPscript forms, that SAPscript forms remain supported, that SAPscript texts can be reused and that migration is supported. You design the form graphically in the Form Builder, started with transaction SMARTFORMS. The Form Builder has a Form Painter for the page layout and a Table Painter for tables. The logic is a tree of nodes, and most changes need no coding.
When you activate a Smart Form, the system generates a function module from it. The SAP Library puts it this way: after activation the form is similar to a callable function module, the application program retrieves the data and passes it through the module’s interface, so that data retrieval stays separate from the form logic. The generated name differs in every system, so the program asks for it first with the function module SSF_FUNCTION_MODULE_NAME.
* Smart Forms call (shortened). Form name ZEXP_CLAIM_SF is a fictitious customer form.
DATA lv_fm_name TYPE rs38l_fnam.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZEXP_CLAIM_SF'
IMPORTING
fm_name = lv_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION lv_fm_name
EXPORTING
is_claim = ls_claim " parameter defined in the form interface
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
This listing requires an SAP system; not run here. Source: SAP Library (ERP 6.0 EHP 9): SAP Smart Forms overview
The important step forward is the typed form interface: the parameters of the generated module, such as is_claim above, are declared in the form and checked, instead of being shared by name. Smart Forms can send the result to a printer, as e-mail, as fax or as generated HTML. If you must move an old form, the SAP Library advises migrating only when you need extensive changes, because the print program has to be rewritten by hand: the migration converts layout, windows, texts and styles, but not the print program, and SAPscript commands such as NEW-PAGE become comments you adapt. The transaction SMARTFORMS migrates one form and the report SF_MIGRATE migrates many at once, naming the new forms with the suffix _SF.
SAP Interactive Forms by Adobe and SAP Forms by Adobe
The third generation builds the page in Adobe LiveCycle Designer and lets a service render it. The ABAP side is the Form Builder, transaction SFP, which you can also reach through Form Objects in the ABAP Workbench (SE80). A form in this technology has two parts that you create separately:
-
the form interface, which declares the data the form receives (as ABAP Dictionary types, an XML schema or in a Smart Forms compatible way);
-
the form, which consists of the context, where you choose which interface data goes into the form, and the layout, which you draw in the designer.
The SAP Library warns that other forms may use the same interface, so check the dependencies before you change one. The layout is turned into a PDF by Adobe Document Services (ADS), a separate server component, which is why this technology needs more landscape setup than the others.
The print program opens a form job, asks for the name of the generated module, calls it with document parameters and closes the job.
* Adobe form call (shortened). Form name ZEXP_CLAIM_AF is a fictitious customer form.
DATA: ls_outputparams TYPE sfpoutputparams,
ls_docparams TYPE sfpdocparams,
lv_fm_name TYPE funcname.
ls_outputparams-nodialog = abap_true.
ls_outputparams-dest = 'LP01'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
RETURN.
ENDIF.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZEXP_CLAIM_AF'
IMPORTING
e_funcname = lv_fm_name.
ls_docparams-langu = sy-langu.
CALL FUNCTION lv_fm_name
EXPORTING
/1bcdwb/docparams = ls_docparams
is_claim = ls_claim.
CALL FUNCTION 'FP_JOB_CLOSE'.
This listing requires an SAP system with Adobe Document Services; not run here. Source: SAP Library (ERP 6.0 EHP 9): Creating Web Dynpro Applications Using Forms, which describes the Form Builder and form interface
Two names are easy to confuse. SAP Interactive Forms by Adobe is the long-standing ABAP-based product described above. SAP Forms service by Adobe is the newer service that S/4HANA output management uses, described next.
Output management in S/4HANA
So far the print program chose the form. In older systems the decision about what to output, to whom and with which form was stored in message condition records and the table NAST, which is decentralized and specific to each application module. SAP S/4HANA adds a framework that centralizes this: output management, with output control as its executing layer. The SAP Learning pages describe these parts:
-
Output parameter determination chooses the channels, recipients and form templates for a business object such as a billing document. It is based on the Business Rule Framework (BRF) and keeps its rules in decision tables.
-
Form templates define content and layout. The data interface of a template is a gateway service, the form data provider, instead of an ABAP interface, and Adobe Document Services creates the document. SAP delivers templates, so you normally do not write a form data provider yourself.
-
Channels deliver the result: print through print queues (with print bundling), e-mail with attachments, and EDI. Form templates cannot be used for EDI.
The Maintain Form Templates Fiori app is the only place where the metadata of a form template is maintained; it can also download the layout definition and upload it back. You edit the layout in Adobe LiveCycle Designer, version 10.4 or higher. To change a delivered template you create an adapted copy under a new name in your own namespace. The SAP page lists three form types: master forms (shared static content such as logo, sender address and bank details), content forms that work with master forms, and standalone forms that combine static and dynamic data. Using master and content forms is not mandatory.
According to the SAP Learning pages, SAP Forms service by Adobe is available in all editions of SAP S/4HANA, and output management works in cloud and on-premise environments. Do not confuse it with the output functions of the on-premise world, which the Public Edition course warns about. The Public Edition focuses on the delivered templates: the SAP course on key-user in-app extensibility shows how a key user customizes a template. In an on-premise or Private Edition system, the old NAST-based output keeps working beside the new framework, and SAPscript and Smart Forms remain usable.
The statement of direction on the learning page is clear: for new implementations and strategic enhancements SAP recommends Adobe forms through S/4HANA output management with the SAP BTP Forms service by Adobe as the target solution, and SAPscript and Smart Forms continue to exist and are still supported.
Choosing a form technology
| Question | SAPscript | Smart Forms | Adobe forms (Interactive Forms by Adobe) | SAP Forms service by Adobe (output management) |
|---|---|---|---|---|
Generation |
First |
Second |
Third |
Current target |
Designed in |
SE71 |
Form Builder, |
Form Builder |
Maintain Form Templates app plus LiveCycle Designer |
Result |
Spool request |
Spool request, e-mail, fax, HTML |
PDF through Adobe Document Services |
PDF through Adobe Document Services, sent by an output channel |
Data passed by |
Program variables by name |
Typed form interface |
Typed form interface |
Gateway service (form data provider) |
Ready in the Public Edition |
No |
No |
No |
Yes, as delivered templates |
Use it for |
Reading and fixing old forms |
Existing forms that work and are rarely changed |
Custom PDF forms in on-premise ABAP development |
New forms in S/4HANA and any change that SAP delivers as a template |
Rules of thumb for a newcomer:
-
An existing form that works: leave it. SAP states that SAPscript and Smart Forms continue to be supported.
-
A change to a standard S/4HANA document: look for the delivered Adobe template first and copy it with Maintain Form Templates.
-
A new form in an on-premise system without S/4HANA output management for that document: an Adobe form with the Form Builder, because that is the direction SAP recommends.
-
Moving SAPscript to Smart Forms: only for extensive changes, and plan time for the print program.
Common mistakes
-
Hard-coding the generated function module name of a Smart Form. The name is different in every system, so always call
SSF_FUNCTION_MODULE_NAMEfirst. -
Forgetting
CLOSE_FORMin SAPscript. Nothing is printed or displayed. -
Changing a shared Adobe form interface. Other forms that use it can break; check the dependencies.
-
Assuming the Public Edition lets you build a form from nothing. There you adapt the delivered templates.
-
Forgetting that Adobe forms need Adobe Document Services. Without it the form cannot render a PDF, however well the ABAP side works.
-
Trusting an old book that presents SAPscript as the way to print. It describes the situation of the older releases; today Smart Forms and Adobe forms exist, and SAP recommends Adobe forms for new work.
Summary
-
A form is a template that the print program fills with data; the program reads the data, the form formats it.
-
SAPscript (SE71,
OPEN_FORM,WRITE_FORM,CLOSE_FORM) is the oldest, Smart Forms (SMARTFORMS, a generated function module) replaced it, and Adobe forms (SFP, LiveCycle Designer, Adobe Document Services) are the third generation. -
S/4HANA output management centralizes the decision of what is output through which channel with which template, and its Adobe templates are maintained in the Maintain Form Templates app.
-
SAP recommends Adobe forms through output management for new work and says SAPscript and Smart Forms are still supported.
-
None of these tools is available in ABAP Cloud; in the Public Edition you adapt delivered templates.
References
-
SAP Library (ERP 6.0 EHP 9): Smart Forms documentation, Introduction
-
SAP Library (ERP 6.0 EHP 9): Migration of SAPscript forms to Smart Forms
-
SAP Library (ERP 6.0 EHP 9): Creating Web Dynpro Applications Using Forms
-
SAP Learning: SAP S/4HANA Output Management and New Form Technologies
-
SAP Learning: Introducing Output Management (Public Edition)