Application Development 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: 

Error in Sending email :SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Kudos

Hiiiii Every1,

I m sending e-mail in Html format using the above mentioned FM.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

commit_work = 'X'

document_type = 'HTM'

document_data = doc_chng

put_in_outbox = 'X'

TABLES

object_header = objcont

object_content = objcont

receivers = reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

and sending it automatically using

SUBMIT rsconn01

WITH mode EQ 'INT'

AND RETURN.

What the error is that when i send e-mail what i have to check is that weather the the E-mail is sent from SOST or Not..If the Status of that e-mail is Delivered then i have to set a flag for sucess.

Else..Error Message.

How i can check weather is mail is delivered to recipent or Not even if SMTP is creating problem or due to any reason mail is not sent. I have to check.

Plz do reply as soon as Possible.

Thanks & Regards

-


Sachin Dhingra

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

Hi sachin,

Check for the following field in receivers table.

RETRN_CODE

When the recipient has received the document, the function module enters the value '0' in this field. If the document is not successfully received, a value unequal to '0' is entered in the field.

REgards,

Ravi

0 Kudos

hi Ravi

I m using this FM in meathod for a class.

Earlier i was able to send mails by using this retrn_code.

but i think it gives value 0 when it is just send to Job Queue in SOST.

But i m scheduling the Jobs by sending it automatically using

SUBMIT rsconn01

WITH mode EQ 'INT'

AND RETURN.

Now what This Program Returns that after sending jobs from SOST.

In my case it still give some error for example:

Status - RED ICON

Msg. 808 :- No delivery to , as no route known

Or ny of the error having RED ICON weather it is due to SMTP problem or ny problem. For this error Status i have to set flag....the email is not sent..

When a green ICON is displayed for status of Email i have to set a flag for Sucess.

Hope this will clear the scenario..

Thanks & regards

-


Sachin Dhingra

Former Member
0 Kudos

Read this post:

Former Member
0 Kudos

Hi Sachin,

After using FM. Check Sy-subrc.

Sample code:

case SY-SUBRC.

when 0.

message S999(YF01) with 'Mail sent with attachment'.

when 1.

message E999(YF01) with 'No authorization for sending to the specified number of recipients'.

when 2.

message E999(YF01) with 'Document could not be sent to any recipient'.

when 4.

message E999(YF01) with 'No send authorization'.

when others.

message E999(YF01) with 'Error occurred while sending'.

endcase.

If u get sy-subrc = 0 then goto SCOT to check ur mail status. Most probably this transaction is sheduled by basis person. So, after execution of ur FM mail will sent to the respactive person.

Regards,

Digesh Panchal

former_member191062
Active Contributor
0 Kudos

Hallo,

I think I understand what you mean. You need the end status of the document after the send process has finshed.

Please try the following way:

After calling

SO_NEW_DOCUMENT_SEND_API1

check the Export parameter:

NEW_OBJECT_ID

It will cointain the new object ID wich is created.

After submiting the send process manually (usually this is not recommended...) the status of the document is updated in the DB Table:

'SOST'.

In this you can look for the object by:

OBJTP         
OBJYR         
OBJNO   

(This can be found in the NEW_OBJECT_ID ).

The fileds:

MSGID
MSGTY
MSGNO

of the table

SOST

will contain the information you requiere.

I hope this helps you.

Regards.