1

I have an ABAP ALV that shows some data. I need to send the outputed ALV to an email. 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,  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.

Thank you for your help!

here's the function that sends the email:

 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 believe this is a standard sap function. thank you.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Eva Dias
  • 1,709
  • 9
  • 36
  • 67
  • Could you please provide a complete example of what you're trying to do and the expected results? What you show above isn't even a complete HTML page. – vwegert Aug 03 '12 at 06:14

2 Answers2

1

You have to split the body of the message into separate lines for yourself, otherwise the system will introduce hard line breaks somewhere along the way, and it won't care about not breaking HTML tags. This is really nasty to do - I'd rather send a mail with a simple text body that says "please check the attachment" and attach the HTML file to the mail.

vwegert
  • 18,371
  • 3
  • 37
  • 55
  • hi! can you explain better, i don't uderstand your point of view. can you give a simple example? thanks – Eva Dias Aug 02 '12 at 08:05
0

Eva v_mensagem seems to be the body of your email. As it is likely a string you won't have a tag there.

How are you sending the email (which class/function)? Probably there's a work area component which you need to fill before passing it in the function importing parameter.

fabiopagoti
  • 1,467
  • 14
  • 31