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: 

SO_DOCUMENT_SEND_API1 receiver placed in CC

Former Member
0 Kudos

Hi Friends,

I am using FM SO_DOCUMENT_SEND_API1 to send email to external address. Everything is working fine except that the email address is placed in the CC: section instead of TO:

I have the following code and pass internal table gt_mailrecv in the function module.

gs_mailrecv-receiver = emailid.

gs_mailrecv-rec_type = 'U'.

gs_mailrecv-rec_date = sy-datum.

gs_mailrecv-express = 'X'.

APPEND gs_mailrecv TO gt_mailrecv.

Any idea why?

Thanks,

Nene

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello nene,

Please try this code...

*     Add the recipients email address

clear ireceivers.
refresh ireceivers.
ireceivers-receiver = email.
ireceivers-rec_type = 'U'.
ireceivers-com_type = 'INT'.
ireceivers-notif_del = 'X'.
ireceivers-notif_ndel = 'X'.
append ireceivers

call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = xdocdata
put_in_outbox = 'X'
commit_work = 'X'
tables
packing_list = ipacking_list
contents_bin = iattachment
contents_txt = imessage
receivers = ireceivers
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.

.

Hope it helps you

Regards

Indu.

7 REPLIES 7

Former Member
0 Kudos

use SO_NEW_DOCUMENT_ATT_SEND_API1

<removed_by_moderator>

Bhupal

Edited by: Julius Bussche on Jul 14, 2008 10:15 AM

Former Member
0 Kudos

Check the example:

BCS_EXAMPLE_3

Regards

Kannaiah

Former Member
0 Kudos

Hello nene,

Please try this code...

*     Add the recipients email address

clear ireceivers.
refresh ireceivers.
ireceivers-receiver = email.
ireceivers-rec_type = 'U'.
ireceivers-com_type = 'INT'.
ireceivers-notif_del = 'X'.
ireceivers-notif_ndel = 'X'.
append ireceivers

call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = xdocdata
put_in_outbox = 'X'
commit_work = 'X'
tables
packing_list = ipacking_list
contents_bin = iattachment
contents_txt = imessage
receivers = ireceivers
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.

.

Hope it helps you

Regards

Indu.

Former Member
0 Kudos

Thanks for the quick reply.

I tried your suggestions but didn't work

Forgot to mention that I am also passing a sender, but I am not sure that if that has something to do with the problem. Is there any setting for the receiver and/or sender addresses?

0 Kudos

Hello,

That must not give an error, nene. Please check the COPY parameter mentioned by Storm.

The structure SOEXTRECI1 also has the COPY field ( DE: SO_SND_CP) Please check if it is also included in the exporting parameters.

Regards,

Indu.

0 Kudos

Hi Indu,

No copy parameter is set. I tried removing this 2 lines and now it is placing the receiver in the TO section. This I don't understand, any reason behind?

gs_mailrecv-rec_date = sy-datum.

gs_mailrecv-express = 'X'.

Thanks for the response.

Former Member
0 Kudos

Hi,

Use this way

RECEIVERS-RECEIVER = T_MAILID-MAIL.

RECEIVERS-EXPRESS = 'X'.

RECEIVERS-COPY = T_MAILID-HRMAIL_CC .

RECEIVERS-REC_TYPE = 'U'.

APPEND RECEIVERS.

CLEAR RECEIVERS.

Here,T_MAILID-MAIL is the mailid 'TO' list and

T_MAILID-HRMAIL_CC is the mailid 'CC' list.