2008 Jan 10 8:59 PM
Hi Experts,
Am uploading (some piece of) VBAK data into a Z_vbak_table by using FM,
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
+ HEADER_LENGTH = 0+*
+ READ_BY_LINE = 'X'+*
+ DAT_MODE = ' '+*
+ CODEPAGE = ' '+*
+ IGNORE_CERR = ABAP_TRUE+*
+ REPLACEMENT = '#'+*
+ CHECK_BOM = ' '+*
+ IMPORTING+*
+ FILELENGTH =+*
+ HEADER =+*
TABLES
data_tab = itab
EXCEPTIONS
So, issue is that, When am seeing in Debug mode, am getting the values like, ( I mean, problem is with VBELN & AUART fields with junk values???)
MANDT/ BUKRS/ SPBUP / VBELN / POSNR/AUART
100 |3000 |200801|ÐÏ#ࡱ#á##|000000|###
So, pls. let me know that, How to fix this issue i.e. problem is with VBELN & AUART fields with junk values???
Am guessing this is bcoz of Unicode, bcoz, I did not CHECKED the UNICODE CHECKS ACTIVE check box in GOTO-->ATTRIBUTES!!
thanq
2008 Jan 10 9:28 PM
What encoding are you using for your ASCII file? If you are using Windows XP, in notepad you can pick what type of encoding to save your ASCII file as (ANSI, Unicode, Unicode big endian, UTF-8).
2008 Jan 10 9:28 PM
What encoding are you using for your ASCII file? If you are using Windows XP, in notepad you can pick what type of encoding to save your ASCII file as (ANSI, Unicode, Unicode big endian, UTF-8).
2008 Jan 10 9:35 PM
i dont understand ur question, anyways, am using spread sheet/excel in windown xp home.
thanq
2008 Jan 10 10:48 PM
Text files themselves can be unicode or non-unicode. Use Notepad, "save as" and check the options. You are using MS Excel to save as *.xls or *.txt format. Can you open your data file in notepad? What does it look like?
2008 Jan 11 3:15 AM
thanq,
yes, when i am using MS office note pad for uploading, its working fine.
but, am looking for Excel/spreas heet.
any idea?
thanq
2008 Jan 11 4:35 AM
Hi,
Use CSV format instead of excel, you can upload properly.
2008 Jan 11 4:36 AM
Hi
Please use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE" to upload excel file to internal table. As GUI_UPLOAD cannot the excel file format.
~ Ranganath
2008 Jan 11 5:15 AM
thanq,
how to get it the CSV? bcoz, when use SAVE AS my excel file, I did not find any CSV format, and i used right click too! but NO use? so, how to find CSV ?
thanq
2008 Jan 11 5:23 AM
Hi,
Open excel file and select SAVE AS button. you will get save dialog box. You can find two text box.
1.File name
2. Save as type
In 'Save as type' dropdown list, you will find CSV (comma delimited) option. Select it and save it.
2008 Jan 10 10:20 PM
Hello Srinivas,
correct me if I am wrong.
The 'unicode check' attribute checks the syntax of your abap code.
The problem you mentioned has nothing to do with unicode.
Either your z_table and VBAk fields are not compatible or the data in your local file is not compatible with your z_table.
You might want to check them.
~goldie.
2008 Jan 11 4:53 AM
Hi
Use DAT instead of ASC in
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0*
READ_BY_LINE = 'X'*
DAT_MODE = ' '*
CODEPAGE = ' '*
IGNORE_CERR = ABAP_TRUE*
REPLACEMENT = '#'*
CHECK_BOM = ' '*
IMPORTING*
FILELENGTH =*
HEADER =*
TABLES
data_tab = itab
EXCEPTIONS
2008 Jan 11 4:54 AM
Hi
Use DAT instead of ASC in 5th line of the following
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'DAT'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0*
READ_BY_LINE = 'X'*
DAT_MODE = ' '*
CODEPAGE = ' '*
IGNORE_CERR = ABAP_TRUE*
REPLACEMENT = '#'*
CHECK_BOM = ' '*
IMPORTING*
FILELENGTH =*
HEADER =*
TABLES
data_tab = itab
EXCEPTIONS