2014 Apr 15 8:53 AM
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,
2014 Apr 15 9:31 AM
2014 Apr 15 10:28 AM
2014 Apr 15 9:35 AM
as said, use the BCS class for working with emails. Second - did you enhlight what exactly the issue is?
2014 Apr 15 10:31 AM
the program will send all pending emails in SOST, 'SUBMIT rsconn01 WITH mode = 'INT' AND RETURN'
caused the issues. thank you for your help
2014 Apr 15 10:03 AM
2014 Apr 15 10:28 AM
dear,
the issue have been solved, 'SUBMIT rsconn01 WITH mode = 'INT' AND RETURN',the statement will send all emails in SOST. thank you for your help.
2014 Apr 15 10:33 AM
Hello,
The problem is the statement "SUBMIT rsconn01....."
program rsconn01 is exactly the report which sends all pending emails from SOST,
usually we use it in standard job "SAPCONNECT INT SEND".
In additon, please use BCS interface instead of 'SO_NEW_DOCUMENT_SEND_API1'
as per mentioned above.
Regards,
Wen Peng
2014 Apr 15 10:44 AM