Skip to Content
Oct 01, 2012 at 04:38 PM

Sending mail with TEXT attachment


Hello everybody, I have a problem with an email attachment. In my program, I have to send an email with a text (.txt extension) attachment. For doing this they are using SO_DOCUMENT_SEND_API1 FM.
They are saying in the email configuration that it’s TXT format and RAW document type. Each record at the end needs to have 72 blanks. When they receive the email with the attachment, each record ends in the last significant carácter, I mean that the 72 blanks are missing. This is the piece of code that builds the attachment: DATA: vl_subrc TYPE sy - subrc VALUE 0.

CLASS cl_abap_char_utilities DEFINITION LOAD.

CONSTANTS: cl_tab TYPE c VALUE cl_abap_char_utilities => horizontal_tab,
cl_cret TYPE c VALUE cl_abap_char_utilities => cr_lf.

LOOP AT ti_mail INTO wa_mail.

wa_attach -line = wa_mail.
APPEND wa_attach TO ti_attach.

Where ti_mail and wa_mail have the following definition: TYPES: BEGIN OF ty_line2,
line(160 ) TYPE c,
END OF ty_line2. DATA: ti_mail TYPE TABLE OF ty_line2,
wa_mail TYPE ty_line2. And wa_attach and ti_attach: DATA: t i_attach TYPE TABLE OF solisti1,
wa_attach TY PE solisti1. Do you know how to generate that attachment with the blanks at the end? I can’t define any caracter after them, only the blanks. Thanks in advance and many kind regards.