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: 

Function module falling SO_NEW_DOCUMENT_SEND_API1

Former Member
0 Kudos

Hi All,

When iam using the function module SO_NEW_DOCUMENT_SEND_API1 it is giving the sy-subrc as 2 .iam using this code

*Collect the Email,Message type Message body present in the internal table to send an email

WA_MAILDATA-obj_descr = IS_BACKMON-Message_Subject.

*Collect the mailid and reciver type to send an email

WA_RECEIVER-receiver = 'Emailid'.

WA_RECEIVER-rec_type = 'U'.

WA_RECEIVER-com_type = 'INT'.

APPEND WA_RECEIVER to i_RECEIVER.

*Display the context of the message

is_contents_txt = 'Test'.

APPEND is_contents_txt to i_contents_txt.

clear i_contents_txt.

*Send an Email to a Particular person

call function 'SO_NEW_DOCUMENT_SEND_API1'

exporting

document_data = WA_MAILDATA

document_type = 'HTM'

put_in_outbox = 'X'

commit_work = 'X'

tables

OBJECT_CONTENT = i_contents_txt

receivers = i_RECEIVER

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 eq 0.

Please help me if you hav answer

7 REPLIES 7

Former Member
0 Kudos

WA_RECEIVER-receiver = l_email.

Here the variable l_email should contain the full email id.

Former Member
0 Kudos

yes full email id iam providing

Former Member
0 Kudos

change the document type to RAW

Regards

Anbu B

Edited by: Anbu B on Oct 1, 2008 8:45 AM

Former Member
0 Kudos

nothing is there in SCOT no waiting messages are there

Former Member
0 Kudos

Hi,

Is it creating an outgooing email entry in my SAP outbox?

Regards,

Surinder

Former Member
0 Kudos

yes when iam using the same code in another cleint it is working fine but when iam using in my client it is not working and giving the sy-subrc as 2 . May be some settings need to be done in "SCOT' tcode

Former Member
0 Kudos

*Display the context of the message

  is_contents_txt = 'Test'.

  APPEND is_contents_txt to i_contents_txt.

clear i_contents_txt.

why you are clearing every time i_contents_txt.

then it is ok,change setting in scot may be your client is not connected with the mail server or it is using different port for sending mail.