dear all,
I use function moudle 'SO_NEW_DOCUMENT_SEND_API1' to send emails. The program will send all pending emails in SOST,after the program is executed.
the code is as below,
DATA:lv_email TYPE string.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = gs_mailsubject
document_type = 'RAW'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_content = gt_mailtxt
receivers = gt_mailrecivers
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.
*push mial out from SAP outbox
WRITE: 'Mail sending successfully.'.
CLEAR lv_email.
CONCATENATE gs_itab-email1 gs_itab-email2 gs_itab-email3 gv_email
INTO lv_email SEPARATED BY space.
WRITE: / 'Receiver:',lv_email.
ULINE.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
CALL FUNCTION 'SO_DEQUEUE_UPDATE_LOCKS'.
ELSE.
WRITE: 'Mail sending failed.'.
ENDIF.
who can help me solve the issue?
Br,