2007 Sep 14 7:10 PM
Hi,
I want to know how to read and write data into application server.
I am new to this and i want a simple code for reading datas from application server and also write datas into application server.
Please help me its very urgent.
Thanks in advance.
Ramya
Hi Rob,
What is incorrect? Culd u plz explain??
2007 Sep 14 7:27 PM
2007 Sep 14 7:53 PM
2007 Sep 14 8:07 PM
Ramya,
check this sample code...
this is for uploading data into apllicn server
OPEN DATASET <file name> FOR {OUTPUT/INPUT/APPENDING}
IN {TEXT/BINARY} MODE
chk this program..
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.
Downloading files to SAP(Application Server)
Download internal table to Application server file(Unix)
DATA: e_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
open dataset e_file for output in text mode.
lOOP AT it_datatab......
transfer it_datatab to e_file.
ENDLOOP.
close dataset e_file.
~~Guduri
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |