SAP ABAP 内部发邮件
程序员文章站
2022-03-18 21:44:46
...
REPORT zhelllo.
TABLES: usr02.
DATA: lt_pack_list TYPE swftpcklst WITH HEADER LINE,
lt_contents TYPE swftlisti1 WITH HEADER LINE,
st_contents TYPE swftlisti1 WITH HEADER LINE,
lt_receivers TYPE somlreci1_t WITH HEADER LINE,
it_contents TYPE swftlisti1 WITH HEADER LINE,
value TYPE i VALUE 5,
doc_data LIKE sodocchgi1 .
SELECT-OPTIONS:
s_uname FOR usr02-bname NO INTERVALS OBLIGATORY.
DO value TIMES.
CONCATENATE
`<TR> <td>` '2'
`</td><td>` '3'
`</td><td>` '3'
`</td><td>` '4'
`</td><td>` '5'
`</td><td>` '6'
`</td><td>` '6'
`</td></tr>`
INTO st_contents .
APPEND st_contents.
ENDDO.
APPEND `<HTML> <font face="courier new"> <BODY> 错误明细` TO lt_contents.
APPEND `<meta http-equiv=Content-Type content` TO lt_contents.
APPEND `="text/html; charset=utf-8">` TO lt_contents.
APPEND `<TABLE border=1 cellpadding=2 ` TO lt_contents.
APPEND `style='border-collapse:collapse;font-size:10.5pt'>` TO
lt_contents.
APPEND `<TR style= 'background:#5dcbfd'> ` TO lt_contents.
APPEND `<TD>物料凭证</TD>` TO lt_contents.
APPEND `<TD>年度</TD>` TO lt_contents.
APPEND `<TD>采购订单</TD>` TO lt_contents.
APPEND `<TD>项目</TD>` TO lt_contents.
APPEND `<TD>采购申请</TD>` TO lt_contents.
APPEND `<TD>项目</TD>` TO lt_contents.
APPEND `<TD>错误信息</TD>` TO lt_contents.
APPEND `</TR>` TO lt_contents.
APPEND LINES OF st_contents TO lt_contents.
APPEND '</TABLE> <P> ' TO lt_contents.
APPEND '</BODY> </HTML>' TO lt_contents.
doc_data-obj_langu = sy-langu.
doc_data-obj_descr = '寄售物料自动移库程序关闭PR失败'.
lt_pack_list-transf_bin = space.
lt_pack_list-head_start = 1.
lt_pack_list-head_num = 0.
lt_pack_list-body_start = 1.
DESCRIBE TABLE lt_contents LINES lt_pack_list-body_num.
lt_pack_list-doc_type = 'HTML'.
APPEND lt_pack_list.
LOOP AT s_uname.
lt_receivers-receiver = s_uname-low.
lt_receivers-rec_type = 'B'.
lt_receivers-com_type = 'INT'.
lt_receivers-notif_del = 'X'.
lt_receivers-notif_ndel = 'X'.
lt_receivers-express = 'X'.
APPEND lt_receivers.
ENDLOOP.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = lt_pack_list
contents_txt = lt_contents
receivers = lt_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
上一篇: 如何使用SSH连接远程Linux服务器
下一篇: 发邮件
推荐阅读
-
【SAP】ABAP——动态模板
-
【SAP】ABAP——ALV设置某一个单元格的颜色
-
介绍一种在ABAP内核态进行内表高效拷贝的方法 SAPABAPSAP云平台SAP Cloud Platform
-
使用ABAP(ADBC)和Java(JDBC)连接SAP HANA数据库 ABAPSAPJDBCADBCHANA
-
Java和ABAP里的外部类和内部类 ABAPJava外部类内部类SAP Cloud Platform
-
SAP ABAP SQL的execution plan和cache SQLABAPSAP成都研究院SAP Cloud PlatformSAP云平台
-
【第一篇】SAP ABAP7.5x新语法之预定义数据结构
-
使用Java+SAP云平台+SAP Cloud Connector调用ABAP On-Premise系统里的函数 SAPSAP云平台EclipseABAPCloud Connector
-
在SAP WebClient UI里混用ABAP Webdynpro,会带来哪些问题? ABAPWebIDEWebClient UICRMSAP云平台
-
如何将csv包含的数据导入SAP Cloud Platform HANA MDC里 hanaHANA Express EditionSAPSAP云平台ABAP