Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Format of message body in mail

Former Member
0 Kudos

Hi All,

I am sending an e-mail via SAP. For this I am using the function module 'SO_DOCUMENT_SEND_API1'.

Every thing is fine. I am getting the mail also.

But now I need to change the type of message body from RAW into HTML format. I have passed the doc_type as 'HTM'. But the format of the mail got disturbed.i.e., I have 30 lines in my message body. If I use RAW format, then those lines are coming properly. But if I change to HTM,then all the lines are coming as single line.

PLease find below the example.

RAW form:

TEXT1

TEXT2

TEXT3

HTM form

TEXT1TEXT2TEXT3

I have used the doc_type 'HTML' also. But the result remains the same.

Please help me in this regard.

Regards,

Krish.

4 REPLIES 4

Former Member
0 Kudos

You may try in this way::

l_wa_content+0(16) = 'Region (Sold To)'(012).

l_wa_content+30(3) = l_wa_output_data-region.

APPEND l_wa_content TO l_i_content.

  • Populate the doc size

l_tab_lines = LINES( l_i_content ).

l_doc_chng-doc_size = l_tab_lines * 255.

then call the FM as:

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = l_doc_chng

put_in_outbox = lc_check

commit_work = space

TABLES

packing_list = l_i_packlist

contents_txt = l_i_content

receivers = l_i_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.

Former Member
0 Kudos

Hi Rajeev,

Its not working. Can you lplease explain in detail?

Regards,

Kishore

Former Member
0 Kudos

Krish,

Now that you send in HTML format simple ENTER character does not execute line feed.

You need to add <BR> for each new line you wish.

As per you example:

TEXT1<BR>TEXT2<BR>TEXT3.

Please try & notify.

Good luck,

Shai E.

Former Member
0 Kudos

Krish,

Now that you send in HTML format simple ENTER character does not execute line feed.

You need to add "<BR>"

for each new line you wish.

As per you example:

TEXT1"<BR>"TEXT2"<BR>"TEXT3.

Please try & notify.

Good luck,

Shai E.