10-10-2008 11:57 AM
hi all,
Good morning.
My requirement is to send a report as an excel attatchment to the respective managers mail box. For this I am using the function module SO_DOCUMENT_SEND_API1 as follows.
call function 'SO_DOCUMENT_SEND_API1'
exporting
document_data =
put_in_outbox =
sender_address =
sender_address_type =
commit_work =
tables
packing_list =
object_header =
contents_bin =
contents_txt =
receivers =
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
Here the problem is contents_bin is of type SOLISTI1 which takes max 255 characters, As my report columns occupies more than 400 characters, I am unable to get all the column values in excel attachement.
Can anyone please help me to get all the column values in the excel attachment.
Thanks in Advance.
10-10-2008 12:02 PM
Hi Srivallika
make a Z copy of FM ALSM_EXCEL_TO_INTERNAL_TABLE
make a Z copy of structure ALSMEX_TABLINE
change ZALSMEX_TABLINE-VALUE from char50 to char1000
Regards.
Eshwar.
10-10-2008 12:07 PM
Hi,
Use this FM TABLE_COMPRESS
Try like this....
RECEIVER_list-RECESC = 'E'. "<-
RECEIVER_list-SNDART = 'INT'."<-
RECEIVER_list-SNDPRI = '1'."<-
APPEND receiver_list.
General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
Mail subject
w_object_hd_change-objdes = 'Message subject'.
Mail body
APPEND 'Message content' TO message_content.
Attachment
CALL FUNCTION 'SAVE_LIST'
EXPORTING
list_index = '0'
TABLES
listobject = listobject.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = listobject
out = compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.
Hope it will helps