大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
首先激活sap邮件服务,sicf中激活;
专注于为中小企业提供网站设计、成都做网站服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业汾西免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了上千企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
在scot中配置邮件服务器地址以及端口等信息;
通过abap代码实现邮件发送
发邮件的方法如下:
工具:惠普暗影精灵8 Pro笔记本电脑、windows 11操作系统、PC版QQ V9.7.1.28940。
1、登陆你的qq账号,点击qq面板上面邮件的图标,进入qq邮箱。
2、进入qq邮箱后,点击左侧的写信按钮。
3、弹出写邮件内容的窗口,第一行写入对方的邮箱,下面是邮件的标题和内容。
4、写好邮件后,检查没有错误,点击下面的发送。
5、邮件就发送成功了。
登陆邮箱号就可以发。
若用Windows10系统的华为、华硕等品牌的电脑发送QQ邮件、网易邮件等,要先打开浏览器,输入QQ邮箱或网易邮箱点击搜索,进入官网后选择登录,登录成功后点击写信,然后根据页面提示选择收件人、填写主题以及正文选择发送文件即可。
对于其他邮箱来说,发布邮件的方式都是比较相似的,主要是登录邮箱,然后选择发邮件就可以了,当然了,最重要的是知道对方的邮箱地址。
很多邮箱是需要使用手机号码进行注册的,而对于QQ邮箱来说,直接使用QQ号登录就可以了,而且邮箱账号也是与QQ号相关联的。
我在项目上做过类似的。
首先要做的是物料主数据中 找个字段记录一下物料申请人 邮箱
以MIGO为例
首先需要 BASIS做SAP 相应邮件的配置
用Badi:MB_MIGO_BADI增强 interface:POST_DOCUMENT
发邮件FM代码如下
FUNCTION Z02FI_SEND_EMAIL_ALL.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_ADDR) TYPE ADR6-SMTP_ADDR
*" REFERENCE(I_TITLE) TYPE SO_REC_EXT
*" EXPORTING
*" REFERENCE(E_STATUS) TYPE STRING
*" REFERENCE(E_OK) TYPE FLAG
*" TABLES
*" T_BODY STRUCTURE W3HTML
*" T_CCADDR STRUCTURE ZCCADDR OPTIONAL
*"----------------------------------------------------------------------
DATA: LV_TITLE TYPE SO_OBJ_DES,
SEND_REQUEST TYPE REF TO CL_BCS,
DOCUMENT TYPE REF TO CL_DOCUMENT_BCS,
CONLENGTHS TYPE SO_OBJ_LEN,
HTML TYPE STANDARD TABLE OF W3HTML,
WA_HTML TYPE W3HTML,
SENDER_ID TYPE REF TO IF_SENDER_BCS,
RECIPIENT TYPE REF TO IF_RECIPIENT_BCS,
SENT_TO_ALL TYPE OS_BOOLEAN,
BCS_EXCEPTION TYPE REF TO CX_BCS,
BCS_MESSAGE TYPE STRING.
DATA RECIPIENTCC LIKE RECIPIENT.
DATA L_ADDR LIKE I_ADDR.
LV_TITLE = I_TITLE.
WA_HTML-LINE = 'html'.
APPEND WA_HTML TO HTML.
WA_HTML-LINE = 'body'.
APPEND WA_HTML TO HTML.
LOOP AT T_BODY.
WA_HTML-LINE = T_BODY-LINE.
APPEND WA_HTML TO HTML.
WA_HTML-LINE = 'BR'.
APPEND WA_HTML TO HTML.
ENDLOOP.
WA_HTML-LINE = 'BR'.
APPEND WA_HTML TO HTML.
WA_HTML-LINE = '/body'.
APPEND WA_HTML TO HTML.
WA_HTML-LINE = '/html'.
APPEND WA_HTML TO HTML.
TRY.
CLEAR SEND_REQUEST.
SEND_REQUEST = CL_BCS=CREATE_PERSISTENT( ).
CLEAR DOCUMENT .
DOCUMENT = CL_DOCUMENT_BCS=CREATE_DOCUMENT(
I_TYPE = 'HTM'
I_TEXT = HTML
I_LENGTH = CONLENGTHS
I_SUBJECT = LV_TITLE ).
* Add document to send request
CALL METHOD SEND_REQUEST-SET_DOCUMENT( DOCUMENT ).
* Construct sender and receiver
CLEAR: SENDER_ID , RECIPIENT .
* sender_id = cl_cam_address_bcs=create_internet_address( 'TESTDELOITTE@PETROCHINA-HFY.COM' ).
RECIPIENT = CL_CAM_ADDRESS_BCS=CREATE_INTERNET_ADDRESS( I_ADDR ).
* Set sender
CALL METHOD SEND_REQUEST-SET_SENDER
EXPORTING
I_SENDER = SENDER_ID.
* Add recipient with its respective attributes to send request
CALL METHOD SEND_REQUEST-ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_EXPRESS = 'X'.
LOOP AT T_CCADDR WHERE CCADDR IS NOT INITIAL .
CLEAR RECIPIENTCC.
RECIPIENTCC = CL_CAM_ADDRESS_BCS=CREATE_INTERNET_ADDRESS( T_CCADDR-CCADDR ).
CALL METHOD SEND_REQUEST-ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENTCC
I_COPY = 'X'
I_EXPRESS = 'X'.
ENDLOOP.
* Set E-mail sending options
CALL METHOD SEND_REQUEST-SET_STATUS_ATTRIBUTES
EXPORTING
I_REQUESTED_STATUS = 'E'
I_STATUS_MAIL = 'E'.
CALL METHOD SEND_REQUEST-SET_SEND_IMMEDIATELY( 'X' ).
* Send document
CALL METHOD SEND_REQUEST-SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
IF SENT_TO_ALL = 'X'.
* E_STATUS = 'Email is send out successful.'.
E_OK = 'X'.
ENDIF.
COMMIT WORK.
CATCH CX_BCS INTO BCS_EXCEPTION.
BCS_MESSAGE = BCS_EXCEPTION-GET_TEXT( ).
E_STATUS = BCS_MESSAGE.
EXIT.
ENDTRY.
ENDFUNCTION.