Skip to Content
0
Former Member
Dec 11, 2006 at 09:53 PM

Error when trying to upload excel data

868 Views

hi all,

i am getting the following error when trying to execute the following program to upload excel fileto internal table in BW. I know it is a simple one...i couldnt figure out myself...

Error message:

Program ZUPLOAD_EXCEL

<b>Field "ALSMEX_TABLINE" is unknown. It is neither in one of the

specified tables nor defined by a "DATA" statement.</b>

I got the program from the following post

I am using the program posted by shejal shetty

upload-excel-to-internal-table

i got the similar error when i tried to use another program also.

plz help me there..

the following is my code

&----


*& Report ZUPLOAD_EXCEL *

*& *

&----


*& *

*& *

&----


REPORT ZUPLOAD_EXCEL .

tables : zmat_match.

data : g_repid like sy-repid,

$v_start_col type i value '1',

$v_start_row type i value '1',

$v_end_col type i value '256',

$v_end_row type i value '65536',

gd_currentrow type i.

DATA : BEGIN OF it_table OCCURS 0,

MTART LIKE zmat_match-mtart,

mtpos LIKE zmat_match-mtpos,

disgr LIKE zmat_match-disgr,

mtvfp LIKE zmat_match-mtvfp,

dismm LIKE zmat_match-dismm,

beskz LIKE zmat_match-beskz,

sbdkz LIKE zmat_match-sbdkz,

sfcpf LIKE zmat_match-sfcpf,

disls LIKE zmat_match-disls,

match_code LIKE zmat_match-match_code,

END OF it_table.

data: itab like alsmex_tabline occurs 0 with header line.

selection-screen : begin of block blk with frame title text.

parameters : p_file like rlgrap-filename obligatory.

selection-screen : end of block blk.

initialization.

g_repid = sy-repid.

at selection-screen on value-request for p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = g_repid

IMPORTING

FILE_NAME = p_file.

start-of-selection.

  • Get the data from XLS to Internal Table

perform upload_data.

&----


*& Form upload_data

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM upload_data.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = p_file

I_BEGIN_COL = $v_start_col

I_BEGIN_ROW = $v_start_row

I_END_COL = $v_end_col

I_END_ROW = $v_end_row

TABLES

INTERN = itab

EXCEPTIONS

INCONSISTENT_PARAMETERS = 1

UPLOAD_OLE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

write:/10 'File '.

ENDIF.

if sy-subrc eq 0.

read table itab index 1.

gd_currentrow = itab-row.

loop at itab.

if itab-row ne gd_currentrow.

append it_table.

clear it_table.

gd_currentrow = itab-row.

endif.

case itab-col.

when '0001'.

it_table-mtart = itab-value.

when '0002'.

it_table-mtpos = itab-value.

when '0003'.

it_table-disgr = itab-value.

when '0004'.

it_table-mtvfp = itab-value.

when '0005'.

it_table-dismm = itab-value.

when '0006'

it_table-beskz = itab-value.

when '0007'

it_table-sbdkz = itab-value.

when '0008'

it_table-sfcpf = itab-value.

when '0009'

it_table-disls = itab-value.

when '0010'

it_table-match_code = itab-value.

endcase.

endloop.

endif.

append it_table.

ENDFORM. " upload_data

thanks in advance

ravi

points will be assigned for inputs...