DATA:
lt_mailsubject TYPE sodocchgi1,
lt_mailtxt TYPE STANDARD TABLE OF soli,
wa_mailtxt LIKE LINE OF lt_mailtxt,
lt_mailrecipients TYPE STANDARD TABLE OF somlrec90,
wa_mailrecipients LIKE LINE OF lt_mailrecipients.
*"----------------------------------------------------------------------
lt_mailsubject-obj_name = `Audit Check`.
lt_mailsubject-obj_langu = sy-langu.
lt_mailsubject-obj_descr = `Результат проверок`.
wa_mailtxt = `Это письмо отправлено из АБАПа :)`.
APPEND wa_mailtxt TO lt_mailtxt.
wa_mailtxt = `Программа такая-то`.
APPEND wa_mailtxt TO lt_mailtxt.
wa_mailrecipients-rec_type = `C`. "Список рассылки, ведётся через SO15
"Между системами не переносится...
wa_mailrecipients-receiver = `SUPPORT_TEAM`.
*wa_mailrecipients- rec_type = 'U'. "Адрес напрямую
*wa_mailrecipients- receiver = 'mail@mail.com'.
APPEND wa_mailrecipients TO lt_mailrecipients.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = lt_mailsubject
TABLES
object_content = lt_mailtxt
receivers = lt_mailrecipients
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 EQ 0.
COMMIT WORK.
* Push mail out from SAP outbox
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
ENDIF.
lt_mailsubject TYPE sodocchgi1,
lt_mailtxt TYPE STANDARD TABLE OF soli,
wa_mailtxt LIKE LINE OF lt_mailtxt,
lt_mailrecipients TYPE STANDARD TABLE OF somlrec90,
wa_mailrecipients LIKE LINE OF lt_mailrecipients.
*"----------------------------------------------------------------------
lt_mailsubject-obj_name = `Audit Check`.
lt_mailsubject-obj_langu = sy-langu.
lt_mailsubject-obj_descr = `Результат проверок`.
wa_mailtxt = `Это письмо отправлено из АБАПа :)`.
APPEND wa_mailtxt TO lt_mailtxt.
wa_mailtxt = `Программа такая-то`.
APPEND wa_mailtxt TO lt_mailtxt.
wa_mailrecipients-rec_type = `C`. "Список рассылки, ведётся через SO15
"Между системами не переносится...
wa_mailrecipients-receiver = `SUPPORT_TEAM`.
*wa_mailrecipients- rec_type = 'U'. "Адрес напрямую
*wa_mailrecipients- receiver = 'mail@mail.com'.
APPEND wa_mailrecipients TO lt_mailrecipients.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = lt_mailsubject
TABLES
object_content = lt_mailtxt
receivers = lt_mailrecipients
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 EQ 0.
COMMIT WORK.
* Push mail out from SAP outbox
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
ENDIF.
Комментариев нет:
Отправить комментарий