2012 Mar 22 7:30 AM
Hi Friends,
As i have a requirement of reading excel file from application level and need to update a standard table. So when we tried to read using open data set syntax, we are getting a junk data like #############@####(@@ instead of the actual data we entered in excel before uploading to al11. Any kinda of suggestions or ideas are always welcome and also appreciable.
Thanks in advance.
Regards,
Sai...
2012 Mar 22 7:43 AM
Hi
What additions are you using with OPEN DATASET, Try below
OPEN DATASET filepath FOR INPUT IN TEXT MODE ENCODING DEFAULT.
Or else
Convert XLS to CSV file and try
Thanks,
Chandra
2012 Mar 22 8:19 AM
Hi Chandra,
Thanks for giving reply. But if we try to read data using text mode it will not allow, since we are uploading excel in BIN type. And for notepad it is working fine. But client is uploading only excel file.
Please help me to sort this problem.
Thanks & Regards,
Sai...
2012 Mar 22 9:02 AM
Excel internal data were stored in a proprietary format til recent version which use a xml format (.xlsx) Open dataset wont be able to convert the data flow into an internal table.
- For old version : call an Excel application via OLE to read the data (you need a GUI connexion) /or/ export from Excel to a flat format (csv) or convertible (html) before uploading to application server (AL11)
- For recent version : you could look at abap2xlsx
Regards,
Raymond
2012 Mar 22 9:35 AM
Hi Sai,
You can try in below manner.
CALL METHOD zclxx_file_services=>app_directory_list_files to get the file from App server.
after that CALL METHOD zclxx_file_services=>gui_upload
It works perfectly as i have used in some of my earlier requiremtn.
Thanks,
Deb
2012 Mar 22 10:03 AM
HI Deb,
I think zclxx_file_services is the custom class you might have written or available in your system. if you could post that code, it might help.
Janisar
2012 Mar 22 12:26 PM
I don't think Debdas realizes that 1: he is suggesting use of foreground techniques for background jobs, that he is promoting use of code developed in his customer site that has no relevance to the original post, and that his claims to have done this are, as a result, suspect.
2012 Mar 22 12:36 PM
Hi,
exist the function module 'TEXT_CONVERT_XLS_TO_SAP' but i think that this function module takes file from a local folder. In any case you can try it. If not run, check the code implemented in this function module and apply it in your program. This FM is using interfaces i_oi_document_proxy and i_oi_spreadsheet to substract data from excel file and append this data to an internal table. I have used these interfaces to open a file from al11 and runs good.
Regards,
Marc.
2012 Mar 27 6:15 PM
Thank you very much David, Marc and all for your valuable suggestions. As they need immediate solution, we done the things in little lengthy way. We downloaded the file from AL11 to Presentation level using FM(we can do it using CG3Y also). And done the process and then deleted that file.
But i am not satisfied with what i have done..I don't think that this is apt solution for this problem. So definitely follow the suggested ways in thread and also welcome any other suggestions.
Thanks & Regards,
Sai Kiran Rao.