‎2009 Mar 10 5:39 AM
Hi,
When I'm using SO_DOCUMENT_SEND_API1 to send report output to mail in excel format,
the header data in the excel document printing from second row onwards,the first row it is leaving empty .I want to print the header values in the first row onwards.
can any one help me in this regard?
Thanks in advance
Regards,
Anji
‎2009 Mar 10 5:45 AM
Hi,
After bringing your final alv data in the final internal table,
go through this link , i also had an same requirement to send data after converting to excel file and
send it as an attachment to mail id outside Sap,
Hope it helps
Regrds
Mansi
‎2009 Mar 10 5:46 AM
Hi
try giving like this
tables
packing_list =
OBJECT_HEADER = 'X'
‎2009 Mar 10 6:01 AM
Hi anji,
it is because when you are building your excel file, you are leaving an empty space somewhere. refer to the codes below and hope it helps. thanks
Creating the document to be sent
wa_doc_data-obj_name = text-043.
subject
wa_doc_data-obj_descr = p_subj.
i_contents-line = text-061.
APPEND i_contents.
i_contents-line = ' '.
APPEND i_contents.
i_contents-line = text-029.
APPEND i_contents.
DESCRIBE TABLE i_contents LINES v_tab_lines.
READ TABLE i_contents INDEX v_tab_lines.
IF sy-subrc EQ 0.
wa_doc_data-doc_size = ( v_tab_lines - 1 ) * 255 + STRLEN( i_contents ).
ENDIF.
Creating the entry for the compressed document
CLEAR i_packing_list-transf_bin.
i_packing_list-head_start = 1.
i_packing_list-head_num = 0.
i_packing_list-body_start = 1.
i_packing_list-body_num = v_tab_lines.
i_packing_list-doc_type = c_raw.
APPEND i_packing_list.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_data
put_in_outbox = c_x
commit_work = c_x
TABLES
packing_list = i_packing_list
object_header = i_object_header
contents_hex = i_attachment3
contents_txt = i_contents
receivers = i_receiver
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc EQ 0.
MESSAGE s034(zxxxmf) WITH text-048.
ENDIF.
‎2009 Apr 07 6:29 AM