首先激活sap郵件服務(wù),sicf中激活;
專注于為中小企業(yè)提供網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)汾西免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。
在scot中配置郵件服務(wù)器地址以及端口等信息;
通過abap代碼實(shí)現(xiàn)郵件發(fā)送
發(fā)郵件的方法如下:
工具:惠普暗影精靈8 Pro筆記本電腦、windows 11操作系統(tǒng)、PC版QQ V9.7.1.28940。
1、登陸你的qq賬號(hào),點(diǎn)擊qq面板上面郵件的圖標(biāo),進(jìn)入qq郵箱。
2、進(jìn)入qq郵箱后,點(diǎn)擊左側(cè)的寫信按鈕。
3、彈出寫郵件內(nèi)容的窗口,第一行寫入對(duì)方的郵箱,下面是郵件的標(biāo)題和內(nèi)容。
4、寫好郵件后,檢查沒有錯(cuò)誤,點(diǎn)擊下面的發(fā)送。
5、郵件就發(fā)送成功了。
登陸郵箱號(hào)就可以發(fā)。
若用Windows10系統(tǒng)的華為、華碩等品牌的電腦發(fā)送QQ郵件、網(wǎng)易郵件等,要先打開瀏覽器,輸入QQ郵箱或網(wǎng)易郵箱點(diǎn)擊搜索,進(jìn)入官網(wǎng)后選擇登錄,登錄成功后點(diǎn)擊寫信,然后根據(jù)頁面提示選擇收件人、填寫主題以及正文選擇發(fā)送文件即可。
對(duì)于其他郵箱來說,發(fā)布郵件的方式都是比較相似的,主要是登錄郵箱,然后選擇發(fā)郵件就可以了,當(dāng)然了,最重要的是知道對(duì)方的郵箱地址。
很多郵箱是需要使用手機(jī)號(hào)碼進(jìn)行注冊(cè)的,而對(duì)于QQ郵箱來說,直接使用QQ號(hào)登錄就可以了,而且郵箱賬號(hào)也是與QQ號(hào)相關(guān)聯(lián)的。
我在項(xiàng)目上做過類似的。
首先要做的是物料主數(shù)據(jù)中 找個(gè)字段記錄一下物料申請(qǐng)人 郵箱
以MIGO為例
首先需要 BASIS做SAP 相應(yīng)郵件的配置
用Badi:MB_MIGO_BADI增強(qiáng) interface:POST_DOCUMENT
發(fā)郵件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.