10-25-2012 3:18 AM
HI.... MY requirement is send mail multiple user's at a time in oops-alv ,but i can send mail to sigle user and i tried to send mail to multiple user at a time but that was failed i.e i colud not send mail to multiple users at a time. please could any one know how to solve this problem in oops-alv.
10-25-2012 5:03 PM
Try the following code.
If t_recip has the email id's of all the recipients.
LOOP AT t_recip INTO lw_recip.
CLEAR: lv_sender.
lv_sender = lw_recip-email_id.
* --------- add recipient (e-mail address) -----------------------
recipient = cl_cam_address_bcs=>create_internet_address(
lv_sender ).
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDLOOP.
* ---------- send document ---------------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
This should work fine.
Regards,
Susmitha Pritam
10-25-2012 3:30 AM
Hi Karthik,
Try to send it to distribution list containing multiple user email IDs. You can create distribution list in your exchange server, your IT folks can help you.
Guru
10-25-2012 4:13 AM
10-25-2012 4:31 AM
Karthik,
Check this link http://support.microsoft.com/kb/821904
I am not an expert in exchange server, please check with your IT team they should be able to help you out.
Guru
10-25-2012 5:03 PM
Try the following code.
If t_recip has the email id's of all the recipients.
LOOP AT t_recip INTO lw_recip.
CLEAR: lv_sender.
lv_sender = lw_recip-email_id.
* --------- add recipient (e-mail address) -----------------------
recipient = cl_cam_address_bcs=>create_internet_address(
lv_sender ).
* add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
ENDLOOP.
* ---------- send document ---------------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
This should work fine.
Regards,
Susmitha Pritam
10-28-2012 6:50 AM
Hi... thanks for ur answer.. that is working fine according to ur logic. now iam facing one more issue. now end user want to display data with correspind fileds & their values in table format in mail body section. how to solve this issue please give me solution..
10-29-2012 1:07 PM
Hi,
Try using this method
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = text
i_subject = lv_subj_msg ).
Subject and type are mandatory. Text is a table of line type Soli (255 characters). So you can append you display data line by line to TEXT table and use the above method to create the body with contents.
Note: Soli is only 255 characters in length.
Thanks & Regards,
Susmitha Pritam
10-29-2012 1:08 PM
I suggest you create a form and attach it to the email rather than displaying the content in the body of the email.
11-02-2012 5:35 PM
Hi... as per ur answer i created smartform. then i called function module in driver module & then i called one more FM convert_to_otf ( to convert data in to pdf). then in that FM i used one parameter lines . that parameter value i passed in add_ attachment method . but it is showing error . because in add_attachment method the parameter type & in FM parameter type is diffrent. how to solve this problem? how to use smartform output data in oops-alv while sending data through email . please explain procedure in detail.
11-02-2012 5:36 PM
Hi... as per ur answer i created smartform. then i called function module in driver module & then i called one more FM convert_to_otf ( to convert data in to pdf). then in that FM i used one parameter lines . that parameter value i passed in add_ attachment method . but it is showing error . because in add_attachment method the parameter type & in FM parameter type is diffrent. how to solve this problem? how to use smartform output data in oops while sending data through email . for display data in table fomat ? please explain procedure in detail.
11-06-2012 12:21 PM
Convert_to_otf? i dont see nay FM with this name. Can you please be more specific?
11-15-2012 1:32 PM
hi. sorry .... that is convert_otf this Fm convert smartform data into pdf. CALL FUNCTION 'CONVERT_OTF' EXPORTING format = 'PDF' max_linewidth = 132 IMPORTING bin_filesize = bin_filesize TABLES otf = tab_otf_final lines = pdf_tab EXCEPTIONS err_max_linewidth = 1 err_format = 2 err_conv_not_possible = 3 err_bad_otf = 4 OTHERS = 5. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF
11-15-2012 1:34 PM
HI.. Sorry that is convert_otf CALL FUNCTION 'CONVERT_OTF' EXPORTING format = 'PDF' max_linewidth = 132 IMPORTING bin_filesize = bin_filesize TABLES otf = tab_otf_final lines = pdf_tab EXCEPTIONS err_max_linewidth = 1 err_format = 2 err_conv_not_possible = 3 err_bad_otf = 4 OTHERS = 5. IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF
12-30-2012 1:57 PM
Hi.. iam facing one problem 'user wants attachment name more than 50 chars but in add_attachmnet method the parameter i_attachment_subject is limited to 50 chars. how to solve this pbm? can any one provide solution for this? regards Karthik