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

flat file(Binary file) upload using GUI_UPLOAD

Former Member
0 Likes
2,662

I had uploaded a Binary file Using GUI_UPLOAD , File type was 'BIN'.

but the data i got in Internal Table was in 0's and 1's.

whereas i tried the same thing on a different server but the same Version it gave me the data as text in Internal Table.

what could be reason..or wat could be done to resolve this.

6 REPLIES 6
Read only

Former Member
0 Likes
1,338

Hi,

May be there is something like File Converter (BIN to TXT) on that server where you got Texts uploaded.

Regards,

Anji

Read only

Former Member
0 Likes
1,338

Did you declare the internal table used to upload the binary file as TYPE X ?

begin of itab, 
  raw(255) type x, 
end of itab occurs 0. 
CALL FUNCTION 'GUI_UPLOAD' 
   exporting 
      filetype =  'BIN' 
      filename = 'C:DOWNLOAD.BIN' 
   tables 
      data_tab = itab.

Always remember to reward snippets you find useful!

Read only

0 Likes
1,338

Internal table type was type 'Table'

Read only

0 Likes
1,338

file type as 'BIN'

A binary representation of the internal table is read from the file.

No conversion or interpretation is carried out. Usually, this produces

meaningful results only if the internal table consists of a<b> single

column of type 'X'.</b>

Read only

0 Likes
1,338
try this

DATA:it_upload        TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE.

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename      = temp1
        filetype      = 'BIN'
        header_length = 0
        read_by_line  = 'X'
        replacement   = '#'
      TABLES
        data_tab      = it_upload.
Read only

Former Member
0 Likes
1,338

hi,

Convert Data type to '<b>DAT</b>'.

Reward helpful answers,

Regards,

Tejas