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

Former Member
0 Likes
811

Hi Freinds

I am getting incomplete data in my internal. I not getting where the error is.

Please anybody help me.

below is code which i have writen.

v_file type string.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = v_file

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 = lt_uplpri

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.

10 REPLIES 10
Read only

former_member125931
Active Participant
0 Likes
771

FILENAME = v_file

In filename u need to specify ur file path.

Read only

Former Member
0 Likes
771

Hi,

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = v_file (Here Specify the pathr of the file you want to upload)

Regards,

Sujit

Read only

Former Member
0 Likes
771

after ur

v_file type string.

v_file = 'c:\temp\name'.

and continue ur code it will work.

Read only

Former Member
0 Likes
771

HI,

What type of file are you using to upload?

Excel or text?

Regards,

Ravi

Read only

Former Member
0 Likes
771

Hi,

Check below example,

because in GUI_UPLOAD fime name dat atype is String.

so you try in this way.

parameter: P_PFP type rlgrap-filename.

data : filename type string.

filename = P_PFP.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = filename

FILETYPE = 'ASC'

TABLES

DATA_TAB = I_TRANSFER

Thanks & Regards,

Shalini

Read only

Former Member
0 Likes
771

Hi,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR file1.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = file1.

***********************************************************************

*START-OF-SELECTION EVENT

***********************************************************************

START-OF-SELECTION.

MOVE file1 TO file.

*File transfer from a file on the presentation server to an internal table itab.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = file

filetype = 'ASC'

has_field_separator = 'X'

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.

Check if u have given full path in v_file .

hope this helps you.

plz reward if useful.

thanks,

dhanashri

Read only

Former Member
0 Likes
771

Hi Manisha,

you are getting data in your internal table but not complete right that means there in no problem in the FM parameters, check ur file and internal table.

With luck,

Pritam.

Read only

Former Member
0 Likes
771

Manisha,

Check whether the no of fields in ur flat file is the same as no of fields created for the internal table " lt_uplpri " used in the program.

If atleast one is mismatching the func mod will throw an error.

Neeraj

Read only

Former Member
0 Likes
771

Hi Friends

M using text file to upload the data.

I have given F4 functionality. so the user will choose the path.

I cannot give the path over there as hardcode.

Please help.

Read only

Former Member
0 Likes
771

Hi friends

Fields are compatible with the flat file. This is tab dilimited file.

only one record is coming in the internal table. I cannot get the all the records.

Please give me soultion.

Regards

Manisha.