09-19-2006 10:58 AM
hi all,
i have a text file with each line/record having more than 255 characters. how can i read the lines/records from that file.
thanks & regards,
yellappa.
09-19-2006 11:01 AM
data : begin of itab occurs 0,
<b> line(1000) type c,</b> <--give your length of the file,as you desire.
end of itab.
or simply you can say,
data : begin of itab occurs 0,
<b> line type string,</b>
end of itab.
Regards
srikanth
Message was edited by: Srikanth Kidambi
09-19-2006 11:01 AM
hi,
declare a internal table with one field with length as you require.
based on the location of file i.e on presentation server or application server you can choose the method appropriately.
Hope this helps.
09-19-2006 11:01 AM
HI yellappa,
That is not a problem.
You can still upload it.
YOu may not be able to see it in al11(In case u are uploading to application server).
Regards,
ravi
09-19-2006 11:21 AM
Just define the internal table as below and you would be able to upload a file with more than 255 chars..
data : begin of itab1 occurs 0,
line1(200),
line2(200),
end of itab1.
call function 'GUI_UPLOAD'
exporting
filename = 'C:\delchkrep.txt'
tables
data_tab = itab1.
Loop at itab1.
write : / sy-tabix,
/ '1', itab1-line1,
/ '2', itab1-line2.
endloop.
09-19-2006 11:24 AM
Also ensure, you close the file before uploading the file into SAP.
Regards
Vivek
Please reward points for all the useful answers
09-19-2006 11:34 AM
Define internal table.
types: begin of t_tab,
records(1000),
end of itab.
data: itab type t_tab occurs 0 with header line.
data: itab1 type t_tab occurs 0 with header line.
use upload function.
call function gui_upload.
when you have data in your itab after uploading. Use this code..
split itab at <> into itab1.
"<>" is a separator which can be comma, tab etc. if it is comma then write....
split itab at ',' into itab1.
there are more addition in split statement. please refer SAP help which comes after pressing F1.