2007 Oct 01 4:00 PM
Hi everybody,
we have a problem mailing a attachment by using the class CL_DOCUMENT_BCS in a Unicode system, WAS 7.0
We attach a textfile using the method
CALL METHOD lr_document->add_attachment
EXPORTING
i_attachment_type = lv_extension
i_attachment_subject = lv_dateiname
i_att_content_text = oti_object.
The mail should have a TXT-file in ASCII.
With NOTEPAD, the attachment looks fine.
However with WORDPAD and other applications, all german characters are two bytes, so it seems to be in a UTF-8 format.
Is it possible to say the class, that the attachment should be ASCII?
Regards,
Stefan
2007 Oct 01 5:29 PM
Hi,
Try to use
try.
a_sofm_document = cl_document_bcs=>create_from_text(
i_text = text
i_subject = subject ).
catch cx_bcs into bcs_exception.
error_handling
'cl_document_bcs=>create_from_text' bcs_exception->error_type.
endtry.
** attachment
if w_att = 'X'.
try.
call method a_sofm_document->add_attachment(
i_attachment_type = 'RAW'
i_attachment_subject = 'My attachment'
i_attachment_size = '21'
i_att_content_text = text ).
catch cx_bcs into bcs_exception.
error_handling 'a_sofm_document->add_attachment'
bcs_exception->error_type.
endtry.
endif.
a®
Hi everybody,
we have a problem mailing a attachment by using the class CL_DOCUMENT_BCS in a Unicode system, WAS 7.0
We attach a textfile using the method
CALL METHOD lr_document->add_attachment
EXPORTING
i_attachment_type = lv_extension
i_attachment_subject = lv_dateiname
i_att_content_text = oti_object.
The mail should have a TXT-file in ASCII.
With NOTEPAD, the attachment looks fine.
However with WORDPAD and other applications, all german characters are two bytes, so it seems to be in a UTF-8 format.
Is it possible to say the class, that the attachment should be ASCII?
Regards,
Stefan
2007 Oct 01 5:29 PM
Hi,
Try to use
try.
a_sofm_document = cl_document_bcs=>create_from_text(
i_text = text
i_subject = subject ).
catch cx_bcs into bcs_exception.
error_handling
'cl_document_bcs=>create_from_text' bcs_exception->error_type.
endtry.
** attachment
if w_att = 'X'.
try.
call method a_sofm_document->add_attachment(
i_attachment_type = 'RAW'
i_attachment_subject = 'My attachment'
i_attachment_size = '21'
i_att_content_text = text ).
catch cx_bcs into bcs_exception.
error_handling 'a_sofm_document->add_attachment'
bcs_exception->error_type.
endtry.
endif.
a®
2007 Oct 01 7:19 PM
Hi a®s,
thanks, but this is the way I do it.
Example:
The parameter
i_att_content_text
gets the text:CL_ABAP_CONV_OUT_CE
and put this to the parameterI_ATT_CONTENT_HEX
.Is this correct and has somebody an example of this?
Regards,
Stefan
2007 Oct 02 9:39 AM
Hi everybody,
the problem is solved by using the class CL_ABAP_CONV_OUT_CE.
Regards,
Stefan