Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

uploading an excel file in an internal table.

Former Member
0 Kudos

hi experts,

I m trying to upload a excel file comprising of 16,000 records using the function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' as follws

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_input

i_begin_col = 1

i_begin_row = 1

i_end_col = 30

i_end_row = 65000

TABLES

intern = g_t_excel

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.

My problem is I am unable to upload record number 10001 else all the records are uploaded successfully

can anyone help me in solving this problem

8 REPLIES 8

Former Member
0 Kudos

hi i have a simpelst solution for u...

just copy all the records of EXCEL file into text file...

then use GUI_UPLOAD and GUI_DOWNLOAD function modules for uploading and downloading the data.

it works perfactly...

points please...

Former Member
0 Kudos

Hi,

Try using Gui_upload.

Regards,

Bohra.

Former Member
0 Kudos

FORM upload_itab .

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

  • CODEPAGE = ' '

FILENAME = p_file

FILETYPE = 'ASC'

  • HEADLEN = ' '

  • LINE_EXIT = ' '

  • TRUNCLEN = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • DAT_D_FORMAT = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = itab

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • FILE_OPEN_ERROR = 2

  • FILE_READ_ERROR = 3

  • INVALID_TYPE = 4

  • NO_BATCH = 5

  • UNKNOWN_ERROR = 6

  • INVALID_TABLE_WIDTH = 7

  • GUI_REFUSE_FILETRANSFER = 8

  • CUSTOMER_ERROR = 9

  • NO_AUTHORITY = 10

  • OTHERS = 11

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

gopi_narendra
Active Contributor
0 Kudos

Hi Rashmi,

Chances could be that there is a space in that particular cell of the excel sheet.

Check the excel and see if there are any spaces for this record.

Hope this helps you.

Regards

Gopi

Former Member
0 Kudos

Hi

Check the record 10001 and it may have some corrupted data and remove it

Regards

Shiva

Former Member
0 Kudos

hello rashmi,

Use the function module KCD_EXCEL_OLE_TO_INT_CONVERT

to upload data from excel file to an internalt able.

check the below code.

call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'

exporting

filename = g_p_f1

i_begin_col = 22

i_begin_row = 1

i_end_col = 22

i_end_row = 65536

tables

intern = g_t_intern

exceptions

inconsistent_parameters = 1

upload_ole = 2

others = 3.

reward if useful.

Regards,

Phani.

Former Member
0 Kudos

Hi,

Save the file as .txt tab delimited file. & use Gui_upload.

by Gui_upload upto 64000 records can be read from the flat file.

Rewards points if helpful.

Ashvender.

Former Member
0 Kudos

Hi Rashmi,

i have tested and i am getting all the records.

But the problem may be with the row number. after <b>row number</b> 9999,

it'll restart as 0000,0001,0002....so on.