08-12-2015 11:37 AM
Hello All,
I am sending e-mails with attached MIME objects ...
My problem is attaching another object like a PDF files ...
How can I do it ?
Is there any example ?
I am attaching my codes.
Please check it ...
Regards,
Tanju
08-12-2015 12:03 PM
08-12-2015 12:03 PM
08-13-2015 3:15 PM
Hi Eitan,
Thank you for your response .
Nice working and very helpfull..
You are saying 'the programs alsıo send................... as attachment ' . Right ?
I mean, in my code I have smartforms and I created that pdf file.
So I want to attached it
Before, my old code I have a using function.'SO_DOCUMENT_SEND_API' and attache it.
In your code is it same logic ?
Or is there any difference ?
Regards
Tanju
08-13-2015 5:49 PM
Hi,
The code is attached to the article look at the bottom there
http://scn.sap.com/servlet/JiveServlet/download/38-338104/Y_R_EITAN_TEST_10_06.txt.zip
The program use cl_bcs.
Regards.
08-14-2015 1:50 PM
I appreciated Eitan,
I am changing my code ...
Regards and Greetins
Tanju
08-14-2015 2:36 PM
09-04-2015 12:36 PM
Dear Eitan,
Well, I hope you will remember me ...
Your answer realy helpfull.
I have another question about this subject.
I want to know your recommendation ...
I am sending my mails one by one user.
But we want to send our mails multi users...
So, How should I thought ?
Regards
09-05-2015 6:11 AM
Hi,
If you want to send the same content delivered to multiple recipients :
you can use:
CALL METHOD ob_bcs->add_recipient
EXPORTING
i_recipient = ob_cam_address_bcs.
As you can see you can use the I_BLIND_COPY parameter.
You can also use SAP distribution lists or Send a mail to Microsoft exchange distribution list.
Regards .
10-19-2015 1:22 PM
Hi Eitan,
I need a recommendation, so I want to ask you ...
My boss says, OK, we are sending an e-mail ...
But we need also 'RECEIVED' message
So, I am checking sdn . But I did not find something ...
What do you recommend to me ?
Thank You
Regards
Tanju
10-19-2015 2:20 PM
10-21-2015 12:55 PM
Hi Eitan,
Lets think of multiple recipients ...
My code like that ;
ob_cam_address_bcs = cl_cam_adress_bcs=>create_internte_addresss( p_mail1)
Call method ab_bcs -> add_recipient
exporting
i_recipint = ob_cam_address_bcs.
Think of p_mail1, p_mail2, ..............p_mailn. (I am founding the code.)
I am sending mails one by one ...
We want to send delivered all mails at the sametime .
How can I send it ?
Well, ob_cam_adress_bcs can be wrong,, because I can not write p_mail1, p_mail2, p-mail3 ... p_mailn .
Regards
Tanju
10-21-2015 1:19 PM
Hi,
From syntax point of view.
you need a separate call for each mail address.
ob_cam_address_bcs = cl_cam_adress_bcs=>create_internte_addresss( p_mail1)
Call method ab_bcs -> add_recipient
exporting
i_recipint = ob_cam_address_bcs.
ob_cam_address_bcs = cl_cam_adress_bcs=>create_internte_addresss( p_mail2)
Call method ab_bcs -> add_recipient
exporting
i_recipint = ob_cam_address_bcs.
and so on.
Regards.
10-21-2015 1:29 PM
Hi,
Well, Actually I did it and sent it one by one like your says ...
But When I said how can it run to my boss, He said that, No, iti is not, He did not accept
Try it send it all of them .
I mean think of
'TO' : p_mail1, p_mail2, p_mail3 ....
When he check mail, he want to see all mail ids ...
Is it clear ?
Regards
10-21-2015 2:03 PM
Hi,
On screen create a long text field (p_mails).
Fill p_mails with (p_mail1, p_mail2,...p_mailn) separated with your delimiter .
Split p_mails into internal table at the comma .
see split command http://help.sap.com/abapdocu_740/en/abapsplit_shortref.htm
loop on the table and for each entry apply:
ob_cam_address_bcs = cl_cam_adress_bcs=>create_internte_addresss( <table entry>)
Call method ab_bcs -> add_recipient
exporting
i_recipint = ob_cam_address_bcs.
Regards .
10-22-2015 11:01 AM
Some code
Code fragment:
CALL METHOD cl_bcs_convert=>string_to_soli
EXPORTING
iv_string = my_string
RECEIVING
et_soli = it_soli.
DATA: ob_document_bcs TYPE REF TO cl_document_bcs.
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'HTM'
i_subject = sos33-objdes
i_text = it_soli
RECEIVING
result = ob_document_bcs.
DATA: ob_bcs TYPE REF TO cl_bcs.
DATA: ob_cam_address_bcs TYPE REF TO cl_cam_address_bcs .
ob_bcs = cl_bcs=>create_persistent( ).
CALL METHOD ob_bcs->set_document( ob_document_bcs ).
ob_cam_address_bcs = cl_cam_address_bcs=>create_internet_address( sos04-s_snd_nam ).
CALL METHOD ob_bcs->set_sender
EXPORTING
i_sender = ob_cam_address_bcs.
DATA: it_adr_name TYPE TABLE OF sos04-l_adr_name .
SPLIT sos04-l_adr_name AT space INTO TABLE it_adr_name .
FIELD-SYMBOLS: <st_adr_name> LIKE LINE OF it_adr_name .
DATA: i_copy TYPE abap_bool .
LOOP AT it_adr_name ASSIGNING <st_adr_name> .
ob_cam_address_bcs = cl_cam_address_bcs=>create_internet_address( <st_adr_name> ).
CALL METHOD ob_bcs->add_recipient
EXPORTING
i_copy = i_copy
i_recipient = ob_cam_address_bcs.
i_copy = abap_true .
ENDLOOP.
DATA: result TYPE abap_bool .
CALL METHOD ob_bcs->send
EXPORTING
i_with_error_screen = abap_true
RECEIVING
result = result.
IF result EQ abap_true.
MESSAGE s004(bcs_medium) WITH sos04-l_adr_name .
ENDIF.
COMMIT WORK .
Result in outlook
Regards.
10-22-2015 11:14 AM
11-06-2015 7:11 AM
Dear Eitan,
If you have a time would you like to please check this incident ,
http://scn.sap.com/thread/3822876
Thank You
Tanju