‎2006 Apr 17 11:35 AM
HOW CAN A TEXT FROM XL SHEET (FLAT FILE) BE TRANSFERRED INTO INTERNAL TABLE.
‎2006 Apr 17 11:36 AM
use the fm GUI_UPLOAD.
or ALSM_EXCEL_TO_INTERNAL_TABLE
Sample code:
http://www.sap-img.com/abap/upload-direct-excel.htm
REgards,
Ravi
‎2006 Apr 17 11:38 AM
Hi,
use GUI_UPLOAD FM and transafer the flat file to Internal table.
decalre your internal table in such a way that it can hold your text from the flat file
Regards
vijay
‎2006 Apr 17 11:40 AM
hi
use FM GUI_UPLOAD or ALSM_EXCEL_TO_INTERNAL_TABLE.
HOPE THIS HELPS,
PRIYA
‎2006 Apr 17 11:46 AM
‎2006 Apr 17 11:50 AM
Hi Shree,
You can download data stored in an excel sheet to internal table using GUI_UPLOAD Function Module
You can save the file as "Tab delimited Text file". Then use the FM GUI_UPLOAD .
See this example.
data: itab like table of zshail_tab1 with header line.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\Documents and Settings\sylendr\Desktop\shailu.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = itab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
After this step , you can access ITAB to get the respective values.
Hope your query is solved.
Regards,
SP.
‎2006 Apr 17 12:56 PM
Hi Shree,
If you are concerned only with the data in the flat file.
You can use FM GUI_UPLOAD.
Else If you need the data based on row and column in the excel sheet.
You can use FM KCD_EXCEL_OLE_TO_INT_CONVERT.
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_loc
i_begin_col = lc_start_col
i_begin_row = lc_start_row
i_end_col = lc_end_col
i_end_row = lc_end_row
TABLES
intern = li_intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2.
IF NOT sy-subrc IS INITIAL.
MESSAGE e002(fb) WITH p_loc.
ENDIF. " IF NOT SY-SUBRC IS INITIAL
http://www.sap-img.com/abap/excel_upload_alternative-kcd-excel-ole-to-int-convert.htm
Hope you found the solution of your query,If yes please reward point and close the thread.If you still have doubt please post it in the group.
Thanks & Regards,
Mayank.