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 Sending Mail Using FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'

Former Member
0 Likes
1,396

Dear All,

I am calling the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' inside the program to send mail to ( i.e [email protected]) either yahoo or gmail or etc.

After calling this function module i am getting error message ''Document could not be sent to any recipient'' i.e sy-subrc = 2.

But i am using same function module with SAPUSER ID as a receiver list its working fine.

Please let me know why this problem comming to send email to extenal.

  • Sending the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = doc_chng

put_in_outbox = 'X'

COMMIT_WORK = 'X'

TABLES

packing_list = g_t_packing

object_header = g_t_objheader

contents_txt = g_t_objtxt

receivers = g_t_receivers

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

CASE sy-subrc.

WHEN 0.

WRITE 'The document was sent'.

WHEN 1.

WRITE: / 'No authorization for sending to the specified number',

'of recipients'.

WHEN 2.

WRITE: / 'Document could not be sent to any recipient'.

WHEN 4.

WRITE: / 'No send authorization'.

WHEN OTHERS.

WRITE: / 'Error occurred while sending'.

ENDCASE.

Dear All,

I am calling the function module 'SO_NEW_DOCUMENT_ATT_SEND_API1' inside the program to send mail to ( i.e [email protected]) either yahoo or gmail or etc.

After calling this function module i am getting error message ''Document could not be sent to any recipient'' i.e sy-subrc = 2.

But i am using same function module with SAPUSER ID as a receiver list its working fine.

Please let me know why this problem comming to send email to extenal.

  • Sending the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = doc_chng

put_in_outbox = 'X'

COMMIT_WORK = 'X'

TABLES

packing_list = g_t_packing

object_header = g_t_objheader

contents_txt = g_t_objtxt

receivers = g_t_receivers

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

CASE sy-subrc.

WHEN 0.

WRITE 'The document was sent'.

WHEN 1.

WRITE: / 'No authorization for sending to the specified number',

'of recipients'.

WHEN 2.

WRITE: / 'Document could not be sent to any recipient'.

WHEN 4.

WRITE: / 'No send authorization'.

WHEN OTHERS.

WRITE: / 'Error occurred while sending'.

ENDCASE.

7 REPLIES 7
Read only

Former Member
0 Likes
846
TABLES
packing_list = g_t_packing
object_header = g_t_objheader
contents_txt = g_t_objtxt
receivers = g_t_receivers

where is hte body of the content ?

i think this is missing .

<b>contents_bin</b> = objbin

just check the same

regards,

vijay

Read only

0 Likes
846

Hi Viyaj,

Thanks for rely!

But with out 'contents_bin = objbin' i am able to send mail to sapusers. the problem only sending mails to outside(non-sap users).

Read only

0 Likes
846

Then your mail server has to be checked by the basis team .

If this is not configured then it will show in processing mode till the server is checked .

Check the SCOT settings for the same .

You may be seeing the mail as delivered in the outbox of SBWP but not to external receivers.

regards,

vijay

Read only

0 Likes
846

You may be seeing the mail as delivered in the outbox of SBWP but not to external receivers. - Yes Vijay i am to see the mails(Business workplace)

i have run the transactio 'SCOT ' and (INT-> SMTP) can you please send me the details of this because here the basis people don't know this. please help me on this. i told the same to basis people but still they dont have the idea how to configure.

Read only

0 Likes
846

I dont know settings of SCOT i dont have authorization to see that transactions.

regards,

vijay

Read only

Former Member
0 Likes
846

Hi sudheer,

do you fill receiver like this:

CLEAR REC_LIST.

REC_LIST-RECEIVER = '[email protected]'. "email address

REC_LIST-REC_TYPE = 'U'.

APPEND REC_LIST.

Regards, Dieter

Read only

0 Likes
846

it did same ! But still it is not working