Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Upload file from excel sheet

Hi...

data: begin of itab occurs 0,
      f1, f2, f3, f4, f5,
      end of itab.

call function 'GUI_UPLOAD'
  exporting
    filename                      = 'File Path'
   FILETYPE                      = 'ASC'
   HAS_FIELD_SEPARATOR           = 'X'
*   HEADER_LENGTH                 = 0
*   READ_BY_LINE                  = 'X'
*   DAT_MODE                      = ' '
*   CODEPAGE                      = ' '
*   IGNORE_CERR                   = ABAP_TRUE
*   REPLACEMENT                   = '#'
*   CHECK_BOM                     = ' '
*   VIRUS_SCAN_PROFILE            =
*   NO_AUTH_CHECK                 = ' '
* IMPORTING
*   FILELENGTH                    =
*   HEADER                        =
  tables
    data_tab                      = itab
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

loop at itab.
  write:/ itab-f1,
          itab-f2,
          itab-f3,
          itab-f4,
          itab-f5.
endloop.

My problem is..,

My excel sheet is having following entries..,

t w w g g

r e d h b

e w f b d

But my program giving output as..,

P

P ï ý

0.1. / #*

î

Ç t

&

Þ # é

0.1. ç í ® Ì*

Ø

â

û

0.1. u2122 # u0161*

Y Ô # #

V

= #

[

u2020 # Í

. $ u2014 § ý

#

#

What is the problem.?

Thanks,

Naveen.I

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question