‎2009 Jan 08 8:53 AM
Hi...
I am using the function module 'SO_DOCUMENT_SEND_API1' to send an email attachement in EXCEL format.
The email is getting received along with the attachment, but when i try to open the excel file, i am getting an error stating "Unable to Read File"......
What could be the reason behind this error.......
Plz Help......
‎2009 Jan 08 9:35 AM
Hi,
Declare above fun mod 'SO_DOCUMENT_SEND_API1' it_objpack-doc_type = 'CSV'.
Check in fun mod 'SO_DOCUMENT_SEND_API1'
TABLES
packing_list = it_objpack
Thanks,
Krishna..
‎2009 Jan 08 10:25 AM
‎2009 Jan 08 11:28 AM
Hi,
If the excel file is not SAP generated (like downloaded by any report) it usually creates problem in uploading the same (may be due to some format problem, also try removing worksheets from the excel file so that only one worksheet remains in the file).
The best way to overcome the problem is to convert the Excel file to a tab-delimited Text file first. Now convert this tab-delimited text file back to an Excel file.
Now if you try uploading this created excel file to SAP then there should be no problems.
Cheers.
‎2009 Jan 08 12:10 PM
Hi..
I tried the tab delimited text file but still i am gettin the same error...... ... ...
‎2009 Feb 26 9:33 AM
Hi,
Firstly, convert Excel Format with FM: SAP_CONVERT_TO_TXT_FORMAT ,
" Format convert(Excel content)
CALL FUNCTION 'SAP_CONVERT_TO_TXT_FORMAT'
EXPORTING
I_LINE_HEADER = 'X'
TABLES
I_TAB_SAP_DATA = GIT_DATA "Before convert
CHANGING
I_TAB_CONVERTED_DATA = GIT_EXCEL "After convert
LOOP AT GIT_EXCEL INTO LFC_STMP.
LI_ITMP = STRLEN( LFC_STMP ).
LFC_STMP+LI_ITMP = CL_ABAP_CHAR_UTILITIES=>CR_LF.
MODIFY GIT_EXCEL FROM LFC_STMP.
ENDLOOP.
Then, send Email with .xls attachment via FM: SO_DOCUMENT_SEND_API1.
Best Regards
Lily