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

DATA TRANSFER ?

Former Member
0 Likes
722

HOW CAN A TEXT FROM XL SHEET (FLAT FILE) BE TRANSFERRED INTO INTERNAL TABLE.

6 REPLIES 6
Read only

Former Member
0 Likes
674

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

Read only

Former Member
0 Likes
674

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

Read only

Former Member
0 Likes
674

hi

use FM GUI_UPLOAD or ALSM_EXCEL_TO_INTERNAL_TABLE.

HOPE THIS HELPS,

PRIYA

Read only

abdul_hakim
Active Contributor
0 Likes
674

Hi Gun.

Welcome to SDN.

use GUI_UPLOAD.

Cheers,

Abdul

Read only

Former Member
0 Likes
674

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.

Read only

Former Member
0 Likes
674

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.