Application Development 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: 

GUI_Upload & GUI_Download for excel files

Former Member
0 Kudos

Hi experts,

I want to upload excel file into sap. i am trying with GUI_Upload function module. when i see the data it is filled with # and other special char. When i save the excel file as .txt file and then read the txt file. Now i am getting correct data. Is it possible to read Excel data using GUI_UPLOAD directly without changing .xls to .txt.

Also, how to change data in second or third tab of excel file using GUI_Download.

-RK

2 REPLIES 2

Former Member
0 Kudos

Hi

Actually ur file selection s wrong.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

EXPORTING

PROGRAM_NAME = SYST-REPID

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'P_FNAME'

STATIC = 'X'

  • MASK = '*.txt'

CHANGING

FILE_NAME = P_FNAME

EXCEPTIONS

MASK_TOO_LONG = 1

OTHERS = 2.

Upload:

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = LV_FNAME

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = IT_UEXBANK01

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.

0 Kudos

Hi

U r not directely send xls to txt...U have to excel conversion rule and they u have upload.

regards:

Prabu