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.
- First the name of this function module is looked up:
data: l_SmartForm_name type tdsfname, l_SmartForm_fm type rs38l_fnam. l_SmartForm_name = 'Z_MY_SMARTFORM'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' EXPORTING formname = l_SmartForm_name IMPORTING fm_name = l_SmartForm_fm EXCEPTIONS no_form = 1 no_function_module = 2 others = 3. check sy-subrc eq 0.
- Then the function module is called. There is a variety of options that can be passed to the call, used for controlling print parameters or whether a preview pane is presented. Also the smartform function module can be issued with a request to return the SmartForm's OTF representation (control parameters, field
GETOTF
, which is then returned inJOB_OUTPUT_INFO-OTFDATA
) . OTF is a format in which the SmartForm output can be held (stored). PDF is also such a storage type, so your SmartForm output in the format OTF can be transformed into PDF via function moduleCONVERT_OTF_2_PDF
. - To check for errors from the ABAP function module call, the function
SSF_READ_ERRORS
can be called. - From the "Program lines" components on the Smartform itself, function module
SSF_MESSAGE
can be called to set errors which are later picked up bySSF_READ_ERRORS
.