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: 

RUNNING PROGRAM IN BACKGRUND

Former Member
0 Kudos

I'm running a program that should create a file with 'opendataset for output...' and it create the file.

When I run the same program in background the file is not created.

Same user then same right!

do you have any idea to help me?

regards,

1 ACCEPTED SOLUTION

ChristianFi
Active Participant
0 Kudos

Actually this should work....

are you sure that it is the same path and can be reached from the application server (are there more than one application server involved?

For analysis purposes I think there is an option of the open dataset which gives the reason back why a file could not be created (messages if I remember right)

You could add this and see if and why it fails...

You can also restart the job via sm37 in debug mode (by clicking on the job and put JDBG in the ok_code field) if this does not cause to much load on your system.

Christian

9 REPLIES 9

Former Member
0 Kudos

Is your job running on a different server than your online user? Does the other server have the same directory structure?

0 Kudos

Hi charles,

Thanks for your answer I was thinking to this problem too...

But let's suppose there are different application server, how should I correct my program...

I'm looking in transaction AL11 the possible directories and maybe the one I'm using is only for one application server.

What do you think about that ?

How then should I solve this ? Use another directory ?

Message was edited by: STEPHAN KAMINSKI

0 Kudos

Stephan,

If it is a problem with the program running on the wrong server you can correct it by setting up the job in SM36 instead of just executing it from the selection screen. On the first screen you can type in your target server.

Becky

0 Kudos

Hi Stephen,

Typically in a multi-server environment, load balancing takes care of distributing the background jobs to different application servers. So, there needs to be a file handling strategy in place. Here is how it works.

1. Create a file structure for all your requirements.

2. Mount this file directory struture on all the application and database servers. OS people will be doing this. By doing this, you will remove the dependency on which server program runs. Also, any file can be created/changed/deleted from ABAP, irrespective of which server it is run on.

3. Create logical filenames so that all programs can use them as a standard. This will also help in centralizing the changes to the directory structure. Suppose, you want to point a logical file directory to a different physical directory, you do it in one place not in every program(if you don't use logical files).

Hope this helps,

Srinivas

ChristianFi
Active Participant
0 Kudos

Actually this should work....

are you sure that it is the same path and can be reached from the application server (are there more than one application server involved?

For analysis purposes I think there is an option of the open dataset which gives the reason back why a file could not be created (messages if I remember right)

You could add this and see if and why it fails...

You can also restart the job via sm37 in debug mode (by clicking on the job and put JDBG in the ok_code field) if this does not cause to much load on your system.

Christian

0 Kudos

Christian,

I tried this in fact!

I planned the job it didn't work! I runned it online (se38) and it did work.

maybe there are different directories!

0 Kudos

To check if it is a problem with different server

try following:

go to sm51 - click on the server on which the background job was started (and failed). Call se38 and try it again. If it fails in foreground it is a problem of the application server.

Christian

andreas_mann3
Active Contributor
0 Kudos

Hi,

->pls control sy-subrc

OPEN DATASET dsn FOR output MESSAGE msg.

IF sy-subrc <> 0.

WRITE / msg.

STOP.

ENDIF.

I'll guess it's an auth.-problem

regards Andreas

0 Kudos

Hi Andreas,

Thanks for this