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: 

upload excel file into internal table

Former Member
0 Kudos

Hi , Can anyone quide how to upload an excel file into an internal table,

thanks

7 REPLIES 7

pavel_parshenkov2
Participant
0 Kudos

hi, look at FM

ALSM_EXCEL_TO_INTERNAL_TABLE

Former Member
0 Kudos

use TEXT_CONVERT_XLS_TO_SAP

Former Member
0 Kudos

Hi

Check this <a href="http://www.sapdevelopment.co.uk/file/file_updown.htm">link</a>

Message was edited by:

Perez C

Former Member
0 Kudos

hi kumaran,

use ALSM_EXCEL_TO_INTERNAL_TABLE

function module and specify your excel file location and internal table's name.

The data will be uploaded successfully.

reward points if useful..

Former Member
0 Kudos

Here is sample program.

REPORT ZDBLV_UPLOAD_EXCEL_TEST.

data: begin of itab occurs 0,

name(20) type c,

addre(20) type c,

end of itab.

dATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.

DATA : B1 TYPE I VALUE 1,

C1 TYPE I VALUE 1,

B2 TYPE I VALUE 100,

C2 TYPE I VALUE 9999.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME = 'C:\test.xls'

I_BEGIN_COL = B1

I_BEGIN_ROW = C1

I_END_COL = B2

I_END_ROW = C2

TABLES

INTERN = itab1

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.

loop at itab1.

write:/ itab1.

Endloop.

Former Member
0 Kudos

Hi

U can use GUI_UPLOAD or 'ALSM_EXCEL_TO_INTERNAL_TABLE'

Thanks

Vasudha

Former Member
0 Kudos

You can use FM ALSM_EXCEL_TO_INTERNAL_TABLE and check this link for sample code.

http://www.sapdevelopment.co.uk/file/file_upexcel2.htm