cancel
Showing results for 
Search instead for 
Did you mean: 

uploading excel data into internal table using web dynpro abap

Former Member
0 Kudos

Hi,

I have been trying to upload excel sheet data into an internal table and then view it using web dynpro. I used ole2_objects to create a method which reads excel sheets.

The code is working fine when the method is being called from a report program but it is not working when i am calling the same method from a web dynpro application.

Could someone please help me with this?

or is there any other way to go about it?

I am posting the method code also along with this.

Thanks in advance,

Neelima V.

Edited by: neelima v on Jan 14, 2008 4:05 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

this is a trial method and right now i am trying to read only the first cell of the excel sheet and return that value and show it in the UI when the user presses the button but this code is not returning any value.

METHOD read_excel.

INCLUDE ole2incl.

DATA: filename(128) TYPE c,

excel TYPE ole2_object,

cell TYPE ole2_object,

workbook TYPE ole2_object,

pfile TYPE localfile VALUE

'C:\Documents and Settings\I047323\Desktop\new.xls',

name TYPE string.

CREATE OBJECT excel 'EXCEL.APPLICATION'.

SET PROPERTY OF excel 'VISIBLE' = 0.

CALL METHOD OF excel 'WORKBOOKS' = workbook.

CALL METHOD OF workbook 'OPEN'

EXPORTING #1 = pfile.

CALL METHOD OF excel 'CELLS' = cell

EXPORTING

#1 = 1

#2 = 1

GET PROPERTY OF cell 'VALUE' = value.

CALL METHOD OF workbook 'SAVE'.

CALL METHOD OF workbook 'CLOSE'.

CALL METHOD OF excel 'QUIT'.

FREE OBJECT excel.

ENDMETHOD.

Edited by: neelima v on Jan 14, 2008 4:06 PM