‎2008 Mar 11 7:14 PM
Hi friends,
I am using the following fuction module
FORM GET_MAT_FROM_SPREAD .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_FILE2
TABLES
i_tab_converted_data = i_spreadsheet[] . "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " GET_MAT_FROM_SPREAD
but iam getting the error
Excel file FILE://C:\Documents and Settings\my id\Desktop\C cannot be processed
what was problem plz let me know
‎2008 Mar 11 8:00 PM
Hi Sukruthi,
There is a limit on Filename including path. It should be 128 characters.
Have a look at the attached code :
Define the tables according to your import data,
"or just define an structure,
"and then define the internal table
DATA IT_Map type table of ZYFIAccountMapCN.
TYPE-POOLS: truxs.
DATA F_Name(128) type C value 'd:\0927.xls'.
DATA: it_raw TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
I_LINE_HEADER =
I_TAB_RAW_DATA = it_raw
I_FILENAME = F_Name
TABLES
I_TAB_CONVERTED_DATA = IT_Map
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2
.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward Points if it is useful.
‎2008 Mar 12 5:53 AM
‎2008 Mar 12 6:07 AM
hi,
1. Check whether the file path is correct.
2. while converting the file, make sure that the file shuld not opend or accessed by others
3. check the file content and internal table declaration whther both r matched or not.
thanks,
Arunprasad.P