Skip to Content
0
Former Member
Jan 28, 2009 at 11:43 AM

Formatting error in Excel attachment of mail sent

37 Views

Hi,

I'm send a mail using "SO_NEW_DOCUMENT_ATT_SEND_API1"

The snippet of the code is below :

"

  • General Info required to be printed on first row of excel worksheet

CONCATENATE : text-001 text-002 text-003

INTO l_msg_line SEPARATED BY c_tab,

l_msg_line c_ret INTO l_msg_line.

APPEND l_msg_line TO i_attach.

CLEAR l_msg_line.

*Header Line for the table

CONCATENATE: text-009 text-010 text-011 (Error occuring here.)

INTO l_msg_line SEPARATED BY c_tab,

l_msg_line c_ret INTO l_msg_line.

APPEND l_msg_line TO i_attach.

CLEAR l_msg_line.

  • Table data

LOOP AT i_xxxx INTO wa_xxxx.

CONCATENATE: wa_xxxx-aaaaa wa_xxxx-bbbbb wa_xxxx-ccccc c_ret

INTO l_msg_line SEPARATED BY c_tab.

APPEND l_msg_line TO i_attach.

CLEAR l_msg_line.

ENDLOOP.

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = l_doc_data

put_in_outbox = c_x

commit_work = c_x

TABLES

packing_list = i_pack_list

contents_bin = i_attach

contents_txt = i_message

receivers = i_receivers

"

Lots of spaces (an entire line in the excel formula bar) are being entered before the text-009 and hence formatting of the cell is incorrect. The rest of the header line ("text-010 " and "text-011 ") is correctly appearing.

If the first Row in the excel worksheet (general info row) is removed, then there is no error in the header line.

Pl help

Thanks in advance,

Ankit Agrawal.

Edited by: Ankit Agrawal on Jan 28, 2009 12:57 PM