2010 Sep 01 3:18 AM
Hi;
i´m using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send email with 3 attachments, the problem is with the result size of the 3 XLS files in the attachment.
The first XLS attachment file code:
lt_packing_list-transf_bin = 'X'.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 1.
lt_packing_list-body_start = 1.
lt_packing_list-body_num = LINES( lt_attachment ).
lt_packing_list-doc_type = 'XLS'.
lt_packing_list-obj_name = 'ims_productos.xls'.
lt_packing_list-obj_descr = 'ims_productos.xls'.
lt_packing_list-doc_size = lt_packing_list-body_num * 255.
APPEND lt_packing_list. CLEAR lt_packing_list.
the result file size = 1.28mb
if i copy the data to a new excel file the result size is: 588kb
The second XLS attachment file code:
lt_packing_list-transf_bin = 'X'.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 1.
lt_packing_list-body_start = lineas + 1.
lt_packing_list-body_num = LINES( lt_attachment ) - lineas.
lt_packing_list-doc_type = 'XLS'.
lt_packing_list-obj_name = 'ims_clientes.xls'.
lt_packing_list-obj_descr = 'ims_clientes.xls'.
lt_packing_list-doc_size = lt_packing_list-body_num * 255.
APPEND lt_packing_list. CLEAR lt_packing_list.
the result file size = 2.95mb
if i copy the data to a new excel file the result size is: 2.46mb
The third XLS attachment file code:
lt_packing_list-transf_bin = 'X'.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 1.
lt_packing_list-body_start = line + 1.
lt_packing_list-body_num = LINES( lt_attachment ) - line.
lt_packing_list-doc_type = 'XLS'.
lt_packing_list-obj_name = 'ims_ventas.xls'.
lt_packing_list-obj_descr = 'ims_ventas.xls'.
lt_packing_list-doc_size = lt_packing_list-body_num * 255.
APPEND lt_packing_list. CLEAR lt_packing_list.
the result file size = 8.86mb
if i copy the data to a new excel file the result size is: 2.03mb
I know this line ( lt_packing_list-doc_size = lt_packing_list-body_num * 255.) gives the size of the file, but what can i do to get a size file like the one i get if a create the file and copy the data by hand.
the last file using "GUI_DOWNLOAD" gets the file with 2MB size, but as attachment the size increase to almost 9MB.
Any help.
David Fúnez
Tegucigalpa, Honduras
2010 Sep 03 11:31 AM
Hello,
Try using the class CL_BCS.
Refer:
http://wiki.sdn.sap.com/wiki/display/ABAP/SendingMails-HomePage#SendingMails-HomePage-CLBCS
Thanks & Regards,
Omkar M.
2010 Sep 01 4:21 AM
2010 Sep 01 4:59 AM
Thanks for reply;
the problem is that the XLS attachment files are created larger that they should be, if i cut the same data of the XLS attachment and paste it in an excel sheet the size of the new XLS file is lower than the generated attachment.
what i need is to get a real size of the XLS attachment files... because is not the same multiply N lines * 255 = file_size than the size of the XLS file with the same data created by hand.
Now i´m getting an XLS attachment file with 9MB when the real size is 2MB with the same amount of data.
i hope i explained better this time.
I have no problem sending files, the problem is the size of the generated attachments.
Edited by: David Funez on Aug 31, 2010 10:00 PM
Edited by: David Funez on Aug 31, 2010 10:05 PM
2010 Sep 03 11:27 AM
try
gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
2010 Sep 03 11:31 AM
Hello,
Try using the class CL_BCS.
Refer:
http://wiki.sdn.sap.com/wiki/display/ABAP/SendingMails-HomePage#SendingMails-HomePage-CLBCS
Thanks & Regards,
Omkar M.