‎2007 Aug 24 10:57 AM
I have used FM 'SO_DOCUMENT_SEND_API1' for email with attachment.
I am getting the mail also the attachment ...
But the data in attachment is not proper .. its like
Test Data for attachment1.
Test Data for attachment2.
Test data for attchment3.
Instead of ........
Test Data for attachment1.
Test Data for attachment2.
Test data for attchment3.
‎2007 Aug 24 11:00 AM
The data in attachment is
Test Data for attachment1.
' SPACES 'Test Data for attachment2.
' SPACES 'Test data for attchment3.
Message was edited by:
Omkar Mirvankar
Message was edited by:
Omkar Mirvankar
‎2007 Aug 24 11:01 AM
‎2007 Aug 24 11:04 AM
I am sending table details in a text file as attachment
Message was edited by:
Omkar Mirvankar
‎2007 Aug 24 11:18 AM
Give a line feed (cl_abap_char_utilities=>cr_lf) at the end of each line while preparing the attachment.
Regards,
Pankaj
‎2007 Aug 24 11:20 AM
Hi,
You have to handle TXT or CSV attachment differently.
You may need to add a Carriage Return Line Feed at the end of your 255 character string....like:
data: w_CR(2) type x value '0D0A'.
........
concatenate <field_name>
w_CR into <field_name>.
You can Also try FM SO_RAW_TO_RTF.
‎2007 Aug 24 11:28 AM
can u elaborate a bit more on this line feed ...
i didnt get this ' cl_abap_char_utilities=>cr_lf '
‎2007 Aug 24 11:38 AM
When u r populating the table to pass as attachment ... concatenate line feed at the end of each row of internal table
concatenate "data" <Line feed> into workarea.
append workarea to internatable
Regards,
Pankaj
‎2007 Aug 24 11:57 AM
I tried using line feed but ..
it didnt wrk ...
the number of characters is not greater than 255 characters ..
‎2007 Aug 24 11:34 AM
Hi Omkar,
You have to concatenate evrey field with the unicode form of TAB for notepad and every new line with the unicode character for NEWLINE of notepad.
Try using this,
LOOP AT gt_itab INTO gs_itab.
CONCATENATE gv_content
gs_itab-key_desc
c_separator
gs_itab-keyword_id
c_separator
gs_itab-class_descr
c_separator
gs_itab-class
INTO gv_content.
IF sy-subrc = 0.
CONCATENATE gv_content c_delimit INTO gv_content.
ENDIF.
CLEAR gs_key_class.
ENDLOOP.
lv_content_len = strlen( gv_content ).
IF lv_content_len <> 0.
lv_increment = 255.
WHILE lv_num <= lv_content_len.
gv_total = gv_total + 1.
gs_email_content-line = gv_content+lv_num(lv_increment).
lv_num = lv_num + 255.
lv_sum = lv_num + lv_increment.
Check if the offset length should be less than 255 characters.
IF ( lv_sum > lv_content_len ).
lv_increment = lv_content_len - lv_num.
ENDIF.
APPEND gs_email_content TO gt_email_content.
CLEAR: gs_email_content.
ENDWHILE.
ELSE.
MESSAGE e000(mc) WITH text-002.
ENDIF.
Now you should know the unicode for c_seperator and c_delimit for notepad.
For CSV file 'C_SEPERATOR' = '~',
'C_DELIMIT' = 'ODOA'.
I think the usage of function module is simple as you have implemented it.
Hope this helps,
Paul.