06-13-2012 3:25 PM
I am using ARCHIVOBJECT_GET_TABLE to read archive file and in return it gives content in internal table.
Binary table format is RAW 1024 and not able to read file contents.
I want to read XLS file's content and process further logic.
MOreover running in background so GUI_DOWNLOAD and other options are not recommended
Please suggest.
06-13-2012 4:18 PM
I use this module and retrieve my archived object into a binary table described like:
LT_BINTAB type table of tbl1024.
Then I use one of the SCMS* Function modules to convert to text, if I need. But once you have that .XLS file retrieved from the archive, you still need to get the XLS into something that you can use in SAP. One thing I might consider is grabbing the binary table, then download it into a SAP GUI work folder with the .xls extension, then use FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' to read it into a table that I can use in SAP. Your user doesn't have to know that you downloaded, since you can find the workdir with a method of CL_GUI_FRONTEND_SERVICES. There are probably other ways, but if it is actually an .XLS file, you will need a conversion to a file or internal table that you can process.
06-13-2012 8:21 PM
Thank you for response. I am already doing this. Downloading on to presentation and then read that excel back. But requirement is that program is supposed to run in background and hence I should read content and w/o downloading on presentation I should be able to interpret content and use them for further processing.
Let me know if there is any way to convert Binary table into readable format.
06-27-2012 5:54 PM
Nothing worked out.
Finally we decided to change XLS file into CSV and then read it.
I can read CSV files properly. We shall ask out vendors to send CSV file instead of XLS and continue with interface.
Closing this thread.
06-27-2012 6:22 PM
condensed, tab-delimited (.txt) would be a much better choice! I would absolutely avoid .csv, due to all the work needed to remove those quotes, and if something comes in with a comma in the field without quotes, you read is fouled up, not good to have a delimiter that is very likely to appear in text fields such as names, addresses, texts, descriptions, etc. With tab-delimited you can rely upon split <input data row> at tab_character into f1....fn...it's so much simpler and cleaner to work with, IMHO.