Mehrere Smartforms in einem Spoolauftrag

DATA: gv_input   TYPE ssfcompin.

 

  CALL FUNCTION ‚SSF_CREATE_COMPOSER_INPUT‘
EXPORTING
archive_parameters = arc_params
user_settings      = “
mail_sender        = ls_sender
mail_recipient     = ls_recipient
output_options     = ls_composer_param
control_parameters = ls_control_param
IMPORTING
input              = gv_input.

CALL FUNCTION ‚SSFCOMP_OPEN‘
EXPORTING
input = gv_input
EXCEPTIONS
error = 1.

LOOP AT xxxxxxxxxx.

* determine smartform function module for delivery note
CALL FUNCTION ‚SSF_FUNCTION_MODULE_NAME‘
*         EXPORTING  formname           = lf_formname
EXPORTING  formname           = ‚ZXXXXXXXXXXXXX‘
*                 variant            = ‚ ‚
*                 direct_call        = ‚ ‚
IMPORTING  fm_name            = lf_fm_name
EXCEPTIONS no_form            = 1
no_function_module = 2
OTHERS             = 3.
IF sy-subrc <> 0.
*   error handling
cf_retcode = sy-subrc.
PERFORM protocol_update.
ENDIF.

*   call smartform delivery note
CALL FUNCTION lf_fm_name
EXPORTING
archive_index        = toa_dara
archive_parameters   = arc_params
control_parameters   = ls_control_param
*                 mail_appl_obj        =
mail_recipient       = ls_recipient
mail_sender          = ls_sender
output_options       = ls_composer_param
user_settings        = ‚ ‚
i_pd                 = gs_rcpd_pd
IMPORTING
document_output_info = document_output_info
job_output_info      = job_output_info
job_output_options   = job_output_options
EXCEPTIONS formatting_error     = 1
internal_error       = 2
send_error           = 3
user_canceled        = 4
OTHERS               = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*   error handling
cf_retcode = sy-subrc.
PERFORM protocol_update.
*     get SmartForm protocoll and store it in the NAST protocoll
PERFORM add_smfrm_prot.                  „INS_HP_335958
ENDIF.

ENDLOOP.

CALL FUNCTION ‚SSFCOMP_CLOSE‘
IMPORTING
RESULT           = job_output_info
EXCEPTIONS
formatting_error = 1
internal_error   = 2
send_error       = 3
OTHERS           = 4.
IF sy-subrc <> 0.
READ TABLE job_output_info-spoolids INTO v_spoolnr INDEX 1.
MESSAGE s007(77) WITH v_spoolnr.
*   error handling
cf_retcode = sy-subrc.
PERFORM protocol_update.
*     get SmartForm protocoll and store it in the NAST protocoll
PERFORM add_smfrm_prot.                  „INS_HP_335958
ENDIF.