07-03-2009 7:39 AM
Hi frens
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'.
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".
07-03-2009 7:43 AM
Hi,
Check for the internal table type that is used in your program.
The table type should be of ALSMEX_TABLINE.
Regards,
Raju.
07-03-2009 8:10 AM
Hi Prerna,
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'
exporting
i_tab_raw_data = i_raw
i_filename = po_file
tables
i_tab_converted_data = i_upload
exceptions
conversion_failed = 1
others = 2.
Hope this helps.
07-03-2009 8:13 AM
07-03-2009 8:36 AM
Hi,
Make sure the internal table you have created, have fields with type character and length should be of same as defined in the std table where data need to be uploaded.
Pooja
07-03-2009 9:04 AM
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'
EXPORTING
filename = filename
i_begin_col = begcol
i_begin_row = begrow
i_end_col = endcol
i_end_row = endrow
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
hope it helps .
nishant
07-03-2009 9:09 AM
Hi Prerna,
Save your excel file as CSV file and use FM GUI_UPLOAD as we use it for normal text file uploading.
Hope this will solve your problem.
Regards,
Vijay
07-03-2009 9:19 AM
Don forget the comma as field separator
in teh FM gui_upload mentioned above