Skip to Content
avatar image
Former Member

Starting new task inside an Update Task

Hi guys,

I need an expert opinion for a problem I'm facing at the moment.

The requirement is this: I need to trigger a function module during the update task of a material document.

This function module however should not slow down the posting of the document, so it must not be in the same LUW, but in a separate task.

My question is: does it work to call a function module with STARTING NEW TASK inside an UPDATE TASK (for example a user exit) and if it does work, what's your opinion on it? Is if safe? Does it come with problems? According to the SAP documentation, STARTING NEW TASK does not trigger a COMMIT when it's called inside an update task.

The alternative would be to trigger a work flow, but that's much more work.

Any input is welcome.

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Sep 05, 2014 at 12:06 PM

    Hi,

    I may be completely mistaken, but I interpret the following quote from ABAP Docu to mean: STARTING NEW TASK does implicit COMMIT:

    Asynchronous RFC triggers a database commit in the calling program. An sRFC during the update is an exception to this.

    Meaning - there is no commit if you omitt STARTING_NEW_TASK - use sysnchronous RFC...

    Where did you read that it does not trigger COMMIT?

    cheers

    Janis

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Janis,

      Just to reiterate this aRFC call triggers an implicit database commit. So the OP is partially correct 🤪

      Former Member we have 2 things which we need to consider -

      • Asynchronous RFC triggers a database commit in the calling program.
      • Any database commits or database rollbacks that occur within the update task cancel the update.

      Simply put, as per SAP documentation, you cannot use aRFC within an update task.

      BR,

      Suhas

  • Sep 05, 2014 at 07:22 PM

    Hi,

    You don't need a workflow.

    What you can do is just create a simple task and bind it to a class.

    For the task you have option of either binding to a business object or to a class.

    So use the option for a class.

    The task should be triggered at the event of material document creation event.

    In the method of the class you can call the function module you need.

    Regards,

    Ankur Parab

    Add comment
    10|10000 characters needed characters exceeded