‎2007 Jan 17 6:45 AM
hi experts,
i have a file which gets uploaded to itab using gui_upload FM. the problem is the entire file is directly loaded whereas i need to to read one line at time, and processes it.
By this i mean when one line is read, if its read properly,the status is stored in a status field of itab as in 1, if not field sud store '0'.
thanks in advance
‎2007 Jan 17 7:06 AM
You can upload the entire file into application server first (using CG3Z) and then make use of :
<opendataset>
Read dataset (between a DO and ENDDO) which will help u to read one line after another.
<closedataset>
Reward points if Helpful
‎2007 Jan 17 6:52 AM
u can also process it by gettting all the items at a time , any how u are not modifying the file.
call GUI_UPLOAD.
loop at itab.
checkings
display errors to correct
endloop.
Regards
prabhu
‎2007 Jan 17 6:53 AM
Hi Bijal,
Uploading data from presentation server line by line is not possible,
as this blocks so much of resources.
Once the entire data is uploaded into itab, u can loop at ITAB & check for your conditions.
Regards,
Vaibhav.
‎2007 Jan 17 6:53 AM
Hi bijal,
One of the way you can do the same thing,
as you are saying that it get's populated into the internal table as you are using some function module.... so in your code you can do one thing is that you can transfer the whole data to another internal table compairing the values you want and for the fields not matching ur criteria you can set a ' 0 ' at the starting ...
as the secong internal table will have status as it's first field... Beacuse operations between two internal tables will be quite easy......
I hope that you are a bit satisfied...... it can be one of the methods you can do you solution
‎2007 Jan 17 7:03 AM
Hi,
Reading a file line by line from Presentation server is not possible.
U need to gather all the data into one internal table and modify the internal
table by looping at the same.
loop at it_table.
it_table-field1 = 'X'.
modify it_table index sy-tabix.
clear it_table.
endloop.
Regards,
GSR.
‎2007 Jan 17 7:04 AM
hi all,
if file contains a INT field, which gets filled in a CHAR field of itab,
it gives a error and no uploading occurs..
file should read all data even after it has encountered an error, and store corresponding data.
and if this is not possible using GUI_UPLOAD, can a file in presentation server be read by OPEN DATASET.
thanks a lot.
‎2007 Jan 17 8:37 AM
Hi,
Is ur issue solved ? if yes please close the thread.
If no what type of error it gives, can u copy paste few rows of your file & structure of your internal table.
Regards,
Vaibhav.
‎2007 Jan 17 7:06 AM
You can upload the entire file into application server first (using CG3Z) and then make use of :
<opendataset>
Read dataset (between a DO and ENDDO) which will help u to read one line after another.
<closedataset>
Reward points if Helpful