2008 Mar 01 11:29 AM
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.
2008 Mar 01 11:45 AM
give tab between the data notepad
like
field1 field2 field3.
regards,
venkat.
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.
2008 Mar 01 11:30 AM
2008 Mar 01 11:38 AM
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.
2008 Mar 01 11:43 AM
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
2008 Mar 01 11:45 AM
give tab between the data notepad
like
field1 field2 field3.
regards,
venkat.
2008 Mar 01 11:54 AM
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.
2008 Mar 01 12:05 PM
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
2008 Mar 01 12:24 PM
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.
2008 Mar 01 12:39 PM
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
2008 Mar 01 12:51 PM
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
2008 Mar 01 12:58 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |