Application Development 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: 

holding more than 255 characters

Former Member
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos
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

Former Member
0 Kudos

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.

former_member181962
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

Also ensure, you close the file before uploading the file into SAP.

Regards

Vivek

Please reward points for all the useful answers

Former Member
0 Kudos

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.