‎2007 Mar 02 9:27 AM
The sap standard program rfchke00 generates a file wich is stored on application server.. I am able to open it after sumitting the pragram in my report.. Now ,how can i read it, character by character, so taht i can change the layout of the data present in it and map it to an internal table.
‎2007 Mar 02 9:31 AM
use
OPEN DATASET <filename> for input in text mode.
READ DATASET into <var>
CLOSE DATASET.
‎2007 Mar 02 9:31 AM
open dataset <filename> for input in text mode....
do.
read dataset <filename.>
move to string or internal table
enddo.
reward points if helpful
‎2007 Mar 02 9:31 AM
if u know the location of the file on app server then u can read the file in a program through open data set
read data set
close data set
For a full code do revert back.
If found useful reward with points.
‎2007 Mar 02 9:31 AM
Hello,
Better upload the file from Apll. server to internal table and make the modification.
Sample code:
* Retrieve Data file from Application server(Upload from Unix)
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
OPEN DATASET i_file FOR INPUT IN TEXT MODE.
IF sy-subrc NE 0.
MESSAGE e999(za) WITH 'Error opening file' i_file.
ENDIF.
DO.
* Reads each line of file individually
READ DATASET i_file INTO wa_datatab.
* Perform processing here
* .....
ENDDO.
Refer this link
http://www.sapdevelopment.co.uk/file/file_updown.htm
Vasanth
Message was edited by:
Vasanth M
‎2007 Mar 02 9:34 AM
Here is full code.
data:begin of itab occurs 0,
data(500),
end of itab.
open dataset <file name> for input in text mode.
if sy-subrc = 0.
do .
read dataset <filename> into itab-data.
if sy-subrc = 0.
append itab.
else.
exit.
endif.
enddo.
close dataset <filename>.
endif.
Regards,
Ravi