Skip to Content
0
Former Member
Jan 29, 2009 at 10:35 AM

alignment problem while sending an email

51 Views

Hi,

while sending a mail the body of the text conaines everything in single line. that too for each avd every sentence it has more sapce.

Eg. the text which i need to send is ,

Dear Sir/Madam,

File Name : ccf.txt

Error : debit total does not match.

Thanks,

rose.

this is what the email content should be . when i send the above content thro email all the contents comes in the same line .

like dear sir/madam filename : ccf.txt error : debit total etc....

the code i used to send mail is given below , can anyone tell me why this is coming. Thanks...

code..

TYPES: BEGIN OF lt_mailadd,

receiver TYPE so_recname,

cc TYPE so_snd_cp,

bcc TYPE so_snd_bc,

END OF lt_mailadd .

DATA: lv_subject TYPE so_obj_des,

li_mailadd TYPE TABLE OF lt_mailadd,

lw_mailadd TYPE lt_mailadd,

lv_separator TYPE c,

li_message TYPE TABLE OF solisti1,

lw_message TYPE solisti1.

  • lv_separator = cl_abap_char_utilities=>cr_lf.

lv_subject = text-010.

lw_message = text-002.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

IF gv_flag = 1.

CONCATENATE text-003 gv_debnomatch_file

INTO lw_message SEPARATED BY space.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

CONCATENATE text-004 text-005 INTO lw_message SEPARATED BY space.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

lw_message = text-011.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

ENDIF.

IF gv_flag1 = 1.

CONCATENATE text-003 gc_archive_path gv_flname INTO lw_message.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

CONCATENATE text-004 text-006 INTO lw_message SEPARATED BY space .

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

ENDIF.

IF gi_errorfile[] IS NOT INITIAL.

CONCATENATE text-003 gv_currinvalid_file INTO lw_message.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

CONCATENATE text-004 text-013 INTO lw_message SEPARATED BY

space.

APPEND lw_message TO li_message.

CLEAR lw_message.

lw_message = ' '.

APPEND lw_message TO li_message.

ENDIF.

lw_mailadd-receiver = 'emailaddress'.

APPEND lw_mailadd TO li_mailadd.

CLEAR lw_mailadd.

  • Calling Method to send mail

CALL METHOD zclxx_mail_services=>sendemail_external

EXPORTING

iv_subject = lv_subject

it_mailadd = li_mailadd

it_mailbody = li_message

iv_sendimmediate = gc_x.