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

Getting #while using gui_upload

Former Member
0 Likes
2,191

im using gui_upload to upload data into internal table itab

this itab has field of type string

my input text file has values ++;100;0101+;

but when i m using gui_upload i m getting extra value # in my internal table.

plz tell me why this # value is coming Extra.

My internal table is of folllowing type

begin of itab occurs 0,

line type string,

end of itab.

regards

1 ACCEPTED SOLUTION
Read only

GauthamV
Active Contributor
0 Likes
1,556

hi,

use this code.

parameters: p_fname like rlgrap-filename.

*----


at selection-screen on value-request for p_fname.

*----


call function 'F4_FILENAME'

exporting

program_name = syst-cprog

dynpro_number = syst-dynnr

importing

file_name = p_fname.

start-of-selection.

data:v_fname type string.

move p_fname to v_fname.

*reading the input file

call function 'GUI_UPLOAD'

exporting

filename = v_fname

filetype = 'ASC'

has_field_separator = 'X'

tables

data_tab = itab.

7 REPLIES 7
Read only

GauthamV
Active Contributor
0 Likes
1,557

hi,

use this code.

parameters: p_fname like rlgrap-filename.

*----


at selection-screen on value-request for p_fname.

*----


call function 'F4_FILENAME'

exporting

program_name = syst-cprog

dynpro_number = syst-dynnr

importing

file_name = p_fname.

start-of-selection.

data:v_fname type string.

move p_fname to v_fname.

*reading the input file

call function 'GUI_UPLOAD'

exporting

filename = v_fname

filetype = 'ASC'

has_field_separator = 'X'

tables

data_tab = itab.

Read only

former_member217544
Active Contributor
0 Likes
1,556

Hi,

If there are any unrecognized characters in the file, SAP displays in the form of "#'. This # is different from normal "HASH" symbol.

Any new line or formfeed etc., are displayed in # form.

Hope this will help.

Regards,

Swarna Munukoti.

Read only

Former Member
0 Likes
1,556

Pass 'X' to the has_fiedl_separator when you are calling the gui_upload function

has_field_separator = 'X'

Read only

Former Member
0 Likes
1,556

Hi..

use filetype = 'ASC' as suggested above

regards

vivek

Read only

Former Member
0 Likes
1,556

hiii

i had same problem while uploading txt file...try changing value of has_field_separator = 'X' in GUI_UPLOAD FM..it will solve your problem.

regards

twinkal

Read only

Former Member
0 Likes
1,556

Hi,

This is because, any character which does not fall in default codepage (refer parameter CODEPAGE of GUI_UPLOAD) is automatically represented by parameter REPLACEMENT of FM GUI_UPLOAD.

By default it's value is '#'.

Tab, carraige return will be converted to # if you do not provide HAS_FIELD_SEPARATOR = 'X'.

Regards,

Mohaiyuddin

Edited by: Mohaiyuddin Soniwala on Aug 12, 2008 12:30 PM

Read only

Former Member
0 Likes
1,556

Hi Pavan,

Give the following in your GUI_UPLOAD.

filetype = 'ASC'

has_field_separator = 'X'

Regards,

Chandra Sekhar