2011 Sep 02 2:14 PM
Hi,
I am trying to upload an excel sheet using SAP standard function module ALSM_EXCEL_TO_INTERNAL_TABLE through an custom program. I am getting a strange error: "I must close the excel sheet" even though I my excel sheet is not open.
Below is my source code.
data: I_INTERN LIKE ALSMEX_TABLINE occurs 0.
FILENAME LIKE RLGRAP-FILENAME,
I_BEGIN_COL TYPE I DEFAULT 1,
I_BEGIN_ROW TYPE I DEFAULT 1
I_END_COL TYPE I DEFAULT 256
I_END_ROW TYPE I DEFAULT 65536
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
FILENAME = FILENAME
I_BEGIN_COL = I_BEGIN_COL
I_BEGIN_ROW = I_BEGIN_ROW
I_END_COL = I_END_COL
I_END_ROW = I_END_ROW
tables
INTERN = I_INTERN
exceptions
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
others = 3.
if SY-SUBRC <> 0.
case SY-SUBRC.
when 1.
raise INCONSISTENT_PARAMETERS.
when 2.
raise UPLOAD_OLE.
when 3.
raise OTHERS.
endcase.
endif.Please advice me some solution.
Thanks,
Chinmay
Hi,
I am trying to upload an excel sheet using SAP standard function module ALSM_EXCEL_TO_INTERNAL_TABLE through an custom program. I am getting a strange error: "I must close the excel sheet" even though I my excel sheet is not open.
Below is my source code.
data: I_INTERN LIKE ALSMEX_TABLINE occurs 0.
FILENAME LIKE RLGRAP-FILENAME,
I_BEGIN_COL TYPE I DEFAULT 1,
I_BEGIN_ROW TYPE I DEFAULT 1
I_END_COL TYPE I DEFAULT 256
I_END_ROW TYPE I DEFAULT 65536
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
FILENAME = FILENAME
I_BEGIN_COL = I_BEGIN_COL
I_BEGIN_ROW = I_BEGIN_ROW
I_END_COL = I_END_COL
I_END_ROW = I_END_ROW
tables
INTERN = I_INTERN
exceptions
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
others = 3.
if SY-SUBRC <> 0.
case SY-SUBRC.
when 1.
raise INCONSISTENT_PARAMETERS.
when 2.
raise UPLOAD_OLE.
when 3.
raise OTHERS.
endcase.
endif.Please advice me some solution.
Thanks,
Chinmay
2011 Sep 02 2:31 PM
This FM use OLE to Copy/Paste data from Excel to clipboard and then to Abap. This problem can be related to the many threads on [OLE close excel process|http://www.sdn.sap.com/irj/scn/advancedsearch?query=olecloseexcel+process] take a look. (*)
Regards,
Raymond
(*) Especially if you have done a lot of tests without logging off your Windows. Look via Windows task manager ([ctrlaltdel|http://en.wikipedia.org/wiki/Control-Alt-Delete])