06-05-2009 4:01 PM
hi everybody
ive written a program to run in background, which uploads a text file from application server and creates accounting documents
It also deletes the text file after processing
however, when i run the program in background, the text file is not deleted but when i run it in foreground, its deleted
Anybody knows why?
06-05-2009 4:12 PM
Hi,
Are you using 'DELETE DATASET'?
Check the return code of SY-SUBRC.
Thanks,
Subramanian
06-05-2009 4:20 PM
yes im using delete dataset
how can i check it in background?
when running it in foreground, its getting deleted
06-05-2009 4:30 PM
Try to debug the job, in sm37, in the list of job, select your job and type in the System Command Box 'JDBG' and hit enter.
Angelo.
06-05-2009 4:52 PM
TRY TO CHECK EXCEPTION AS FOLLOWS;
DATA myref TYPE REF TO CX_SY_FILE_OPEN.
DATA err_text TYPE string.
TRY.
DELETE DATASET W_file.
CATCH cx_sy_file_open INTO myref.
err_text = myref->get_text( ).
ENDTRY.
write err_text.
OR YOU CAN CHECK CX_SY_FILE_AUTHORITY EXCEPTION
06-05-2009 5:25 PM
Hi,
When you run in background the program does not run with your name but background user.
So probably there is no authority to delete the file.
Regards,
Ankur Parab
06-08-2009 2:46 PM
Hi Ankur
How do u check if a user has the authority to delete a file?
06-06-2009 7:10 AM
want to make sure you are deleting file from Applcation server (Unix) and not from Desktop.
If its desktop frontend services will not work. Just a thought.
Also check your file is CLOSED correctly before you Issue DELETE DATASET COMMAND.
After Close Issue some WAIT Command, also can try COMMIT.
06-08-2009 3:35 PM
Hi
check the right of the BATCH-user:
the user need: s_dataset > ACTVT : 06,33,34
you can see it with a system-tracelog ST01 at authority check of the Batch-user. (but stop the trace after running the job ...)
bestreg Robert
07-28-2009 10:08 AM
its getting deleted , i put the command WAIT FOR 3 SECONDS, after the CLOSE dataset command, then delete dataset
it works fine now