Smart Form technology allows to design print forms. ABAP programs have to "call" them so that spools are generated, ready to be printed.
SMARTFORMS is the transaction to design the smart form layout.
- It is possible to embed texts, images, tables, barcodes.
- Importing parameters have to be defined so that an ABAP program can send the data to be printed.
- When the smart form is activated, a function module is generated that an ABAP program has to call. You should never assume the name of this function module as it may change in each system after import. See below how to do.
SMARTSTYLES transaction allows to define paragraph and character formats (fonts, barcodes, etc.)
Though ABAP code can be entered in the Smart Form, it is best to not do it, and make the calling ABAP program pass all data via parameters. This will ease the conversion into Interactive Forms By Adobe. The only ABAP code
that needs to remain in the Smart Form is the part which handles page break processing (sub-totals and so on).
Smart Form technology has replaced SAPscript technology since release 4.6C, and has been superseded by Interactive Forms by Adobe since release 6.40.
Layout elements are well introduced in SAP Library - Smart Forms - Node Types Overview.
Parameters and variables can be printed using the SAPscript principle (ampersands around the variable name in the text nodes: &VARNAME&)
ABAP program has to perform the following general steps:
- CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
- It is used to get the generated function module corresponding to the smart form (when the smart form is activated)
- CALL FUNCTION 'SSF_OPEN' : opens the spool
- CALL FUNCTION l_generatedfunctionmodule
- There are 2 parameters CONTROL_PARAMETERS-NO_OPEN and CONTROL_PARAMETERS-NO_CLOSE that you must set to 'X'
- You may call it several times (and even call different Smart Forms) so that several forms are stored in the same spool. It may also be used to share the same page counter.
- Note: unlike SAPscripts, Smart Form has to be called once to be entirely printed.
- CALL FUNCTION 'SSF_CLOSE' : closes the spool
It is also possible to not call SSF_OPEN and SSF_CLOSE: by default, a call to the generated function module will open and close the spool.
Parameters of the generated function modules are well introduced in SAP Library - Smart Forms - Parameters of the Generated Function Module
Please refer to Smart Forms FAQ.