07-01-2009 1:51 PM
Hello!
We're using SO_NEW_DOCUMENT_ATT_SEND_API1 to send txt files attached to an e-mail.
My problem is that whenever a text file with less than 500 characters is attached to e-mail, the last line of this text file is filled with many blank characters (spaces)
I can only see this if I open the file by the e-mail, and I'm not able to see this blank line in debug.
I think this is related to table CONTENTS_BIN, due to it's line size of char255, but i'm not 100% sure.
Does any one knows how to solve this? We don't want that blank line at the end of the file.
Mauricio
07-01-2009 2:02 PM
Hi Mauricio,
Did you pass xs_gd_doc_data and xt_packing_list in your FM
Constant : lc_name TYPE string VALUE 'Test Mail',
lc_descr TYPE string VALUE 'Test Mail',
lc_f TYPE c VALUE 'F',
lc_zero TYPE c VALUE '0',
lc_one TYPE c VALUE '1',
lc_doctype TYPE string VALUE 'RAW'.
CLEAR: lv_cnt.
xy_message-line = lc_string.
APPEND xyt_message.
CONCATENATE lc_text_01 xv_premise INTO lv_message_premise SEPARATED BY space.
xt_message-line = lv_message_premise.
APPEND xt_message.
CONCATENATE lc_text_02 xv_address INTO lv_message_address SEPARATED BY space.
xt_message-line = lv_message_address.
APPEND xt_message.
CONCATENATE lc_text_03 xv_auszdat INTO lv_message_auszdat SEPARATED BY space.
xt_message-line = lv_message_auszdat.
APPEND xt_message.
DESCRIBE TABLE xt_message LINES lv_cnt.
xys_gd_doc_data-doc_size =
( lv_cnt - 1 ) * 255 + STRLEN( xt_message ).
xys_gd_doc_data-obj_langu = sy-langu.
xys_gd_doc_data-obj_name = lc_name.
xys_gd_doc_data-obj_descr = lc_descr.
xys_gd_doc_data-sensitivty = lc_f.
CLEAR xyt_packing_list.
REFRESH xyt_packing_list.
xyt_packing_list-transf_bin = space.
xyt_packing_list-head_start = lc_one.
xyt_packing_list-head_num = lc_zero.
xyt_packing_list-body_start = lc_one.
DESCRIBE TABLE xt_message LINES xyt_packing_list-body_num.
xyt_packing_list-doc_type = lc_doctype.
APPEND xyt_packing_list.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = xs_gd_doc_data
put_in_outbox = lc_true
commit_work = lc_true
IMPORTING
sent_to_all = lv_sent_all
TABLES
packing_list = xt_packing_list
contents_txt = xt_message
receivers = xt_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
*Do Nothing
ENDIF.
Hope this resolve your query.
Regards,
Manish
07-01-2009 3:39 PM
Hi Manish,
Thanks for the input but I'm passing all the correct parameters to the FM. I just don't know why the TXT file is receiveing the blank line..
07-01-2009 3:44 PM
HI,
Are you passing the correct Document Size.
xys_gd_doc_data-doc_size =
( lv_cnt - 1 ) * 255 + STRLEN( xt_message ).
Regards,
Manish
07-01-2009 3:52 PM
I'm passing the correct size..
And - correct me if i'm wrong - but it seems that this parameter is regarding the message body size, and not the attachements size
03-24-2014 7:02 AM
Hello All,
I am also facing the same problem.
Can anyone let me know how to avoid this.