Sunday, 11 August 2013

Smart Forms - Beginners

Introduction

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.

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 layout

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&)


Calling the Smart Form from the ABAP program

ABAP program has to perform the following general steps:

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'.

It is used to get the generated function module (v_function_name) corresponding to the smart form (when the smart form is activated)

CALL FUNCTION 'SSF_OPEN' : 
opens the spool

CALL FUNCTION v_function_name:
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.

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.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.