Submitted: 04 March 2008
Simple class to read a MS Excel file and import the data directly into an SAP table.
Be careful using this import functionality! There are no data checks (as yet) also the SAP table is not locked before the records
are created and/or changed.
This code snippet has 2 parts:
- Class ZCL_IMPORT_EXCEL - Does the actual import
- Program Z_IMPORT_XLS - Program used as an GUI to call class ZCL_IMPORT_EXCEL
Pre-requisites MS-Excel spreadsheet
- The data must be on the first worksheet
- Sequence of the columns in the MS-Excel spreadsheet must be equal to the field sequence in SAP Table definition. Hidden columns in MS-Excel are NOT ignored during import!
- Date fields must have the format "Text" or "General" with mask MM.DD.YYYY
Tips & Tricks
- Hidden columns in MS-Excel are NOT ignored during import! You can however put additional columns at the end.