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 data into internal table

Former Member
0 Likes
727

Hi All,

could you help me on this plaese,

i want to convert the text data into the internal table.

problem is in my notepad i having the field names and values

i want to upload that total data into my internal table.

i.e in notepad having like this

NAME NUMBER }------ field names

NARESH 222 }------ values

KUMAR 333

REDDY 444

this is tha data, now i want to upload field name s as well as values.

thanks,

naresh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
658

Use Function Module GUI_UPLOAD to upload the file to an internal table.

Your field names will be there as the first record in the internal table.

regards,

Jinson

4 REPLIES 4
Read only

Former Member
0 Likes
659

Use Function Module GUI_UPLOAD to upload the file to an internal table.

Your field names will be there as the first record in the internal table.

regards,

Jinson

Read only

0 Likes
658

Hi

thanks for reply,

you said is correct but if i taken field names as string,and values taken as string & int.

then hoiw is it possible .

Read only

0 Likes
658

>

> Hi

> thanks for reply,

> you said is correct but if i taken field names as string,and values taken as string & int.

> then hoiw is it possible .

Upload to internal table where the fields are of char type.

Delete the first record.

Then move the data to a new internal table with filed type as char and int respectively.

regards,

Jinson

Read only

Former Member
0 Likes
658

Hi ,

call following function module

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'PC_FILE' <----


File name

FILETYPE = u2018ASCu2019

HAS_FIELD_SEPARATOR = 'X'

DAT_MODE = 'X'

TABLES

DATA_TAB = 'Your internal Table' <-------Internal table name

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

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.