‎2009 Jun 25 6:26 AM
HI,
What is the advantage of working in update task ?
if i want to work on update task without using function module how can i do so?
what is the advantage on regular commit work command.
BR
Michael
‎2009 Jun 25 6:53 AM
Hi,
There are no advantages or disadvantages of working in an update task.
Sometimes there might be a requirement that you have to do further processing only if the current processing was successful.
For example.
When I create an Handling Unit via HU02; i want that a Transfer order to be created immediately for this HU once the HU is created.
An option for me now is to create the transfer order in the UPDATE task.
This is because teh UPDATE task will be triggered as soon as COMMIT work occurs.
So i am sure that my transfer order will be created when the HU is created.
For more details on UPDATE task you can read the SAP documentation by doing F1 help on COMMIT WORK.
Regards,
Ankur Parab
‎2009 Jun 25 6:53 AM
Hi,
There are no advantages or disadvantages of working in an update task.
Sometimes there might be a requirement that you have to do further processing only if the current processing was successful.
For example.
When I create an Handling Unit via HU02; i want that a Transfer order to be created immediately for this HU once the HU is created.
An option for me now is to create the transfer order in the UPDATE task.
This is because teh UPDATE task will be triggered as soon as COMMIT work occurs.
So i am sure that my transfer order will be created when the HU is created.
For more details on UPDATE task you can read the SAP documentation by doing F1 help on COMMIT WORK.
Regards,
Ankur Parab
‎2009 Jun 25 7:40 AM
Hi ankur,
so commit work is called update task ,so what is the diffrence between commit work and commit
work and wait ?
and how can i do update without update task .
Best Regards
Michael
‎2009 Jun 25 7:45 AM
Hi,
Basically SAP does all the updates in an UPDATE task.
So on execution of COMMIT WORK statement; the update task begins and the data is uploaded in the database.
Suppose you want to do something only when the data has been actually posted then you make use of COMMIT WORK and WAIT.
In this case the processing will continue only after all the updates have happened.
Regards,
Ankur Parab
‎2009 Jun 25 7:51 AM
Hi Commit work updates Database and jump to the next statement immediately whereas Commit work and wait, waits for sometime before jumping to next statement.
Sometime because of the increased Netwrok Traffic, Database updates might take some time and hence you might want your next statement to wait a bit before moving to next statement.
For eg: One of your Function Module is creating a Document in SAP database and your second statement is trying to access that document, now because of the heavy netwro traffic you may want your second statement to wait a bit before trying to access the newly created SAP Document and hence you would use here Commit work and wait.
Update Task is required when your database update is dependent on some other databse update or for a bundle update. For eg: I want to store the additional information in a ZTABLE, for a customer during the sales Order creation witrh ref to the sales order number, now i would be writing my code in the sales order exit and writing my Insert into ZTABLE inside the Function Module with Update task. This would ensure that the entry in the ZTABLE would only go when the database update happening for the sales order creation and hence I would save myself from a database inconsistency where I may have a Sales Order data inserted in the ZTABLE but the same Sales Order Number might not exists.
Hope it helps.
‎2009 Jun 25 8:48 AM
Hi AJAY,
Thanks,
How i use it ? if i don't want to use it via FM (in update task) there is another way?
how it influence on the performance ?
BR
Michael
‎2009 Jun 25 9:10 AM
Hi Michael,
You can also use synchronous update ( COMMIT WORK AND WAIT ) via PERFROM ON COMMIT statement. This bundling method is similar to function modules, but has different technical background. Call FM in UPDATE TASK require additional table where it must be registered (before accual call) whereas PERFROM ON COMMIT does not. On the other hand data to such subroutine can't be called via subroutine parameters. Such subroutine can work only with global data of the program where it is called.
Suppose we have
FORM update_my_tables. "not interface allowed here (no parameters)
"some updates here
ENDFORM.
"now when you call it even twice or three times, it will be executed only once
PERFORM update_my_tables ON COMMIT.
PERFORM update_my_tables ON COMMIT.
"if COMMIT WORK is reached it will executed update_my_tables synchronously (so as it would be called like COMMIT WORK AND WAIT)
"here however you use only COMMIT WORK
COMMIT WORK.
For more information and graphical ilustration refer [SAP LUW|http://help.sap.com/saphelp_46c/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/frameset.htm]
Regards
Marcin