Skip to Content
author's profile photo
Former Member

RUNNING PROGRAM IN BACKGRUND

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,

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Posted on Feb 01, 2005 at 02:24 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Posted on Feb 01, 2005 at 02:29 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Feb 01, 2005 at 02:21 PM

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

    Add comment
    10|10000 characters needed characters exceeded

    • 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