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: 

BAPI_OBJCL_CHANGE and BAPI_TRANSACTION_COMMIT

TJRP
Participant
0 Kudos

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

1 ACCEPTED SOLUTION

TJRP
Participant
0 Kudos

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

3 REPLIES 3

former_member219399
Active Participant
0 Kudos

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

TJRP
Participant
0 Kudos

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

Former Member
0 Kudos

Hi,

Try:

CALL FUNCTION function IN UPDATE TASK

COMMIT WORK

Regards,

Gilberto Li