10-30-2007 4:13 AM
When I try to send an email from user exit in ZXPADU02 it never makes it to SOST. WIll always go to SBWP outbox if I set the flag but never gets sent to receiver address.
If I paste the following code into a report it works fine. Is there some other parameter for this FM or some additional process needed to send email from a user exit?
DATA: maildata TYPE sodocchgi1.
DATA: mailtxt TYPE TABLE OF solisti1 WITH HEADER LINE.
DATA: mailrec TYPE TABLE OF somlrec90 WITH HEADER LINE.
CLEAR maildata.
REFRESH: mailtxt, mailrec.
maildata-obj_name = 'SRVC_EMAIL'.
maildata-obj_descr = 'Email test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'Test line from user exit'.
APPEND mailtxt.
mailrec-receiver = 'me@mywork.com'.
mailrec-rec_type = 'U'.
APPEND mailrec.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
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.
10-30-2007 7:40 PM
Put the function call 'SO_NEW_DOCUMENT_SEND_API1'
in a report Program & SUBMIT that report from ZXPADU02.
Arya
10-30-2007 7:40 PM
Put the function call 'SO_NEW_DOCUMENT_SEND_API1'
in a report Program & SUBMIT that report from ZXPADU02.
Arya
10-30-2007 10:29 PM
11-16-2007 9:51 PM
Just found out from a co-worker that if you use IN BACKGROUIND TASK it works fine and no need to create any additional code.