Copyright 2022 - BV TallVision IT

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.

 

  1. 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.
  2. 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 in  JOB_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 module CONVERT_OTF_2_PDF.
  3. To check for errors from the ABAP function module call, the function SSF_READ_ERRORS can be called.
  4. From the "Program lines" components on the Smartform itself, function module SSF_MESSAGE can be called to set errors which are later picked up by SSF_READ_ERRORS.