11-28-2007 9:36 AM
Hi , Can anyone quide how to upload an excel file into an internal table,
thanks
11-28-2007 9:37 AM
11-28-2007 9:38 AM
11-28-2007 9:38 AM
Hi
Check this <a href="http://www.sapdevelopment.co.uk/file/file_updown.htm">link</a>
Message was edited by:
Perez C
11-28-2007 9:39 AM
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..
11-28-2007 9:40 AM
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.
11-28-2007 9:40 AM
Hi
U can use GUI_UPLOAD or 'ALSM_EXCEL_TO_INTERNAL_TABLE'
Thanks
Vasudha
11-28-2007 9:41 AM
You can use FM ALSM_EXCEL_TO_INTERNAL_TABLE and check this link for sample code.