‎2010 Aug 16 4:52 PM
Hi Experts,
I am using the function module SO_DOCUMENT_SEND_API1 to to send the mail data into excel file.But for one character field leading zeros are missing.
Pl. see the below code.
w_packing_list-transf_bin = 'X'.
w_packing_list-head_start = 1.
w_packing_list-head_num = 1.
w_packing_list-body_start = 1.
w_packing_list-body_num = gv_cnt.
w_packing_list-doc_type = 'XLS'.
w_packing_list-obj_descr = ld_mtitle.
w_packing_list-obj_name = lv_attfilename.
w_packing_list-doc_size = w_doc_data-doc_size.
APPEND w_packing_list to gt_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = gt_packing_list
contents_bin = gt_attachment
contents_txt = gt_message
receivers = gt_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.
Pl.give me suggesion , is there any parameter missed in function module?
Regards,
Jayaram
‎2010 Aug 16 8:37 PM
Hi,
I have written the following code to mail data and this is working -
wa_it_packing_list-transf_bin = space.
wa_it_packing_list-head_start = 1.
wa_it_packing_list-head_num = 0.
wa_it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES wa_it_packing_list-body_num.
wa_it_packing_list-doc_type = 'RAW'.
APPEND wa_it_packing_list TO it_packing_list.
However I'm sending an email out of SAP. For your process, you might want to look at the above parameter values (except the doc_type ofcourse). Hope this helps.
Regards, Liz