styles definition ( styles.xml) which defines how the cells of worksheet will look like.shared strings file ( sharedStrings.xml), it contains a deduplicated array of values.sheet files ( sheet1.xml, sheet2.xml, … ), they contain markup for data placement on a sheet.The main decommissioning parts of XLSX file are.XLS which was a binary non-extractable container and from primitive SpreadsheetML which defines worksheet in a single XML. This is a fundamental difference from old. XLSX format in fact is not a single file, but a set of files which define how the Excel workbook will look like.XLSX parsing which one must know before starting the implementation: Let me briefly outline the nuts and bolts of. Anyway, it is an option but yeah, it requires 752 release and our system was still on 750 so I was out of the luck again :(( Integral parts of the parser I wasn’t aware of cl_ehfnd_xlsx class that was introduced with ABAP AS 752 and it is still very little info about it in the Web, so it seems more like internal S4HANA stuff not intended for customers. Modern problems require modern solutions, they say, hehe. What I found really interesting is an import/export solution by Trevor Zhang written in modern classes and a modern concise syntax. Unfortunately this approach is not very flexible and again it is just a Spreadsheet ML, not a full-blown XLSX spreadsheet, so his work is only a modern rethinking of Naimesh old converter. Unlike Madhu with her Simple Transformations he used direct construction of XML template through ABAP string templates. Also, iXML Library she used in her tool has some performance drawbacks and is not adapted for big data.Īnother good attempt to achieve the same result was done by Rajesh Rajgor. There is also a marvelous piece of work done by Madhu Omer, and honestly I was very impressed by the work done, but for my task it seemed over-complicated and touching only XLSX generation part and I urgently sought a way to parse. Spreadsheet ML despite the name is not a full-featured spreadsheet but just a subset of XML capable of representing tabular data with the numerous limitations. I reviewed even the ancient time pieces (2009 was lon before the COVID) and some of them were quite cool, like this one from the long respected ABAP warrior Naimesh Patel Yes, the XML generation offered by Naimesh worked fast and has simplicity but the format itself is inferior by design. When I was analyzing possible solutions to the problem I considered many candidates but there were the reasons why nothing fitted my needs. I invite you to treat it like a proof-of-concept rather than solution, however it is fully functional and can be adapted to your needs easily (or not so easily). Some customers dogmatically refuse to install custom packages to system, some are bothered about license issues and some guys are open to third-parties but approval of installing the third-party into the ABAP system will take months in the big multinational dinosaurs like the one I’m working now.Īnd when the Excel parsing is required utterly, just now, because all the deadlines are over and it was expected “yesterday”, in such crucial situations I propose to clients the solution I will describe here, it cannot be really called a solution because it has many flaws, but it can do the basic job and transform Excel file into internal table in ABAP. One would say: why the heck we need another tool if we already have ABAP2XLSX?ĪBAP2XLSX is certainly a great and powerful tool and I used it on my projects too but often there are difficulties with its installation. All the rest are third-party and highly specific like PI libraries.Almost all standard Excel reading tools are based on OLE and do not allow reading in batch or non-dialog mode.Why not to use them? There are couple of asterisks here: SAP provides many Excel-related programming tools, they are listed on this handy page: Very often everything you have is a XLSX file and/or an XSTRING data made from it, knowing nothing about the structure, and you need quickly parse the table contents for processing in your app. Problem definitionĪny of you I definitely faced such common task as Excel files processing, this task often is raised in different SAP environments like OData services, Webdynpro apps, FPM apps and so on. The described approach is not a comprehensive Excel parsing solution but rather a life ring when the customer urges for quick solution and the deadline passed “yesterday”. The method I want to describe in this blog is not new and is probably known to ABAP gurus, however many of the beginners often ask questions regarding this topic, hence this blog has appeared.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |