Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

job in background

Former Member
0 Kudos

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?

9 REPLIES 9

Former Member
0 Kudos

Hi,

Are you using 'DELETE DATASET'?

Check the return code of SY-SUBRC.

Thanks,

Subramanian

0 Kudos

yes im using delete dataset

how can i check it in background?

when running it in foreground, its getting deleted

0 Kudos

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.

Former Member
0 Kudos

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

former_member555112
Active Contributor
0 Kudos

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

0 Kudos

Hi Ankur

How do u check if a user has the authority to delete a file?

Former Member
0 Kudos

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.

robert_altenstraer
Active Participant
0 Kudos

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

0 Kudos

its getting deleted , i put the command WAIT FOR 3 SECONDS, after the CLOSE dataset command, then delete dataset

it works fine now