‎2008 Aug 12 7:51 AM
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
‎2008 Aug 12 7:54 AM
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.
‎2008 Aug 12 7:54 AM
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.
‎2008 Aug 12 7:56 AM
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.
‎2008 Aug 12 7:57 AM
Pass 'X' to the has_fiedl_separator when you are calling the gui_upload function
has_field_separator = 'X'
‎2008 Aug 12 7:57 AM
‎2008 Aug 12 7:58 AM
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
‎2008 Aug 12 7:59 AM
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
‎2008 Aug 12 8:00 AM
Hi Pavan,
Give the following in your GUI_UPLOAD.
filetype = 'ASC'
has_field_separator = 'X'
Regards,
Chandra Sekhar