Sending email to a SAP inbox and an ordinary email inbox

筅森魡賤 提交于 2019-12-07 20:21:08

问题


I needed a function to send an email to an ordinary email address and to send on too to an SAP Inbox. I found this function:

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            EXPORTING
              document_data              = gd_doc_data
              put_in_outbox              = 'X'
              commit_work                = 'X'
            TABLES
              packing_list               = it_packing_list
              contents_txt               = it_message
              receivers                  = it_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.

The it_receivers it's filled like this:

 FREE wa_it_receivers.
        wa_it_receivers-receiver   = sy-uname.  "&----- Assign SAP User Id
        wa_it_receivers-rec_type   = 'B'.                    "&-- Send to SAP Inbox
        wa_it_receivers-com_type   = 'INT'.
        wa_it_receivers-notif_del  = 'X'.
        wa_it_receivers-notif_ndel = 'X'.
        APPEND wa_it_receivers TO it_receivers .

This only send's the email to the SAP inbox. I went to the domain of the rec_type field to see which letter is so it can send the email to an ordinary email account. I believe it is 'A' but, as it only says external address. Is that the one? Thank you.


回答1:


Here you have a nice example of how to do it wiki.sdn.sap.com




回答2:


I don't know why people keep on digging up that old function module. I'd always recommend using the Business Communication Services API - it's well documented and much easier to use. The docs also contain an example on how to send to an external mail address.



来源:https://stackoverflow.com/questions/12939878/sending-email-to-a-sap-inbox-and-an-ordinary-email-inbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!