Skip to Content
0
Former Member
Aug 01, 2007 at 12:54 PM

read lines from second sheet from an excel

21 Views

i have an excel file with two tab sheets.

i use this code but it doesnt work correctly. actually it works but for the first tabsheet.

i want it for the second one only. please help. i wiil reward with points in helpfull answers.

call method of application 'Worksheets' = sheet

exporting

#1 = 2.

set property of sheet 'Name' = 'Timesheets'.

call method of sheet 'Activate'.

  • CALL METHOD OF gs_chart 'Location'

  • EXPORTING

  • #1 = 2

  • #2 = 'Timesheets'.

call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'

exporting

filename = p_file

i_begin_col = 1

i_begin_row = 7

i_end_col = 1

i_end_row = 60000

tables

intern = itemp

exceptions

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.

endif.

clear w_itemp.

loop at itemp.

w_itemp = itemp.

at last.

w_lin = w_itemp-row.

endat.

endloop.