Esta parametrización permite imprimir un formulario directamente al SPOOL sin opción a previsualización:
ls_composer_param-tdnoprev = abap_on. " SIN VISUALIZ. PREVIA
ls_composer_param-tdnoprint = abap_off. " NO IMPRIMIR
ls_composer_param-tdnoarch = abap_off. " NO ARCHIVAR
ls_composer_param-tddest = 'LOCAL'. " DISPOSITIVO DE SALIDA
ls_composer_param-tdimmed = abap_off. " SIN SALIDA INMEDIATA
ls_composer_param-tddelete = abap_off. " NO BORRAR TRAS SALIDA
ls_composer_param-tdnewid = abap_on. " NUEVA ORDEN SPOOL
ls_composer_param-tdfinal = abap_on. " CERRAR ORDEN DE SPOOL
ls_composer_param-tdarmod = '1'. " SOLO IMPRIMIR
ls_composer_param-tdcopies = '001'. " CANTIDAD DE COPIAS
ls_control_param-no_dialog = abap_on. " SIN VENTANA DIALOGO
ls_control_param-preview = abap_off. " SIN VISUALIZ. PREVIA
ls_control_param-device = 'PRINTER'." DISPOSITIVO
CALL FUNCTION lv_fname
EXPORTING
* archive_index = toa_dara
* archive_parameters = arc_params
control_parameters = ls_control_param
output_options = ls_composer_param
user_settings = abap_off
p_gjahr = p_gjahr
TABLES
gt_cabecera = gt_head[]
gt_detalle = gt_detail[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e006(zcfcl_fi_0003).
ENDIF.
ls_composer_param-tdnoprint = abap_off. " NO IMPRIMIR
ls_composer_param-tdnoarch = abap_off. " NO ARCHIVAR
ls_composer_param-tddest = 'LOCAL'. " DISPOSITIVO DE SALIDA
ls_composer_param-tdimmed = abap_off. " SIN SALIDA INMEDIATA
ls_composer_param-tddelete = abap_off. " NO BORRAR TRAS SALIDA
ls_composer_param-tdnewid = abap_on. " NUEVA ORDEN SPOOL
ls_composer_param-tdfinal = abap_on. " CERRAR ORDEN DE SPOOL
ls_composer_param-tdarmod = '1'. " SOLO IMPRIMIR
ls_composer_param-tdcopies = '001'. " CANTIDAD DE COPIAS
ls_control_param-no_dialog = abap_on. " SIN VENTANA DIALOGO
ls_control_param-preview = abap_off. " SIN VISUALIZ. PREVIA
ls_control_param-device = 'PRINTER'." DISPOSITIVO
CALL FUNCTION lv_fname
EXPORTING
* archive_index = toa_dara
* archive_parameters = arc_params
control_parameters = ls_control_param
output_options = ls_composer_param
user_settings = abap_off
p_gjahr = p_gjahr
TABLES
gt_cabecera = gt_head[]
gt_detalle = gt_detail[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e006(zcfcl_fi_0003).
ENDIF.
Excelente
ResponderEliminar