08-24-2010 9:20 PM
hi folks,
do you know how to send body of an email when email sending with FM SO_OBJECT_SEND.
i am using objcont parameter but the body is not coming.
08-24-2010 10:48 PM
Hi ,
You must populate the table parameter objcont for email body content. for more details please search in SCN.
I would suggest you to use the BCS classes because the fm you have mentioned will not support chinese,japanese etc characters in unicode environment.
Goto se38 and search f4 for BCSexample, you will get the examples for how to use BCS Classes for attachments,body content etc.
08-24-2010 9:29 PM
Hi Niraja,
Instead of the FM you can use the class cl_bcs to send the email. Below is the sample code
REPORT zemail_test.
DATA: lv_message TYPE bcsy_text,
lv_send_result TYPE c,
lo_receiver TYPE REF TO if_recipient_bcs,
lo_email TYPE REF TO cl_bcs,
lo_email_body TYPE REF TO cl_document_bcs,
lx_exception TYPE REF TO cx_bcs.
APPEND '<font color="#0000FF">Hello World... This is a test email!</font>' TO lv_message.
TRY.
lo_email = cl_bcs=>create_persistent( ).
lo_email_body = cl_document_bcs=>create_document(
i_type = 'HTM'
i_text = lv_message
i_subject = 'Message from SAP BCS' ).
lo_email->set_document( lo_email_body ).
lo_receiver = cl_cam_address_bcs=>create_internet_address( 'someone @ somewhere.com' ).
lo_email->add_recipient( i_recipient = lo_receiver
i_express = 'X' ).
lo_email->set_send_immediately( 'X' ).
lo_email->send( EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_send_result ).
WRITE: / 'Message sent successfully', lv_send_result.
COMMIT WORK.
CATCH cx_bcs INTO lx_exception.
WRITE:/ 'Message failed:', lx_exception->error_type.
ENDTRY.
Hope this helps you...
Thanks
Satya
08-24-2010 9:48 PM
i need to even send attachments in the emails
and attachments are working fine with the so_object_send.
how to send attachmetns with the way u told
08-24-2010 10:48 PM
Hi ,
You must populate the table parameter objcont for email body content. for more details please search in SCN.
I would suggest you to use the BCS classes because the fm you have mentioned will not support chinese,japanese etc characters in unicode environment.
Goto se38 and search f4 for BCSexample, you will get the examples for how to use BCS Classes for attachments,body content etc.
08-24-2010 11:30 PM
hi i have looked into BCS* programs and copied one of when i try to open the attachment in SOSt, it says file may be corrupted or wrongly decoded what is thi?
08-24-2010 11:49 PM
is it a pdf ?
if so search in scn with the error meesage, this is discussed many times
Edited by: Keshav.T on Aug 25, 2010 4:22 AM
08-25-2010 12:02 AM
what error message shall i search?
also there was anotehr program which was telling that it creates a document .. but when i see the attachment, it doesnt have any extension..
it just says in code as type = RAW.