Skip to Content
author's profile photo Former Member
Former Member

Function Module (ENQUEUE_ES_PROG) not working in Background

I scheduled a job which runs every 15 mins in the the background to fetch data from an external system,depending on the data volume ,the program can sometimes run for over 15 minutes.To avoid data conflict I used a function module ENQUEUE_ES_PROG on the program to first check if the job started is still running before another job gets kicked.The problem I have is the fact that this function module does not seem to work in the background but in the looks perfect in foreground. Does anyone have a clue on how to use this FM for background job?

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 02:33 PM

    Hi,

    Instead, why don't you query the table TBTCO for the jobname and status = 'R' for active job to be really sure.

    This will work in foreground and background.

    You are likely to have more than one background process on the app server so this will safeguard against that.

    Kind regards

    colin 😊

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 03:36 PM

    If you have any implicit or explicit COMMITs in your program, all locks will be released. HTH

    Ramki.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 01:46 PM

    Hello Mochabo,

    Consider the following scenario:

    Your job is running for more than 15 minutes. Since it is running in the background, it will be executed by a work-process of type BACKGROUND. If there's only one BACKGROUND work process configured for your application server, then the second job will have to be waiting till the first one finishes and releases the background work process.

    But when you are executing this in the foreground, the DIALOG work-process does the processing. So you are not finding any problem.

    So, to my knowledge, there will be a problem when there's only one BACKGROUND work process. Please go to transaction SM50 and see how many of them are configured for the current application server.

    Also, in case there's only one BACKGROUND work-process, you will not have toworry that the second job will start before the first has finished. It simply can't. It has got to wait.

    Hope this explanation helps.

    Regards,

    Anand Mandalika.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2004 at 02:44 PM

    Hi Mochabo,

    What do you mean that it does not work in background. What error did you get. What are the parameters you pass to this function module.

    This function looks the same as all other enqueue functions. Enqueue works in background.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.