02-07-2008 9:08 PM
Hi Experts,
I have an internal table itab as below.
Data : begin of itab occurs 0,
first_name(10) type c,
last_name(10) type c,
end of itab.
I am passing some values to this internal table and sending the data to a file in app server say 'p_file'.
Now can u people give me the code to read the data back from the file in the application server back to my internal table..
Its bit urgent. <REMOVED BY MODERATOR>
Vishnu.
Edited by: Alvaro Tejada Galindo on Feb 7, 2008 5:38 PM
02-07-2008 9:12 PM
clear itab.
open dataset p_file for input in text mode.
do
read dataset p_file into itab.
if sy-subrc ne 0.
exit.
else.
append itab.
clear itab
endif.
enddo.
close dataset p_file.
Regards,
Sudhir Atluru
02-07-2008 9:22 PM
02-07-2008 9:57 PM
Hi
TYPE:
BEGIN OF ty_dump,
c(500) TYPE c,
END OF ty_dump.
DATA:
v_dir_file(100) TYPE c,
it_dump TYPE TABLE OF ty_dump WITH HEADER LINE.
CONCATENATE UrApplServerPath FileName INTO v_dir_file.
OPEN DATASET v_dir_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
DO.
READ DATASET v_dir_file INTO it_dump.
IF sy-subrc NE 0.
EXIT.
ENDIF.
APPEND it_dump.
CLEAR it_dump.
ENDDO.
ENDIF.
CLOSE DATASET v_dir_file.
Cheers
~Arun