2009 May 22 8:14 AM
Hi,
i am reading a text file using GUI_UPLOAD.
but agter reading the file when i am looking into table its reading upto only position 256 of each line.
i need to read full line upto position 500 of the text file .. please guide me in this case.
thnx
vikash
2009 May 22 8:40 AM
hi vikash
you have to increase the size of internal table.
like suppose you have internal table ITAB it contans 3 fields
data : begin of itab occurs 0,
text(500) type c, " here you downloading the text so check the length
line_num type i,
pname(30) type c,
end of itab
data : p_file type string.
p_file = 'c:\test'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file
FILETYPE = 'DAT' " check formt either DAT or ASC or DBF
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.
hope this will helpfull for you.
Hi,
i am reading a text file using GUI_UPLOAD.
but agter reading the file when i am looking into table its reading upto only position 256 of each line.
i need to read full line upto position 500 of the text file .. please guide me in this case.
thnx
vikash
2009 May 22 8:20 AM
Hello,
Dont take the internal table as fields, take it as char or string.
In the upload program u can split into the internal table.
BEGIN OF gi_text OCCURS 0,
champ(3000),
END OF gi_text.
Call upload FM
TABLES
data_tab = gi_text
You take string also instead of char and try
Edited by: Santosh Marupally on May 22, 2009 9:20 AM
2009 May 22 8:34 AM
Hi,
check the following code......
types: begin of ty_load,
text type string,
end of ty_load.
data: i_load type table of ty_load ,
w_load type ty_load.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\Documents and Settings\rk56944\Desktop\test.txt'
FILETYPE = 'ASC'
TABLES
DATA_TAB = i_load
Rgds,
Raj.
2009 May 22 8:39 AM
Hi,
while declaring the field declare it with type string.
eg: types: begin of t_text,
lines type string,
end of t_text.
data: it_text type table of t_text with header line.
call the FM GUI_UPLOAD.
in the table parameter you will get the complete data.
Regards,
Venu
2009 May 22 8:40 AM
hi vikash
you have to increase the size of internal table.
like suppose you have internal table ITAB it contans 3 fields
data : begin of itab occurs 0,
text(500) type c, " here you downloading the text so check the length
line_num type i,
pname(30) type c,
end of itab
data : p_file type string.
p_file = 'c:\test'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file
FILETYPE = 'DAT' " check formt either DAT or ASC or DBF
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.
hope this will helpfull for you.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |