效果如下:
实施方法:
步骤1:增强点:QSS10001,事务码:CMOD,创建增强ZQM001,功能出口'EXIT_SAPLQSS1_001'传入选中的检验批次'I_LOT_NUMBER'以及检验类型'I_INSP_TYPE'
步骤2:在功能出口处调用打印smartforms函数即可,打印函数如下:
FUNCTION zfm_qm_print. *"---------------------------------------------------------------------- *"*"本地接口: *" IMPORTING *" REFERENCE(I_LOT_NUMBER) TYPE QALS-PRUEFLOS *" REFERENCE(I_INSP_TYPE) TYPE QALS-ART *"---------------------------------------------------------------------- DATA: ls_control TYPE ssfctrlop, "打印传入参数 ls_output TYPE ssfcompop, "打印传入参数 ls_outotf TYPE ssfcrescl, "打印传入参数 ls_jobout TYPE ssfcresop. "打印传出参数 DATA: fn_name TYPE rs38l_fnam. ""定义子例程 DATA:ls_return TYPE ssfcrescl. "打印返回值 DATA: ls_head TYPE zqms001, "定义表头内表 lt_item TYPE TABLE OF zqms001 . "定义表值内表 IF i_insp_type <> 'Z01'. MESSAGE '非IQC检验'TYPE 'E'. EXIT. ENDIF. ls_output-tddest = 'LP01'. ls_output-tdiexit = 'X'. ls_output-tdimmed = 'X'. ls_output-tddelete = 'X'. ls_output-tdnoprev = ''. ls_control-preview = 'X'. "打印预览 ls_control-no_dialog = ' '. ls_control-no_open = 'X'. ls_control-no_close = 'X'. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' ""调用smartforms名称函数 EXPORTING formname = 'ZQMF001' ""调用smartforms * VARIANT = ' ' * DIRECT_CALL = ' ' IMPORTING fm_name = fn_name ""传出smartfroms名称参数 EXCEPTIONS no_form = 1 no_function_module = 2 OTHERS = 3. IF sy-subrc <> 0. ENDIF. CALL FUNCTION 'SSF_OPEN' ""打印开启 EXPORTING user_settings = '' output_options = ls_output control_parameters = ls_control IMPORTING job_output_options = ls_jobout EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5. IF sy-subrc <> 0. ENDIF. CALL FUNCTION fn_name EXPORTING control_parameters = ls_control output_options = ls_output user_settings = '' ls_head = ls_head IMPORTING job_output_info = ls_outotf TABLES lt_item = lt_item ""传值进入smartforms EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 user_canceled = 4 OTHERS = 5. IF sy-subrc <> 0. ENDIF. CALL FUNCTION 'SSF_CLOSE' ""打印关闭 IMPORTING job_output_info = ls_return EXCEPTIONS formatting_error = 1 internal_error = 2 send_error = 3 OTHERS = 4. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. ENDFUNCTION.
标签:control,打印,ABAP,ls,error,QA33,output,TYPE From: https://www.cnblogs.com/lixiangchen/p/17798152.html