‎2007 Feb 02 1:25 PM
Hi Experts
I am using BAPI_EQUI_CREATE_BY_REFERENCE, I need to update certain custom fields in the newly created equipment(BASED ON THE NEWLY CREATED EQUIPMENT NUMBER) <b>before committing the BAPI</b> & block the commit if certain logic fails!.
Can someone please tell me a way to <b><i>access the newly created data by BAPI before committing it</i></b>. Any help in this regard will be generously credited.
Regards
Sudhir
‎2007 Feb 02 1:28 PM
Hi sudhir,
1. After calling the BAPI,
u can use
COMMIT WORK AND WAIT.
regards,
amit m.
‎2007 Feb 02 1:31 PM
Hi Sudhir,
The bapi will not get committed until you use the bapi_transaction_commit.
Before calling the bapi_transaction_commmit , you can check if the bapi was succesful(Based on the return table) and then conditionally commit or rollback using the bapi bapi_transaction_rollback).
Regards,
ravi
‎2007 Feb 02 1:36 PM
Hi sudhir,
this is not possible, not before commit.
Reason is that BAPIs make use of PERFORM ... ON COMMIT. In those forms global tables are evaluated, processed and data gets stored in the database.
You could search for a userexit or badi shortly before data save takes place. At this point you may be able to see the data before they are committed.
Dynamic assign of global BAPI fields might also lead to a result.
Please explain your situation in detail: What (business) process will be controlled by the not-yet-and-maybe-never existing data?
Regards,
Clemens
‎2007 Feb 02 1:40 PM
Its not about commit or rollback guys, I can get the data that was created by the BAPI's return structures, but I need to change certain data before commiting the BAPI. Now how do I access & change the data that will be committed to the database!!??, any thoughts??.
Regards
Sudhir
‎2007 Feb 02 1:43 PM
Hi again,
1. how do I access & change the data
Indirectly, there might be some user-exit or BADI,
which will be called before the transaction is saved,
(either manually, OR either thru BAPI).
2. There we can access/change the data.
3. Otherwise, there is no option.
regards,
amit m.