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

Former Member
0 Kudos

Hi FOlks

I have an excel file on my c: drive and it has some hidden fields . alsm_excel_to_internal_table is not able to pick the hidden fields. I would like to try it with gui_upload. What is the procedure to pass an excel fiel to gui_upload and what should be the format of the output internal table.

THanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I guess if you use GUI_UPLOAD FM to upload excel file data ,then you may get junk data into Internal table.

Please convert into normal .txt file and upload it .

Thanks

Seshu

3 REPLIES 3

Former Member
0 Kudos

Hi

Declare the internal table all fields like CHAR fields of respective length in the excel file.

then pass that internal table to the gui_upload.

see the sample code

*--Internal Table for Data Uploading.

DATA : BEGIN OF IT_FFCUST OCCURS 0,

KUNNR(10),

BUKRS(4),

KTOKD(4),

ANRED(15),

NAME1(35),

SORTL(10),

STRAS(35),

ORT01(35),

PSTLZ(10),

LAND1(3),

SPRAS(2),

AKONT(10),

END OF IT_FFCUST.

*--Variable to change the type of the parameter file name.

DATA : LV_FILE TYPE STRING.

LV_FILE = V_FNAME.

*--Function to upload the flat file to the internal table.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = LV_FILE

  • FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

  • HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • IMPORTING

  • FILELENGTH =

  • HEADER =

TABLES

DATA_TAB = IT_FFCUST

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

Regards

Anji

Former Member
0 Kudos

Hi Krish,

Pass the complete file name with path to the Function module..

take the file type as DAT.

The structure of the internal table should have the exact numbet of fields in the file, and the data types of the fields should match the corresponidng columns in the file.

Thanks and Best Regards,

Vikas Bittera.

**Points for useful answers**

Former Member
0 Kudos

I guess if you use GUI_UPLOAD FM to upload excel file data ,then you may get junk data into Internal table.

Please convert into normal .txt file and upload it .

Thanks

Seshu