Integrating the Smart Form into the Application 
Use
You trigger form printing by calling only two function modules. The first module uses the name of the form to determine the name of the generated function module. Then you call this module.

The name of the generated function module is unique only within one system. Therefore, you must always call the function module first that uses the form name to determine the current name of the generated module.
Prerequisites
You defined the form interface in your form and activated the form.
Procedure
data fm_name type rs38l_fnam.

You can call the Smart Form in other parts of the application program as well. However, in this case you must make sure that the system can access the data to be passed from that place. We recommend to encapsulate the data retrieval in a function module as well.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = '<form name>'
IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.
CALL FUNCTION fm_name
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
G_CARRID = <variable>
G_CONNID = <variable>
G_FLDATE = <variable>
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
GT_SBOOK = <internal table>
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
<error handling>
ENDIF.

In this example, three variables and an internal table are passed. The parameters
G_CARRID , G_CONNID , G_FLDATA , and GT_SBOOK have been defined before in the form interface.Result
The generated function module processes the form logic defined in the Smart Form. Its output is sent to the printer spool for processing.
As long as you do not change the form interface, you can make any changes to the form. When you activate it again, the system generates the current version of the form as soon as you call the function module. Only if you change the form interface, you must adapt the interface in the data retrieval program.