Application Development and Automation 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: 
Read only

Program not working in background

ricky_shaw
Contributor
0 Likes
5,019

Hello,

I have a Z program that uses open dataset stmts that writes the file out into a specified directory in the appl server path.

The prgram runs fine in foreground. But when scheduled in background it fails.

The job logs are :

Dierctory does not exist

Job cancelled after system exception ERROR_MESSAGE

The destination path can read, write and edit files in the directory.

i tried to create .txt file & also without any extension.

Can someone suggest me what i am doing wrong.

Thanks

Ricky

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,508

Hi Rick,

May be you are not doing anything wrong, check the path in APP server, use T-Code AL11 for the same ensure program is picking the correct path. If that is there, check "authority-check dataset" this checks whether your user id have authorization to write to application server.

Note : DATA SET works both on foreground and background, so you should not worry about that.

Best Regards,

Tapodipta Khan.

9 REPLIES 9
Read only

Former Member
0 Likes
2,508

Goto SM37,

select the job and type JDBG in teh command box on top left. this will take you to debug mode, debug you program here.

Read only

0 Likes
2,508

Hi Tarla,

What is the tcode ? JDBG does not exist it seems.

If not, what is the sequence to execute this .

Thanks

Ricky

Read only

0 Likes
2,508

Hi Tarla,

> What is the tcode ? JDBG does not exist it seems.

> If not, what is the sequence to execute this .

>

> Thanks

> Ricky

check this wiki on how to use jdbg

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=156697598

Read only

0 Likes
2,508

Hi Tarla,

I am still unable to get the tcode JDBG.

It gives me the msg "Transaction JDBG does not exist" on the status bar.

Thanks

Ricky

Read only

0 Likes
2,508

Hi

JDBG is not Transaction, It will work in below process.

1. GOTO t-code SM37 And give your JOB Details like name.. then Click on Execute.

2. Now YOur in Job Overview Screen Select your Job (any one check Box) and Now Enter JDBG in Command Field(Transaction field) , then Program automatically start in Debugging Mode.

3. Actually JDBG is used to DEbug Bacground job.

-Ganesh

Read only

Former Member
0 Likes
2,508

Based on your error message, one would ask what is the directory (folder) named supplied in background, since it does not exist? How is this directory path different from what is supplied when the program executes in foreground?

Read only

Former Member
0 Likes
2,509

Hi Rick,

May be you are not doing anything wrong, check the path in APP server, use T-Code AL11 for the same ensure program is picking the correct path. If that is there, check "authority-check dataset" this checks whether your user id have authorization to write to application server.

Note : DATA SET works both on foreground and background, so you should not worry about that.

Best Regards,

Tapodipta Khan.

Read only

matt
Active Contributor
0 Likes
2,508

If you issue message type E in a background job, then the job is cancelled. Obviously, the directory your writing to doesn't exist. Change your program, so that just before you open the dataset, use a message type I with the dataset name. That way, you'll be able to see in the log what dataset you're attempting to write to. Also, the OPEN DATASET has a an addition to trap the message from the operating system. Look at the syntax through F1 help, and use that addition. ( MESSAGE msg )

My guess would be the user you're running the background job under has insufficient privilege.

Read only

Former Member
0 Likes
2,508

Hi,

Has anyone got any solution to this problem. I'm able to create forlder and write some files using ABAP program in foreground process and also in background with JDBG but the same doesnt happen when run in backgroud.

The user id used to run the program has SAP ALL access so doesnt seem to be an  authorisation issue.

I'm using function module TMP_GUI_CREATE_DIRECTORY to create folder and

  GUI_DOWNLOAD to write files in designated folders. The program doesnt have any BDC

Help would be appreciated.

Regards,