Te pongo un ejemplo de como llamar a un Smartforms desde un programa.
Las variables...
TABLES: nast, itcpo.
DATA: linea1 TYPE char40,
linea2 TYPE char40,
linea3 TYPE char40,
linea4 TYPE char40.
DATA: local_print_options LIKE itcpo.
DATA: local_nast_data LIKE nast.
DATA: true TYPE c VALUE 'X',
false LIKE true VALUE ' '.
Y los PERFORM que te van hacer falta...
*&---------------------------------------------------------------------*
*& Form imprimir_formulario
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM imprimir_formulario.
DATA: l_funcion TYPE rs38l_fnam.
DATA: output_options_smf TYPE ssfcompop,
control_parameters_smf TYPE ssfctrlop.
PERFORM get_print_parameters.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZSMARTFORMS' "Nombre del formulario
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = l_funcion
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc = 0.
PERFORM get_smartform_print_options
USING local_print_options
CHANGING output_options_smf
control_parameters_smf.
*-- Llamar al smartform
CALL FUNCTION l_funcion
EXPORTING
control_parameters = control_parameters_smf
output_options = output_options_smf
user_settings = ' '
linea1 = linea1
linea2 = linea2
linea3 = linea3
linea4 = linea4
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
ENDIF.
ENDFORM. " imprimir_formulario
*----------------------------------------------------------------------*
* Get print parameters *
*----------------------------------------------------------------------*
FORM get_print_parameters.
MOVE-CORRESPONDING nast TO itcpo.
itcpo-tdcopies = 1. " Cantidad de impresiones
itcpo-tddest = 'LOCAL'. " Nombre de la impresora
itcpo-tdimmed = 'X'. " Imprime inmediatamente
itcpo-tdnewid = 'X'. " Crear nueva SPOOL
itcpo-tddelete = 'X'. " Borra después de imprimir
itcpo-tdpageslct = space. " Todas las páginas
itcpo-tdpreview = space. " Visualización de la impresión
itcpo-tdcover = space. " No portada
local_print_options = itcpo.
ENDFORM. "get_print_parameters
*&---------------------------------------------------------------------*
*& Form GET_SMARTFORM_PRINT_OPTIONS
*&---------------------------------------------------------------------*
* Druckparameter ermitteln
*----------------------------------------------------------------------*
FORM get_smartform_print_options USING p_print_options
LIKE itcpo
CHANGING p_output_options_smf
TYPE ssfcompop
p_control_parameters_smf
TYPE ssfctrlop.
MOVE-CORRESPONDING p_print_options TO p_output_options_smf.
MOVE p_print_options-tdpreview TO p_control_parameters_smf-preview.
p_control_parameters_smf-no_dialog = true.
p_control_parameters_smf-langu = local_nast_data-spras.
ENDFORM. " GET_SMARTFORM_PRINT_OPTIONS
Un saludo,