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

ParameterTypeDescriptionRequired
FILENAMERLGRAP-FILENAMEFile nameYes
I_BEGIN_COLIStart columnYes
I_BEGIN_ROWIStart rowYes
I_END_COLIEnd columnYes
I_END_ROWIEnd rowYes

Tables parameters

ParameterTypeDescriptionRequired
INTERNALSMEX_TABLINECell 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.

Request a custom report