好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

ABAP 邮件发送 Jobs中Spool为附件1.doc

11页
  • 卖家[上传人]:汽***
  • 文档编号:533355966
  • 上传时间:2022-11-27
  • 文档格式:DOC
  • 文档大小:70.51KB
  • / 11 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • Report YHCNCALC0_MAIL*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*report yhcncalc0_mail.parameter: jobcount like tbtcm-jobcount, jobname like tbtcm-jobname, p_email1 like somlreci1-receiver, p_sender like somlreci1-receiver, p_delspl as checkbox.*DATA DECLARATIONdata: gd_recsize type i.* Spool IDstypes: begin of t_tbtcp. include structure tbtcp.types: end of t_tbtcp.data: it_tbtcp type standard table of t_tbtcp initial size 0, wa_tbtcp type t_tbtcp.* Job Runtime Parametersdata: gd_eventid like tbtcm-eventid, gd_eventparm like tbtcm-eventparm, gd_external_program_active like tbtcm-xpgactive,* gd_jobcount LIKE tbtcm-jobcount,* gd_jobname LIKE tbtcm-jobname, gd_stepcount like tbtcm-stepcount, gd_error type sy-subrc, gd_reciever type sy-subrc.data: w_recsize type i.data: gd_subject like sodocchgi1-obj_descr, it_mess_bod like solisti1 occurs 0 with header line, it_mess_att like solisti1 occurs 0 with header line, gd_sender_type like soextreci1-adr_typ, gd_attachment_desc type so_obj_nam, gd_attachment_name type so_obj_des.* Spool to PDF conversionsdata: gd_spool_nr like tsp01-rqident, gd_destination like rlgrap-filename, gd_bytecount like tst01-dsize, gd_buffer type string.* Binary store for PDFdata: begin of it_pdf_output occurs 0. include structure tline.data: end of it_pdf_output.constants: c_dev like sy-sysid value 'DEV', c_no(1) type c value ' ', c_device(4) type c value 'LOCL'.*************************************************************************START-OF-SELECTION.start-of-selection.* Write statement to represent report output. Spool request is created* if write statement is executed in background. This could also be an* ALV grid which would be converted to PDF without any extra effort* WRITE 'Hello World'. new-page. commit work. new-page print off. if sy-batch eq 'X'.* PERFORM get_job_details. perform obtain_spool_id.*************************************** Alternative way could be to submit another program and store spool*** id into memory, will be stored in sy-spono.*submit ZSPOOLTOPDF2* to sap-spool* spool parameters %_print* archive parameters %_print* without spool dynpro* and return.************************************* Get spool id from program called above* IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'. perform convert_spool_to_pdf. perform process_email. if p_delspl eq 'X'. perform delete_spool. endif. if sy-sysid = c_dev. wait up to 5 seconds. submit rsconn01 with mode = 'INT' with output = 'X' and return. endif. else. skip. write:/ 'Program must be executed in background in-order for spool', 'request to be created.'. endif.*---------------------------------------------------------------------** FORM obtain_spool_id **---------------------------------------------------------------------*form obtain_spool_id. check not ( jobname is initial ). check not ( jobcount is initial ). select * from tbtcp into table it_tbtcp where jobname = jobname and jobcount = jobcount* AND stepcount = gd_stepcount and listident <> '0000000000' order by jobname jobcount stepcount. read table it_tbtcp into wa_tbtcp index 1. if sy-subrc = 0. message s004(zdd) with gd_spool_nr. gd_spool_nr = wa_tbtcp-listident. message s004(zdd) with gd_spool_nr. else. message s005(zdd). endif.endform.**---------------------------------------------------------------------*** FORM get_job_details ***---------------------------------------------------------------------**FORM get_job_details.** Get current job details* CALL FUNCTION 'GET_JOB_RUNTIME_INFO'* IMPORTING* eventid = gd_eventid* eventparm = gd_eventparm* external_program_active = gd_external_program_active* jobcount = jobcount* jobname = jobname* stepcount = gd_stepcount* EXCEPTIONS* no_runtime_info = 1* 。

      点击阅读更多内容
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.