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

'GUI_UPLOAD' - Junk values - Issue

Former Member
0 Likes
3,999

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,305

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).

11 REPLIES 11
Read only

Former Member
0 Likes
2,306

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).

Read only

0 Likes
2,305

i dont understand ur question, anyways, am using spread sheet/excel in windown xp home.

thanq

Read only

0 Likes
2,305

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?

Read only

0 Likes
2,305

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

Read only

0 Likes
2,305

Hi,

Use CSV format instead of excel, you can upload properly.

Read only

0 Likes
2,305

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

Read only

0 Likes
2,305

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

Read only

0 Likes
2,305

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.

Read only

Former Member
0 Likes
2,305

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.

Read only

Former Member
0 Likes
2,305

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

Read only

Former Member
0 Likes
2,305

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