I am trying to load data from excel sheet in SAP Table through BDC using the function module alsm_excel_to_internal_table..
But so far i am unable to perform the task successfully as the execution of the program gives me''PERFORM_CONFLICT_TAB_TYPE_ERROR'.
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "ALSM_EXCEL_TO_INTERNAL_TABLE" "(FUNCTION)", nor was it propagated by
a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The FORM "SEPARATED_TO_INTERN_CONVERT" was called incorrectly.
The call of the FORM is incorrect for parameter nr. 2:
The internal table that is transferred to the formal table parameter has
a type that is not compatible with the type of the formal parameter.
The FORM "SEPARATED_TO_INTERN_CONVERT" is defined in the program "SAPLALSMEX".
Check the excel sheet format that you are trying to upload. It must be of .xls type and not .xlsx
Alternatively you can make use of FM:
call function 'TEXT_CONVERT_XLS_TO_SAP'
i_tab_raw_data = i_raw
i_filename = po_file
i_tab_converted_data = i_upload
conversion_failed = 1
others = 2.
Hope this helps.
Check this example:
DATA: BEGIN OF intern OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern.
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
begcol TYPE i DEFAULT 1 NO-DISPLAY,
begrow TYPE i DEFAULT 1 NO-DISPLAY,
endcol TYPE i DEFAULT 100 NO-DISPLAY,
endrow TYPE i DEFAULT 32000 NO-DISPLAY.
You can declare above as Constants or variables also as per ur need :
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
filename = filename
i_begin_col = begcol
i_begin_row = begrow
i_end_col = endcol
i_end_row = endrow
intern = intern
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
hope it helps .