2005 Oct 19 10:04 AM
please help me for the following questions:
a. what command i should use to know if a file is present in the application server (/usr/sap/trans)?
b. what command i used use to copy a file?
invbal.csv -> invbal1.csv
thanks.
donna
2005 Oct 19 10:08 AM
please help me for the following questions:
a. what command i should use to know if a file is present in the application server (/usr/sap/trans)?
b. what command i used use to copy a file?
invbal.csv -> invbal1.csv
thanks.
donna
2005 Oct 19 10:08 AM
to find about file existence....
read dataset (check for sy-subrc = 0 for success)
to copy file...
read the file in an internal table (open dataset d1 for input)
open another file for output (open dataset d2 for output)
transfer contents of itab into d2.
close both files. (close dataset)
rgds,
PJ
2005 Oct 19 10:08 AM
2005 Oct 19 10:16 AM
Hi,
You can define you own external command via SM69 and execute it via SXPG_COMMAND_EXECUTE
Eddy
2005 Oct 19 10:18 AM
hi,
DATA:
dsn(20) VALUE '/usr/sap/trans/invbal.csv',
dsncopy(20) VALUE '/usr/sap/trans/invbal1.csv',
rec(80).
OPEN DATASET dsn.
if sy-subrc <> 0.
file not exits
exit
endif
DO.
READ DATASET dsn INTO rec.
IF sy-subrc <> 0.
EXIT.
ELSE.
WRITE / rec.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET dsn.
OPEN DATASET dsncopy.
TRANSFER rec TO dir.
close dataset
cheers,
sasi
2005 Oct 19 11:19 AM
1. If you want ot check the existence of the file manually just go to AL11 transaction and navigate through the path that you have specified and find the file.
2. To copy a file open the file using open dataset transfer it to an internal table and then write it in another file.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |