‎2009 Jun 03 4:18 PM
Hi,
I have written a program that updates material characterics using the BAPI's in the title.
I may be having a bit of a slow moment but I don't understand something, if someone could clarify that will be excellent.
1. If a change a material characteristic using BAPI_OBJCL_CHANGE and BAPI_TRANSACTION_COMMIT, the locked entries get deleted from SM12 for every materials that is updated.
2. If I add a radio button to the selection screen and then perform the actions in step 1, the material lock entries remain in SM12 until I exit the program. This of course is not desirable.
The program has a start-of-selection and an end-of-selection.
Any ideas will be appreciated
Regards
J-J
‎2009 Jun 03 4:37 PM
Hi,
I want the record locks to be removed once the BAPI_OBJCL_CHANGE has performed its changes, hence I called BAPI_TRANSACTION_COMMIT.
However the locks don't seem to get removed if the BAPI is called within a Radio button statement
Sample code
Scenario 1
call BAPI_OBJCL_CHANGE
Call BAPI_TRANSACTION_COMMIT
Locks removed
Scenario 2
if RAD1 = X
call BAPI_OBJCL_CHANGE
Call BAPI_TRANSACTION_COMMIT
The locks don't get removed in this scenario
else.
etc....
Regards J-J
‎2009 Jun 03 4:29 PM
Hi,
For the step 1, if there is any commit executed, all the locks will get deleted from SM12.
I didn't get the probelm 2.
If you want to keep the locks, don't call commit work untill unless, you are saving it. May be you can write one User command for save and on event at user cmmand, you can call the FM for BAPI_COMMIT.
With regards,
Vamsi
‎2009 Jun 03 4:37 PM
Hi,
I want the record locks to be removed once the BAPI_OBJCL_CHANGE has performed its changes, hence I called BAPI_TRANSACTION_COMMIT.
However the locks don't seem to get removed if the BAPI is called within a Radio button statement
Sample code
Scenario 1
call BAPI_OBJCL_CHANGE
Call BAPI_TRANSACTION_COMMIT
Locks removed
Scenario 2
if RAD1 = X
call BAPI_OBJCL_CHANGE
Call BAPI_TRANSACTION_COMMIT
The locks don't get removed in this scenario
else.
etc....
Regards J-J
‎2009 Jun 03 4:44 PM
Hi,
Try:
CALL FUNCTION function IN UPDATE TASK
COMMIT WORK
Regards,
Gilberto Li