Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in Sending Mail

Former Member
0 Likes
377

Hi Experts

I am Converting smartform into PDF and send mail to the mailid mentioned in the vendor master.

Upto PDF conversion its working fine, sending mail is the problem here, am getting value for sy-subrc is '2'.

Iam attaching the code below, please suggest me what could be the reason for the error.

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

document_data = wa_doc_chng

put_in_outbox = 'X'

  • commit_work = 'X'

tables

packing_list = i_objpack

object_header = wa_objhead

contents_bin = i_objbin

contents_txt = i_objtxt

receivers = i_reclist

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.

write:/ 'Error When Sending the File', sy-subrc.

else.

write:/ 'Mail sent'.

endif.

Thanks in advance

regards

Raja

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
356

HI,

Check this link..http://docs.google.com/Doc?id=dfv2hmgs_0fm22tggx&hl=en

Check you have correctly populated packing_list table.

[Smartform as a PDF to Mail id |https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/smartformasaPDFtoMailid]

HI,

Check this link..http://docs.google.com/Doc?id=dfv2hmgs_0fm22tggx&hl=en

Check you have correctly populated packing_list table.

[Smartform as a PDF to Mail id |https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/smartformasaPDFtoMailid]

2 REPLIES 2
Read only

Former Member
0 Likes
357

HI,

Check this link..http://docs.google.com/Doc?id=dfv2hmgs_0fm22tggx&hl=en

Check you have correctly populated packing_list table.

[Smartform as a PDF to Mail id |https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/smartformasaPDFtoMailid]

Read only

KalC
Active Participant
0 Likes
356

Hi Raja,

If you are executing the program then check your user master in SU01 if any email ID is maintained in that or not.If it is being executed by any other user then check that user id for maintanence of email id.If not maintain the same. This might solve your problem.

Thanks & Regards,

Kalyan.