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 probs

Former Member
0 Likes
1,018

while am executing this program it display the error as the interpret cannot data in file . my flat file is md1.txt saved in d drive.

REPORT YSUSBDC6.

TABLES: YSUSTAB1, BDCDATA.

DATA: BEGIN OF ITAB OCCURS 10 ,

NAME like ysustab1-name,

ROLLNO like ysustab1-rollno,

  • SEX like ysustab1,

  • MARK1 like ysustab1,

  • MARK2 like ysustab1,

  • MARK3 like ysustab1,

  • PHONENO like ysustab1,

END OF ITAB.

DATA: BDC_TAB type BDCDATA OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'd:\md2.txt'

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 INTO ITAB .

write: / itab-name ,itab-rollno.

  • WRITE: ITAB-NAME, ITAB-ROLLNO,ITAB-PHONENO, ITAB-SEX,ITAB-MARK1,

*ITAB-MARK2,ITAB-MARK3.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,001

give tab between the data notepad

like

field1 field2 field3.

regards,

venkat.

10 REPLIES 10
Read only

Former Member
0 Likes
1,001

plz resolve this problem .

regards

surender

Read only

Former Member
0 Likes
1,001

hi

declare

data:file type string.

file = 'd:\md2.txt'

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = file

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = ' X'

TABLES

DATA_TAB = ITAB.

loop at itab.

write: / itab-name ,itab-rollno.

endloop.

ckeck this and let me know .

reward points if useful,

venkat.

Read only

0 Likes
1,001

the same error should be displayed.

here its my flat file name md2.txt

131 POONKODI FEMALE 255921 80 90 70 A

132 VIGNESH MALE 255922 89 87 56 A

133 SURENDER MALE 252799 89 87 54 B

Read only

Former Member
0 Likes
1,002

give tab between the data notepad

like

field1 field2 field3.

regards,

venkat.

Read only

0 Likes
1,001

131 POONKODI FEMALE 255921 80 90 70 A

132 VIGNESH MALE 255922 89 87 56 A

133 SURENDER MALE 252799 89 87 54 B

while am copy from d drive to this editor it look like as above sir,

the same error was displayed.

Read only

0 Likes
1,001

Hi,

make sure that internal table and flat file match.

In Internal table name is first thing declared and in flat file its rollno

Regards

Read only

0 Likes
1,001

Make sure, tab delimited means, you should press tab key in the key board, between each field in the flat file. Then check fields are in same order.

Read only

0 Likes
1,001

131

132

133

now am deleted all the fields, only the current fields are in the flat files. then am execute the program ,

the same error should be displayed .

i dont know what to do further.

plz help

Read only

0 Likes
1,001

Hi,

make ur flat file like this

POONKODI 131 FEMALE 80 90 70 255921

VIGNESH 132 MALE 89 87 56 255922

SURENDER 133 MALE 89 87 54 252799

I dont know what A specifies u didnt declare in internal table

Regards

Read only

0 Likes
1,001

HMMMM..

THANKS A LOT ..