*---------------------------------------------------------------------* * FORM init_printer *---------------------------------------------------------------------* * [+] Initialises the printer with name p_printer * [+] Sets up the document so WRITE directs to the printer *---------------------------------------------------------------------* FORM init_printer USING p_printer TYPE tsp03-padest. DATA: lv_print_param TYPE pri_params, lv_arc_param TYPE arc_params. * Gets the printer information CALL FUNCTION 'GET_PRINT_PARAMETERS' EXPORTING archive_report = ' ' cover_page = ' ' destination = p_printer " the printer name immediately = 'X' layout = 'X_65_255' line_size = 239 mode = '1' no_dialog = 'X' IMPORTING out_parameters = lv_print_param out_archive_parameters = lv_arc_param EXCEPTIONS OTHERS = 99. IF sy-subrc <> 0. EXIT. ENDIF. * set up WRITE to point to the printer instead of the screen NEW-PAGE PRINT ON NEW-SECTION PARAMETERS lv_print_param ARCHIVE PARAMETERS lv_arc_param NO DIALOG. ENDFORM.