‎2006 Jun 28 7:26 PM
Hi,
Does anybody know what the return code (sy-subrc = 1-) mean when calling external command using:
call 'SYSTEM' id 'COMMAND' field cmd id 'TAB' field ITAB-*SYS*.where the cmd is:
cp <old file name including full directory address> <new file name in the same directory> ;The goal is the copy the old file to a new file and both exists in the same directory on the application server.
I have check the authorization and get the sy-subrc = 0 for both of the following checks:
AUTHORITY-CHECK OBJECT 'S_C_FUNCT' ID 'PROGRAM' FIELD SY-REPID ID 'ACTVT' FIELD '16' ID 'CFUNCNAME' FIELD 'C_DIR_READ_START'.
AUTHORITY-CHECK OBJECT 'S_C_FUNCT' ID 'PROGRAM' FIELD SY-REPID ID 'ACTVT' FIELD '16' ID 'CFUNCNAME' FIELD 'SYSTEM'.Since the file will be huge, OPEN another dataset is
‎2006 Jun 28 7:28 PM
Continue....
Since the file is huge, open another dataset for the new file is not preferable.
The purpose is to rename a file (or copy) a file to a new file name after the data is extraction completely.
Any advice is appreciated.
Thank you,
Minami
‎2006 Jun 28 8:03 PM
Not sure about call statements, but you can create an external command at OS level with 'MV' command.
And execute the same using SXGP~EXECUTECOMMAND FM.
Then delete the old file after successfully execute of the above FM
REgds
Manohar
‎2006 Jul 05 8:18 AM
Hi Minami
You could program a "normal" BAT file with the command to rename the file: rename <drive>:\<old file> <new file>.
When you have created the BAT file you create an external command via transaction SM69 where execute the BAT file you have just created.
Now you have 2 ways of executing your external command: either online via transaction SM49 or you can code an ABAP program to execute the external command via submitting a batchjob. You do this by calling the following functions in the listed order:
1. JOB_OPEN
2. JOB_SUBMIT
2a. If the submit function fails you execute function: BP_JOB_DELETE
3. JOB_CLOSE
I hope this helps.
Best regards
Arne
‎2007 Jun 20 3:33 PM
Hi Minami,
I need to rename the file on Appl server in my program please tell me how did you do that?
Thanks
Dany