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

Call function start new task

How can i control number of task running with Call function 'ZMY_FUNC' starting new task?

My program:

DO 5 TIMES.

CALL FUNCTION 'ZMY_FUNC' STARTING NEW TASK 'TEST'.

COMMIT WORK.

ENDDO.

Function ZMY_FUNC:

WAIT UP TO 100 SECONDS.

Where i see this task running? I went to SM58 and SM37 and nothing!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 07, 2013 at 08:01 PM

    See transaction SM50. In ZMY_FUNC waiting is not enough, do for example a SELECT..ENDSELECT on a table with a million or so lines. You should see the tasks occupying upto 5 work processes of type dialog (DIA) in transaction SM50.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      No, I don't think so. Limit the execution time by other means. If you are processing data, just limit the amount of data that is being processed by each invocation so that it takes shorter time. If there is a loop involved just store the value of SY-UZEIT when entering the loop and check on each loop iteration the current value of SY-UZEIT and exit the loop with the exit command if the time limit has been reached (the difference of the computation is time in seconds the loop has been executing).

      If you want to implement complex parallel processing, you should be looking at an existing implementation. Transaction SGEN is one. You may have to do keep records in a table and involve enqueue.

  • Posted on Jan 07, 2013 at 08:12 PM

    SM50 will show you the task running, you could also use the [{CALLING meth}|{PERFORMING subr} ON END OF TASK] here decrement a counter, increased when CALLING FUNCTION. then you could add a WAIT UNTIL counter = 0 in main program if required. That can be useful when managing huge volume of data, as the submitted task will be considered as interactive process so can reach the time out limit. So you may be required to start smaller task and also not use every process of the avaliable servers, for that check FMs of FG SPBT.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2013 at 04:08 PM

    Resolved!

    I´m change my code for CALL FUNCTION IN BACKGROUND TASK and control number of process executing with select in table ARFCSSTATE. This way i can execute process and control number of process in execution.

    Thanks all!

    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.