2012 Dec 27 11:00 AM
hello all
in the user exit QQMA0014 i am trying to create a refurbishment work order using bapi BAPI_ALM_ORDER_MAINTAIN .
this bapi contains a COMMIT WORK statement which is not allowed in the user exit. I browsed around and saw a few answers on commit work in user exits but in this case, since the work order is created in the user exit, how can the commit work be performed "outside" of it? I can copy the bapi and change it avoiding the COMMIT WORK statement but what to write so that the Work order will be inserted in the DB at the right time?
thanks
Alisa
2012 Dec 27 11:33 AM
Hi,
SAP has its own COMMIT statement while executing the standard transactions , you can't use Commit statement in exit/badi .
Please create a Z -FM using "BAPI_ALM_ORDER_MAINTAIN" ,use Commit Statement in ur Z FM and call your Z - FM in user exit QQMA0014 .
Note : Z- FM will be called in the user exit, but it will be executed after the COMMIT statement.
Regard's
Smruti
2012 Dec 27 11:55 AM
thanks for the reply: with this solution it means that i will not have a work order until it is executed and i need it before: the bapi does create a number but it doesn't insert it in the DB until commit. I need the work order number, even if the commit is done later. how can i create all the steps of the bapi until commit and perform the commit later?
2012 Dec 27 12:39 PM
2012 Dec 27 12:59 PM
http://scn.sap.com/thread/446326
Please check the Comment of "Clemens".
2012 Dec 27 2:01 PM
yes i have already seen that but it was not clear to me how to perform this because i need the creation of the order in the user exit and the commit outside....and i don't know how to achieve that