Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

USe update task after commit.

Former Member
0 Kudos

Hi,

I have a scenario, where I am putting an enhancement point after a sales order commit happens.

I am selecting the change nor from CDHDR table and updating that in a 'z' table.

I created a FM of update task type and called it from the above point.

1. Is it possible to have that update committed ?

2. The select for change nor: Since a commit occurs above there are issues when this code executes before that commit. Will teh update task also handle that delay?

3. Do I have to add a commit again? The reason is because all of this takes place in standard code for Sales Order Change.

Regards,

Arnab.

3 REPLIES 3

Former Member
0 Kudos

Hi,

1. & 3. You can't use a commit statement in your update task FM. The standard transaction commit that triggers your FM will do the job.

2. There is no guarantee that you will catch the changes in selecting CDHDR data at the right time to get exactly the data you need after the commit. If you know the data you want to save to your Z table it may be better (and possible) to compare the existing data of your sales order and the new data (currently being processed) and give this data as an input parameter to your update task FM.

Hope this will help you to find the good solution.

Issa

0 Kudos

Hi,

Thank you for your response. I am moulding my question a little.

Regarding commit. Lets say

1. There are three FMs which are called in Update task mode.

2. Then there is a commit

What is the sequence in which the three FMs are going to be called?

On the same scenario we have a standard transaction which ends. If there is any delay called by any of the three FMs that is not felt by the end user while he or she processes it. How does this happen?

How do we track the way these three are called? Can we change the sequence if there is one?

To add, I want to know what happens deep inside that.

0 Kudos

Hi,

The update task calls will schedule the FMs for later processing in the sequence they occur. At commit event FMs are executed in the same sequence (first stored is first executed).

Real FM processing will start at the end of the standard transaction (the commit work). System does not wait until all subsequent tasks end. Final messages are displayed (document number XXXXX created for example). At that time update task processes may still be running.

In the case of delay when you try to change or display that document system will tell you the document does not exist. Suppose a problem occurs in one of the currently running update tasks, all database changes linked to the commit will be cancelled and your document (XXXXX) will never exist. A sap message express will inform the user if such an error occurs. Logs are stored in SM13 (or ST22 in some cases).

I m not sure that you can change the sequence in which tasks are scheduled at execution time.

Hope this will help.

Issa