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

Regarding gui_upload

Former Member
0 Likes
506

Hi all,

I have a flat file in text format with records separated by comma. How can i move to internal table?

Given has field separator as 'X' but still record not moved.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
481

see below thread

4 REPLIES 4
Read only

rainer_hbenthal
Active Contributor
0 Likes
481

This is really solved in this forum over and over and over again. Isnt it possible to search first before asking?

Read only

Former Member
0 Likes
482

see below thread

Read only

Former Member
0 Likes
481

the first step is to find the path of the file using the FM 'F4_FILENAME'

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = 'F_PATH'

IMPORTING

file_name = f_path.

the P_PATH should be declare as f_path TYPE rlgrap-filename .

and assign the path to a variable type STRING (text file TYPE STRING).

before that declare a internal table in the structure of the notepad

Then for uploading the file name use FM - GUI_UPLOAD

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = textfile

filetype = 'ASC'

has_field_separator = '#'

TABLES

data_tab = int_dats[]. " value returned in the internal table

regards

chinnaiya

Read only

arjun_subhash
Active Participant
0 Likes
481

hi,

try using this function module with fname = name of flat file

DATA FNAME TYPE RLGRAP-FILENAME.

DATA PNAME TYPE STRING

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

PROGRAM_NAME = SYST-REPID

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = ' '

STATIC = ' '

MASK = ' '

CHANGING

FILE_NAME = fname

EXCEPTIONS

MASK_TOO_LONG = 1

OTHERS = 2

PNAME = FNAME.

and gui_upload:

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = PNAME

FILETYPE = 'ASC'

thanks

Arjun