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

Email from ABAP program

Ash_ok
Contributor
0 Likes
368

Hi !

I am populating the email body with some internal table values. I would like a line feed and carriage return in the email. How do I do it ?

Constants : c_lf(2) TYPE X value '0A'.

c_cr(2) TYPE X value '0D'.

...........

SWC_CREATE_OBJECT MESSAGE 'MESSAGE' SPACE.

SWC_SET_ELEMENT CONTAINER 'DOCUMENTTITLE' 'Title'(020).

SWC_SET_ELEMENT CONTAINER 'DOCUMENTNAME' 'Email message'(020).

SWC_SET_ELEMENT CONTAINER 'DOCUMENTTYPE' 'RAW'.

SWC_SET_ELEMENT CONTAINER 'NO_DIALOG' 'X'.

CONCATENATE 'Dear' firstname INTO CONTENT.

APPEND CONTENT.

CONTENT = c_lf.

APPEND CONTENT.

CONTENT = c_cr.

APPEND CONTENT.

CONTENT 'This is the first line'.

APPEND CONTENT.

...........

The above just appends the hex values of line feed and carriage return into the email body and doesn't actually create a line feed / carriage return.

Any ideas ?

Cheers,

Ashok.

1 REPLY 1
Read only

Former Member
0 Likes
328

If you are using SAP R/3 Enterprise, you might want to look at the class(SE24) CL_ABAP_CHAR_UTILITIES - the attributes section.

Regards,

Subramanian V.