‎2008 Apr 23 9:01 AM
Hi all,
I need some help on deleting files from SAP application server.
what i want to do is.
upload the file from the server to a internal table
then do the sales order creation using a BAPI
then transfer the file to another folder.
I know how to upload and do the SO creation. only problem is with deleting the file.
I know how to write it in another location.
can any of u guys help me out on this.
thanks in ADV
nafran
‎2008 Apr 23 9:08 AM
Hi,
use process type 'os command' and you can delete the file.
OR
Try DELETE DATASET <dataset name> .
or use FM EPS_DELETE_FILE
ie;
You can use DELETE DATASET with target path.
Use statement
delete dataset '\tmp\file.txt'.
\tmp\file.txt is the file path on application server which you want to delete.
hope this helps.
Regards,
Raj.
‎2008 Apr 23 9:05 AM
You'll need to set up an Operating System command in txn SM69.
And execute this in your program using func mod SXPG_EXECUTE
‎2008 Apr 23 9:08 AM
@Phil Rix:
Sorry, but you do not need to execute an OS command to delete a file on AppServer.
To delete a file localed on AppServer use ABAP statement
DELETE DATASET...
‎2008 Apr 23 9:14 AM
‎2008 Apr 23 9:08 AM
Hi,
use process type 'os command' and you can delete the file.
OR
Try DELETE DATASET <dataset name> .
or use FM EPS_DELETE_FILE
ie;
You can use DELETE DATASET with target path.
Use statement
delete dataset '\tmp\file.txt'.
\tmp\file.txt is the file path on application server which you want to delete.
hope this helps.
Regards,
Raj.
‎2008 Apr 23 9:09 AM
For Writing a file or reading a file from the Appl server, You need to use the statement: "Open Data Set" / "TRANSFER - Writing to a File" / "DELETE - Delete a file ";
Check out the help on these statements
Hope this helps you
Regards
Shiva
‎2008 Apr 23 9:14 AM
As you need to copy the file from one folder to another, you can use command MOVE <path1> <path2>.