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: 

how can I create a work order within user exit QQMA0014

Former Member
0 Kudos
314

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

5 REPLIES 5

Former Member
0 Kudos
115

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


0 Kudos
115

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?

0 Kudos
115

"BAPI_TRANSACTION_COMMIT" instead of  direct Commit Work .

0 Kudos
115

http://scn.sap.com/thread/446326

Please check the Comment of "Clemens".

0 Kudos
115

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