09-05-2014 12:19 PM
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.
09-05-2014 1: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
09-05-2014 1:15 PM
Hello Janis,
Just to reiterate this aRFC call triggers an implicit database commit. So the OP is partially correct
we have 2 things which we need to consider -
Simply put, as per SAP documentation, you cannot use aRFC within an update task.
BR,
Suhas
09-05-2014 8: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