2016 May 09 6:32 AM
Hi all,
I am using TEXT_CONVERT_XLS_TO_SAP to upload excel and convert the data into an internal table.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
* i_line_header = 'X'
i_tab_raw_data = gt_raw
i_filename = p_file
TABLES
i_tab_converted_data = gt_del
EXCEPTIONS
conversion_failed = 1
OTHERS = 2
However, and sy-subrc is always 1.
I have digged out of an error which is DOCUMENT_TYPE_NOT_REGISTERED inside the FM.
I have gone through many samples and I think the code is OK.
Can anyone help me out?
2016 May 09 6:35 AM
The excel has 9 cols and so does the internal table.
I also have tried the both cases in having header or not.
2016 May 09 8:19 AM
Hi Ming Yu,
two questions:
1-your system release,
2-the kind of file you are trying to upload. (XLS? XLSX?)
This because some releases don't manage well XLSX files with this FM.
Another thing: check you have excel closed when you run the FM (check even Task Manager where sometimes excel's processes runs even when you close it).
2016 May 09 9:37 AM
It's 740 final and the excel is XLSX.
I let another guy to try my code and it worked on his computer.
So I think it has something to do with the environment.
2016 May 09 9:41 AM
Did you check the task manager as i suggested? The file was the same?
2016 May 09 9:41 AM
2016 May 09 9:45 AM
I have checked the task manager.
BTW, I recall that my office is some sort of read-only version.
So is it the reason that SAP cannot get data from excel?
2016 May 09 9:50 AM
Urgh.. never met this kind of combo so i avoid giving you wrong infos.
Sorry i was not so useful 😐
2016 May 09 10:13 AM
Not really, your info is helpful and thank you for the help:)
2016 May 09 9:58 AM
Hello Ming,
Trying using this fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload the data into internal table.
2016 May 10 1:08 AM
Hi Ming,
I checked the FM TEXT_CONVER_XLS_TO_SAP and it worked fine for me. Hope you internal table contains only the char fields.
Alternate you can use any of the below :
1. You can use the FM : ALSM_EXCEL_TO_INTERNAL_TABLE
2. You can use the OO concept. Check the lonk below
Thanks
Deepak Sharma
2022 Feb 15 6:24 AM
2022 Apr 28 4:06 PM
Dear Ming,
Please check your input .XLSX file, if file contains any date/time column then check it's format.
If your system's date/time format is not matching with your SAP system's date/time format then this FM will cause an error i.e sy-subrc = 1.
E.g
Date format in your system = 01-21-2021 and Date format in SAP system = 01/21/2021. Here separators are different. And your excel file pick your system's date/time format.
So to use this FM 'TEXT_CONVERT_XLS_TO_SAP' if your file having date/time columns then your system's date/time format and SAP system's date/time format must be identical.
Thanks & Regards,
Rahul B