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

How to add cc recipient using cl_bcs

Former Member
0 Likes
20,414

I met one problem with adding a cc recipient in email

the code for adding cc recipient is pasted below.

i thought setting i_copy flag to 'X' simply means this recipient is a copy to

but after i received the email ( i add myself as cc), i found my name is in the TO field, not cc

anyone could help on this problem? thanks in advance.


data: lo_recipient          TYPE REF TO if_recipient_bcs,
         lo_recipient = cl_cam_address_bcs=>create_internet_address( lv_email_addr ).
         CALL METHOD lo_send_request->add_recipient
                   EXPORTING
                   i_recipient = lo_recipient
*                  i_express   = c_char_x
                   i_copy      = c_char_x.

I met one problem with adding a cc recipient in email

the code for adding cc recipient is pasted below.

i thought setting i_copy flag to 'X' simply means this recipient is a copy to

but after i received the email ( i add myself as cc), i found my name is in the TO field, not cc

anyone could help on this problem? thanks in advance.


data: lo_recipient          TYPE REF TO if_recipient_bcs,
         lo_recipient = cl_cam_address_bcs=>create_internet_address( lv_email_addr ).
         CALL METHOD lo_send_request->add_recipient
                   EXPORTING
                   i_recipient = lo_recipient
*                  i_express   = c_char_x
                   i_copy      = c_char_x.

3 REPLIES 3
Read only

Former Member
0 Likes
7,348

check this you are correct but are you sending mail??? or checking in sost??

regards

sas

Read only

Former Member
0 Likes
7,348

Hi,

Try to uncomment the I_express field and pass 'X' and comment the i_copy. Just play with these import parameters....

data: lo_recipient          TYPE REF TO if_recipient_bcs,
         lo_recipient = cl_cam_address_bcs=>create_internet_address( lv_email_addr ).
         CALL METHOD lo_send_request->add_recipient
                   EXPORTING
                   i_recipient = lo_recipient
                   i_express   = c_char_x
       "            i_copy      = c_char_x.

.

If this si not working means, some problem with the outlook. In that case try to send to gmail or yahoo ID and check...

i_copy should be sufficient... Lets check.

Thanks and Regards,

Senthil Kumar Anantham.

Read only

Former Member
0 Likes
7,348

Hi Dear,

Please Try this

DATA: LWA_DOC_CHNG LIKE SODOCCHGI1,

        LW_SUBJECT     TYPE SO_OBJ_DES,

        SEND_REQUEST TYPE REF TO CL_BCS,

        LR_EMAIL_BODY TYPE REF TO CL_DOCUMENT_BCS,

        LX_DOCUMENT_BCS TYPE REF TO CX_DOCUMENT_BCS,

        L_O_RECIPIENT TYPE REF TO CL_CAM_ADDRESS_BCS,

        LO_DOCUMENT     TYPE REF TO CL_DOCUMENT_BCS,

        SENT_TO_ALL TYPE OS_BOOLEAN,

        STATUS_MAIL TYPE BCS_STML,

        WA_MSG TYPE SOLISTI1,

        IT_MSG TYPE STANDARD TABLE OF SOLISTI1.

wa_msg-LINE = 'hi everybody'.

APPEND wa_msg to it_msg.

  LW_SUBJECT = 'TIC GENERATION'.

  LWA_DOC_CHNG-OBJ_DESCR = LW_SUBJECT.

  SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).

  STATUS_MAIL = 'N'.

  CALL METHOD SEND_REQUEST->SET_STATUS_ATTRIBUTES

    EXPORTING

      I_REQUESTED_STATUS = STATUS_MAIL

      I_STATUS_MAIL      = STATUS_MAIL.

  SEND_REQUEST->SET_SEND_IMMEDIATELY( 'X' ).

  LR_EMAIL_BODY = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(

  I_TYPE = LC_TYPE

  I_TEXT = IT_MSG

  I_SUBJECT = LW_SUBJECT ).

  SEND_REQUEST->SET_DOCUMENT( LR_EMAIL_BODY ).

  L_O_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( MAILid ). "to

  SEND_REQUEST->ADD_RECIPIENT( I_RECIPIENT = L_O_RECIPIENT I_EXPRESS = 'X'

  I_COPY = ' ' ).

  L_O_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( hrMAILid ).   "cc

  SEND_REQUEST->ADD_RECIPIENT( I_RECIPIENT = L_O_RECIPIENT I_EXPRESS = 'X'

  I_COPY = abap_true ).

  SEND_REQUEST->SET_SEND_IMMEDIATELY( 'X' ).

  SENT_TO_ALL = SEND_REQUEST->SEND( I_WITH_ERROR_SCREEN = ' ' ).

  COMMIT WORK.

  CLEAR IT_MSG.

  CLEAR WA_MSG.