Application Development 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: 

Attacments in Excel with Char > 255 char

Former Member
0 Kudos

I am facing the problem in sending emails attachments through SAP with attachment file type as .xls, I am using fuction SO_NEW_DOCUMENT_ATT_SEND_API1. My table width is >255 characters. I tried using fuction SX_TABLE_LINE_WIDTH_CHANGE but I am unable to get the desired result(sending emails in CSV format with more than 255 characters in a line) The characters get truncated after 255 characters.

I also tried table compress and table decompress.

But not working...any idea will be of great help......

3 REPLIES 3

andreas_mann3
Active Contributor
0 Kudos

Hi Ramesh,

here's an example for att. binary files like xls-files:

*packing list

OBJPACK-TRANSF_BIN = 'X'.

OBJPACK-HEAD_START = 1.

OBJPACK-HEAD_NUM = 0.

OBJPACK-BODY_START = 1.

OBJPACK-BODY_NUM = TAB_LINES.

OBJPACK-DOC_TYPE = 'xls'. "e.g. excel

OBJPACK-OBJ_NAME = 'ANLAGE'.

read table exttab index 1.

OBJPACK-OBJ_DESCR = exttab.

objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objbin ).

APPEND OBJPACK.

*send

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'

EXPORTING

DOCUMENT_DATA = DOC_CHNG

PUT_IN_OUTBOX = 'X'

TABLES

PACKING_LIST = OBJPACK

OBJECT_HEADER = OBJHEAD

CONTENTS_hex = objbin

CONTENTS_TXT = OBJTXT

RECEIVERS = RECLIST

regards Andreas

0 Kudos

Andreas

My problem is not creatin attachment. I have got the attachemnt with only 255 lines where are my internal table has 1149 characters.

I tried all these

call function 'SX_TABLE_LINE_WIDTH_CHANGE'

call function 'TABLE_COMPRESS' and

call function 'TABLE_DECOMPRESS'

But still I cannot fit in the Internal table here.

Soem light on the No of Charters will be helpful.

andreas_mann3
Active Contributor
0 Kudos

Hi Ramesh,

a try:

1) save your file at appl.server with

OPEN DATASET file FOR OUTPUT filter 'compress'.

(File = /tmp/test.Z)

2) open this file and send it binary

(look what,i wrote yesterday)

Good speed !

Andreas