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: Error while updating same material

Former Member
0 Kudos

Hi

I'm updating the same material with different values each time.

I get an error which basically states that I'm currently in change mode/locking material '111' and that i can't update the last 2 records.

What would be the best way of ensuring that i only process/update the next record after the record/update lock has been removed from the material.

I could use the statement "wait up to 2 seconds"


"internal table rec.
Matnr   Week      Value
111       200701    12
111       200702    12
111       200703    12

2 REPLIES 2

Former Member
0 Kudos

use fm :BAPI_TRANSACTION_COMMIT after bapi call

0 Kudos

Sreejith

I'm using it. When i execute the job in the background, i still get record locks.



loop at rec.

perform populate_requirements_item.
perform populate_requirements_schedule.

call function 'BAPI_REQUIREMENTS_CREATE'
  exporting
    requirements_item            = w_bapisitemr
    requirement_param            = param
  tables
    requirements_schedule_in     = i_requirements_schedule_in
    return                       = i_bapireturn1.


call function 'BAPI_TRANSACTION_COMMIT'
 exporting
   wait          = 'X'.
                                                                                wait up to 2 seconds.

endloop.