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

Further options when composing e-mails, thry BCS.

Former Member
0 Likes
757

Dear SAP World,

I'm using BCS (Business Communication Services) methods, to compose and send some e-mail messages directly from an ABAP program, to an user's Outlook inbox.

So far, everything is working fine.

Two questions, tough:

1. How can i add an address to the "Carbon Copy" field, so that the message is sent to two addresses, at the same time?

2. Is there any way to format the message body, so that, for instance, i can send a sentence highlighted as bold?

Thanks in advance for your cooperation.

Keep up the good work.

Sincerely,

Hugo Ferreira

7 REPLIES 7
Read only

Former Member
0 Likes
683

Hi,

if you are using this FM..

SO_NEW_DOCUMENT_ATT_SEND_API1

you can send the CC , using

for this you need to append the table parameter

RECEIVERS.

append two record with copy = '', then

for the id which you want as specify copy = 'X'.

append it.

now you have one id with out copy, and the other CC.

for making extra features like html..then check this thread...

regards

vijay

Read only

Former Member
0 Likes
683

In function module SO_OBJECT_SEND, table sparameter RECEIVERS has field SNDCP and SNDBC which you can set to mark as a copy or blind cc.

Pls check this out.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
683

Please make sure to check out this weblog by Thomas Jung. I believe that this will show you what you need to do.

/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

Pay close attention to the ADD_RECIPIENT method.

* Add recipient with its respective attributes to send request
        CALL METHOD send_request->add_recipient
          EXPORTING
            i_recipient  = recipient
            i_express    = recipients_line-i_express
            i_copy       = recipients_line-i_copy
            i_blind_copy = recipients_line-i_blind_copy
            i_no_forward = recipients_line-i_no_foward.

Regards,

Rich Heilman

Read only

0 Likes
683

to bold and other formats set the type to HTM like below.

document = cl_document_bcs=>create_document(

i_type = 'HTM'

i_text = text

i_length = conlengths

Now you can pass html string as content (in the above example variable name text.)

for example for bold you can pass

'<b>This is bold text</b>'

Regards

Raja

Read only

0 Likes
683

Hello Rich. Thanks for your answer. However, the I_COPY parameter of method ADD_RECIPIENT, only indicates if it should send or not a carbon copy, thru a flag type field. But, where do i indicate the e-mail address for the carpon copy, assuming that the I_RECIPIENT parameter stands for the main recipient of the e-mail message?

Thanks in advance,

Hugo Ferreira.

Read only

0 Likes
683

Hi,

Check this line

recipient = cl_cam_address_bcs=>create_internet_address( recipients_line-c_address ).

It is actually assigning the email address.

Since the entire process is in loop.Endloop,if you are passing the recipient for blind carbon copy,that address will come in bcc.

If you are passing,blind copy and carbon copy parameter,that address will be in to field.

Check it out and kindly reward points by clicking the star on the left of reply,if it helps.

Read only

0 Likes
683

you have to call

CALL METHOD send_request->add_recipient

EXPORTING

i_recipient = recipient

i_express = recipients_line-i_express

i_copy = recipients_line-i_copy

i_blind_copy = recipients_line-i_blind_copy

i_no_forward = recipients_line-i_no_foward.

as many times as there are recepients.

suppose you have three recepients. first one without i_copy and the other ones with i_copy = 'X'

Regards

Raja