Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

uploading an excel file

dump errot in uploadin gexcel file

fun module used alsm_excel_inter_table

An exception occurred. This exception will be dealt with in more detail

below. The exception, assigned to the class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught, which

led to a runtime error. The reason for this exception is:

The call to the function module "ALSM_EXCEL_TO_INTERNAL_TABLE" is incorrect:

In the function module interface, you can specify only

fields of a specific type and length under "INTERN".

Although the currently specified field

"ITAB01" is the correct type, its length is incorrect.


Should you have declared anything wrong.

Check this sample code

types : begin of ty_tab,
          kunnr type bsid-kunnr, 
          zuonr type bsid-zuonr,
        end of ty_tab.

data : it_tab type table of ty_tab initial size 0,
       is_tab type ty_tab.
* Data Declarations for uploading excel file into internal table
data : it_data type table of alsmex_tabline initial size 0,
       is_data type alsmex_tabline.
parameters       : p_ifname type rlgrap-filename.
* If Input file name is not initial.
  if not p_ifname is initial.
* Upload EXCEL data into internal table
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
              filename                = p_ifname
              i_begin_col             = 1
              i_begin_row             = 1
              i_end_col               = 256
              i_end_row               = 65356
              intern                  = it_data
              inconsistent_parameters = 1
              upload_ole              = 2
              others                  = 3.
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

* Append EXCEL Data into a internal table
  loop at it_data into is_data.
    at new row.
      clear is_tab.
    if is_data-col = '001'.
      move is_data-value to is_tab-kunnr.
    if is_data-col = '002'.
      move is_data-value to is_tab-zuonr.
    at end of row.
      append is_tab to it_tab.
    clear : is_data.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question