BASIS
Function module
Used the same way in S/4HANA
ALSM_EXCEL_TO_INTERNAL_TABLE Read Excel File into Internal Table by Cell
Opens an Excel file on the user's PC through OLE and reads the cells in the given row/column range into an internal table as row, column and value. Upload programs commonly use it to read Excel templates directly. Excel must be installed on the PC and an SAP GUI connection is required; each cell value is limited to 50 characters, so move the result into your own structure by row and column number.
- Function group
- ALSMEX
- Remote-enabled (RFC)
- No
- Type
- Function module
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| FILENAME | RLGRAP-FILENAME | File name | Yes |
| I_BEGIN_COL | I | Start column | Yes |
| I_BEGIN_ROW | I | Start row | Yes |
| I_END_COL | I | End column | Yes |
| I_END_ROW | I | End row | Yes |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| INTERN | ALSMEX_TABLINE | Cell values (row, column, value) | Yes |
Exceptions
- INCONSISTENT_PARAMETERS — Inconsistent parameters
- UPLOAD_OLE — OLE upload error
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = lv_filename
i_begin_col = lv_i_begin_col
i_begin_row = lv_i_begin_row
i_end_col = lv_i_end_col
i_end_row = lv_i_end_row
TABLES
intern = lt_intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.