Application Development and Automation 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: 
Read only

Formating string inside email body

Former Member
0 Likes
1,084

Hi All

How can I format the text that it will be placed in lines at the same level regardless of their length

I have several lines with several length ,that will be sent per mail.

for example

cost per shirt 100

cost per trousers 200

-


Total 300

I have tried with several string functions but the without luck.

Thanks.

Edited by: Malu Mader on Dec 6, 2011 10:14 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,044

You may want to consider using the UNDER addition on WRITE statements

8 REPLIES 8
Read only

Former Member
0 Likes
1,044

hi

you can use simple write stmt like this:-

write text1,text2,text3.....

hope this helps ..

regards ,

somesh

Read only

Former Member
0 Likes
1,045

You may want to consider using the UNDER addition on WRITE statements

Read only

0 Likes
1,044

Hi

Thanks for the suggestions but this is not about the write statement , it will be sent by mail so it has to be appended to the text table for the mail

BR

Read only

0 Likes
1,044

Do you want it on the email body?

then go for HTML mode.

in this you can go for any formatting such as < 'p > or table (without grid lines) and you can easily acheive this,

Read only

0 Likes
1,044

like

<table border="0">
<tr>
  <td>mytest</td>
  <td>2</td>
  <td>300</td>
</tr>
<tr>
  <td>test12345</td>
  <td>500</td>
  <td>600</td>
</tr>
</table>

and your output comes as

mytest    2   300 
test12345 500 600

Read only

0 Likes
1,044

Hi Soumyaprakash

This could be the solution , but when I am sending the mail I have already my text in a string table

I am looping into it and appending the string I have in the table into the mail body

so I did in this way but the whole string is comming out including the <td> and so on

lt_mailtxt = '<table border="0">' .

APPEND lt_mailtxt.

CLEAR lt_mailtxt.

LOOP AT it_string.

lt_mailtxt = '<tr>'.

APPEND lt_mailtxt.

clear lt_mailtxt .

lt_mailtxt = '<td>' .

APPEND lt_mailtxt.

CLEAR lt_mailtxt.

lt_mailtxt = it_string.

APPEND lt_mailtxt.

CLEAR lt_mailtxt.

lt_mailtxt = '</td>' .

APPEND lt_mailtxt.

lt_mailtxt = '</tr>' .

APPEND lt_mailtxt.

ENDLOOP.

lt_mailtxt = '</table>' .

APPEND lt_mailtxt.

CLEAR lt_mailtxt.

What am I missing... ?

BR

Read only

0 Likes
1,044

Hi,

If you don't want to bother with html, you could also use a structure and char fields instead of a string...


TYPES: BEGIN OF ts_data,
          key(20) TYPE c,
          val(10) TYPE c,
        END OF ts_data.

DATA: ls_data TYPE ts_data,
      l_str(1024) TYPE c.

 ls_data-key = 'Cost per shirt'.
 ls_data-val = 100.
 l_str = ls_data.
"WRITE: l_str.

 ls_data-key = 'Cost per trousers'.
 ls_data-val = 200.
 l_str = ls_data.
"WRITE: / l_str.  

Kr,

Manu.

Read only

0 Likes
1,044

Thank you Manu

Problem soleved

BR