‎2007 May 18 7:45 AM
Hi all,
Can we download data from application server based on some condition ?
if so how?
Thanks,
Praveena
‎2007 May 18 7:48 AM
use transactions cg3y or cg3z to down load and upload from applicationservers.
If <cond>
call transaction cg3y or cg3z using....................
else.
exit.
endif.
‎2007 May 18 7:48 AM
use transactions cg3y or cg3z to down load and upload from applicationservers.
If <cond>
call transaction cg3y or cg3z using....................
else.
exit.
endif.
‎2007 May 18 7:49 AM
Hi Sri Praveena,
=> You can download data from Application server using the statements <i><b>OPEN_DATASET & CLOSE_DATASET</b></i>.
DATA FNAME(60) VALUE 'myfile'.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
WRITE / 'File opened'.
.....
ELSE.
WRITE / 'File not found'.
ENDIF.This example opens the file "myfile" for reading.
From here, the file is open in read access mode as per your requirement.
=> Use the transaction <i><b>CG3Y</b></i> for downloading the file from application server. This can also be used in programming.
This sort out your query.
PS Plz close the thread by rewarding each reply.
Regards
Message was edited by:
Sapna Modi
‎2007 May 18 7:53 AM
Hi,
Check the following 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.
Hope this helps.
Reward if helpful.
regards,
Sipra
‎2007 May 18 7:54 AM