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

Calling Function Module in Update Task

Hi,

I am calling a function module in update task.

This function module is a Z function module, and I have set the attributes as an UPDATE FUNCTION MODULE.

Inside this Z function module, it calls another function module (lets say FUNCTION_A) and this function module runs in normal mode. In the Z function module, there are many updates to the database as well as there are some updates in the function module in FUNCTION_A.

My question is : If I call the the Z function module in update task mode ,

1) Will all the updates in this function module as well as in function module FUNCTION_A happen concurrently

2) If any update fails, will all the updates that should be carried out while calling the Z function module fail ?

This is a matter of things being carried out as a single atomic transaction, hence the doubt

Thanks a lot for reading through it patiently and a zillion for responding to it.

Regards,

Subramanian V.

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 18, 2004 at 10:23 PM

    Venkat,

    Just a question to understand the scenario better:

    Can you tell why would you write update statements inside the second function module (Type: NORMAL), when the way to go is to write that piece of code in an update function module?

    This situation, what u face will not arise if you stick on to this.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2004 at 12:27 AM

    I think that all your updates will take place concurrently, or be backed out concurrently. I haven't tried this, though! However, what an Update FM does is to be loaded into an Update Work Process. Think of it as a regular Work Process. If this piece of ABAP calls another FM, the new FM (and it's entire Function Group) load into the same Work Process. It's all one happy LUW.

    The danger: watch out for ABAP commands that will cause premature termination of the LUW. These include issuing an E or W type error, CALL TRANSACTION, CALL FUNCTION with any remote or asynchronous options, etc. See help on CALL FUNCTION...IN UPDATE TASK for a complete list.

    I think that SAP syntax checks these in an Update FM, but probably not in the called FM.

    Add comment
    10|10000 characters needed characters exceeded