08-03-2012 9:34 AM
Hi!
I have an ABAP ALV that shows some data. I need to send the outputed ALV to an email outlook. For now, it works for every email that was sent, except in Outlook. I was told that I need to use something in the tag on the ABAP. Here's the code:
loop at gt_email into ls_email.
clear: v_mensagem, t_html[].
t_html-line = '<html>'.
append t_html.
clear t_html.
t_html-line = '<table border = "1">'.
append t_html.
clear t_html.
t_html-line = '<tr>'.
append t_html.
clear t_html.
t_html-line = '<td>Código de Material</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Descrição</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Depósito</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Stock Actual</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Stock Mínimo</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Stock Máximo</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Necessidade</td>'.
append t_html.
clear t_html.
t_html-line = '<td>Stock LPO</td>'.
append t_html.
clear t_html.
t_html-line = '</tr>'.
append t_html.
clear t_html.
...
and i try with this code, but the result is the same of the pictures
loop at gt_email into ls_email.
clear: v_mensagem, it_message[].
* begin of GC - 26.07.2012
concatenate
'<html><head><table border="1">'
'<tr>'
'<td>Código de Material</td>'
'<td>Descrição</td>'
'<td>Depósito</td>'
'<td>Stock Actual</td>'
'<td>Stock Mínimo</td>'
'<td>Stock Máximo</td>'
'<td>Necessidade</td>'
'<td>Stock LPO</td>'
'</tr>'
into v_mensagem.
...
The result that appear in the email outlook is only this "<" (image: "Email Result").
but the report do the table in the correct way (image: "table")
Can someone help me?
Thanks!
08-06-2012 10:37 AM
hi!
i also use this abap function:
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
sender_address = c_emissor
sender_address_type = 'INT'
commit_work = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_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.
i have no ideia why the html table doesn't appear on the mail. please help me!
08-06-2012 11:39 AM
Hi
Hope this helps you .
Frame the table first
'<table width="950"><tr>'
'<td>Material' ------------------------------header of the table
'</td>'
Finally end tr and table tags
'</tr></table>
Again for data start :
'<table width="950"><tr>'
'<td>lw_material'</td>' -----------------------data of the table
'</tr></table>
Populate this above html tags as below and pass to the FM :
data : i_docu_content type standard table of solisti1 .
lw_docu_content-line = '<table width="950"><tr>'.
APPEND lw_docu_content TO i_docu_content .
CLEAR lw_docu_content .
lw_docu_content-line = '<td>Material'.
APPEND lw_docu_content TO i_docu_content .
CLEAR lw_docu_content .
.
CALL FUNCTION
'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data =
sender_address =
sender_address_type =
commit_work =
TABLES
packing_list =
contents_txt = ---------------------------------------Pass here the html tag table
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
Thanks
Sucharita
Message was edited by: Sucharita Das
08-09-2012 12:33 PM
hi Sucharita Das!!!
I tried this and the result was the same, but i solve the problem. I transferred the html table to a XLS file and attached it to the email.
Thanks