‎2007 Sep 20 11:47 AM
Hi,
can you show me an example of "perform on commit" with variables.
‎2007 Sep 20 11:52 AM
Hi
This is used to commit the changes to the database
when you write some code in the PERFORM ..ON COMMIT
subroutine, all the statements reagrding database update are committed only when you write explicit COMMIT WORK and for Roll back ROLLBACK has to be used.
Regards
vasu
‎2007 Sep 20 11:53 AM
Hi,
check the below link..
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/commit.htm
Reward points if u find useful..
Regards,
Nagaraj
‎2007 Sep 20 11:54 AM
hI
LUW is a logical unit of work and is the span of time
during which any transaction is updated in all or nothing
manner i.e they've been updated completely ro commited or
thrown away(Roll Back). An Luw is nothing but a database
LUW in database is updated from one screen to another
screen within a transaction which does not last longer and
in SAP LUW, the system perfoms database from one
transaction to another and this last longer and is usually
terminated by the programmer by issuing Commit work
statement.
REWARD I FUSEFULL
‎2007 Sep 20 11:55 AM
hi helios,
change this code according to your req and try.
perform update_zproc_files .
form update_zproc_files .
wa_zproc_files-mandt = sy-mandt.
wa_zproc_files-batch = v_batch.
wa_zproc_files-rcvdt = v_rcvdt.
wa_zproc_files-totdoc = v_totdoc.
wa_zproc_files-totamt = v_totamt.
wa_zproc_files-processdate = sy-datum.
wa_zproc_files-processtime = sy-uzeit.
append wa_zproc_files to i_zproc_files.
clear wa_zproc_files.
insert zproc_files from table i_zproc_files.
if sy-subrc eq 0.
commit work.
endif.
refresh i_zproc_files.
endform. " update_zproc_files
<i><b>Reward points if useful </b></i>
‎2007 Sep 20 11:56 AM
Hi,
PERFORM ON COMMIT routines are not executed in the dialog module.
You must ensure that any subroutines called using ON COMMIT can be delayed until the next COMMIT WORK in the calling program. Remember that the global data of the dialog module is destroyed along with the internal session when control returns to the calling program. Consequently, subroutines called using PERFORM ON COMMIT must not use this global data.
The statement PERFORM ON COMMIT calls a subroutine in the dialog work process. However, it is not executed until the system reaches the next COMMIT WORK statement. Here, as well, the ABAP statement COMMIT WORK defines the end of the SAP LUW, since all statements in a subroutine called with PERFORM ON COMMIT that make database changes are executed in the
database LUW of the corresponding dialog step.
The advantage of this bundling technique against CALL FUNCTION... IN UPDATE TASK is better performance, since the update data does not have to be written into an extra table. The disadvantage, however, is that you cannot pass parameters in a PERFORM... ON COMMIT statement. Data is passed using global variables and ABAP memory. There is a considerable danger of data inconsistency when you use this method to pass data.
You can also put the CALL FUNCTION IN UPDATE TASK into a subroutine and call the subroutine with:
<b>PERFORM SUBROUT ON COMMIT.</b>
If you choose this method, the subroutine is executed at the commit. Thus the request to run the function in the update task is also logged during commit processing. As a result, the parameter values logged with the request are those current at the time of the commit.
Ex.
a = 1.
PERFORM F ON COMMIT.
a = 2.
PERFORM F ON COMMIT.
a = 3.
COMMIT WORK.
FORM f.
CALL FUNCTION 'UPD_FM' IN UPDATE TASK EXPORTING PAR = A.
ENDFORM.
In this example, the function module UPD_FM is carried out with the value 3 in PAR. The update task executes the function module only once, despite the two PERFORM ON COMMIT statements. This is because a given function module, logged with the same parameter values, can never be executed more than once in the update task. The subroutine itself, containing the function module call, may not have parameters.
Regards,
Bhaskar
‎2016 Jun 17 12:12 PM
‎2007 Sep 20 11:59 AM
can i put this?:
perform update_db on commit using var1 var2.
‎2016 Jun 17 12:13 PM
No. When using on commit sufix you can no longer set parameters. You must store them in an other way (as decribed before) to be able to access them when the perform is called.
‎2016 Jun 17 12:14 PM
‎2019 Dec 02 4:23 AM
Error : E-mail Status is Still no Entry in Queue
I solved the issue using the send mail perform routine before the update perform routine.
I was getting the same issue when i was sending the mail "PERFORM send_email" after DB update "PERFORM update_data.".
Two things i did.
a. Use of commit after send_mail
b. send mail before data base update .
This solved my issue.I am attaching the screenshot. Hope it helps.
Thank you
JP

