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

Body content format not working properly(zig zag) for Email with type 'TXT' ..

former_member653066
Participant
0 Kudos
2,972

Hello Folks,

facing some weird issue while triggering standard email.. which means adding my own body content to std. email body.

done enhancement for FM WLF_GET_MAIL_BODY_PDF_C and added below code.

CALL FUNCTION 'READ_TEXT' 
EXPORTING client = sy-mandt 
          id = 'ST' 
          language = sy-langu 
          name = 'ZEMAIL_BODY' 
          object = 'TEXT'
 TABLES
          lines = lt_lines1.
ET_MAIL_TEXT = VALUE ltt_text( FOR lw IN lt_lines1 ( line = lw-tdline ) ).

how the data shown in Et_mail_text has attached one snap.

but in mail it's showing differently as below


can anyone, help me to solve this issue. ?

warm regards,

Mahesh

1 ACCEPTED SOLUTION
Read only

former_member653066
Participant
0 Kudos
2,712

didn't find proper answer so.. there an alternative using offset of line and add them to table.

currently that's solve my problem.

hence closing this..

thanks,

Mahesh

10 REPLIES 10
Read only

Sandra_Rossi
Active Contributor
0 Kudos
2,712

Please edit your question, select your code and press the "CODE" button to make it correctly colorized/indented, so that it's easier for us to analyze it. Thank you.

Please show the images instead of hyperlinks, it avoids the pain to open and close each of them separately and repeatedly.

Read only

Sandra_Rossi
Active Contributor
0 Kudos
2,712

The question has been asked many times, but probably it's not easy to find them. By the way, that would help a lot if you'd tell us how you transfer ET_MAIL_TEXT to the email (there are many technologies, many ways to transfer).

Read only

Sandra_Rossi
Active Contributor
0 Kudos
2,712
Read only

former_member653066
Participant
0 Kudos
2,712

Hello Sandra,

its a standard code/process.

that modified table data can be seen below as std. process.

do let me know if any doubts?

regards,

Mahesh

Read only

MateuszAdamus
Active Contributor
0 Kudos
2,712

Hello mahesh.drlng

What I see here is that you do not put any new line characters. In plain text email you need to take care of it with the \r or \r\n characters. Best if you use the CL_ABAP_CHAR_UTILITIES=>NEWLINE constant whenever you'd like to have a new line in your email.

I think this will solve your issue.

Kind regards,
Mateusz
Read only

0 Kudos
2,712

Hello Mateusz,

myself tried the same way earlier but of no use.

attaching ref.

thanks,

Mahesh

Read only

0 Kudos
2,712

Keep adding new line characters but skip adding empty lines to the body of the email.


Kind regards,
Mateusz
Read only

0 Kudos
2,712

Hello Mateusz,

done the same thing but not working.

thanks,

Mahesh

Read only

0 Kudos
2,712

In this case I propose you send the generated email to your email address and after receiving it you inspect the code of the email. There you should see why the text is being incorrectly formatted.


Kind regards,
Mateusz
Read only

former_member653066
Participant
0 Kudos
2,713

didn't find proper answer so.. there an alternative using offset of line and add them to table.

currently that's solve my problem.

hence closing this..

thanks,

Mahesh