Application Development and Automation 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: 
Read only

upload excel file into internal table

Former Member
0 Likes
3,951

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

thanks

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

thanks

7 REPLIES 7
Read only

pavel_parshenkov2
Participant
0 Likes
1,017

hi, look at FM

ALSM_EXCEL_TO_INTERNAL_TABLE

Read only

Former Member
0 Likes
1,017

use TEXT_CONVERT_XLS_TO_SAP

Read only

Former Member
0 Likes
1,017

Hi

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

Message was edited by:

Perez C

Read only

Former Member
0 Likes
1,017

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..

Read only

Former Member
0 Likes
1,017

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.

Read only

Former Member
0 Likes
1,017

Hi

U can use GUI_UPLOAD or 'ALSM_EXCEL_TO_INTERNAL_TABLE'

Thanks

Vasudha

Read only

Former Member
0 Likes
1,017

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