Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Send email from PA30 user exit

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.

Tags:
Former Member
Former Member replied

Put the function call 'SO_NEW_DOCUMENT_SEND_API1'

in a report Program & SUBMIT that report from ZXPADU02.

Arya

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question