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: 

Create Multiple Assets With Single Commit

i_elsayed
Explorer
0 Kudos
512

I'm Trying to create multiple assets using BAPI BAPI_FIXEDASSET_CREATE1 like below

Loop at itab.

call BAPI_FIXEDASSET_CREATE1

append it_log.

Endloop.

then i show all return results in alv and if there is no error i show button to post that runs BAPI_TRANSACTION_COMMIT

but the problem is that it commits the only last asset not the all assets , so please help .

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos
442

Check your program again, there's NO SURPRISE with commit and rollback. What you describe could happen ONLY if a rollback was done. Commit works on ALL preceding updates (since last commit/rollback).

0 Kudos
442

I Checked Again , i'm sure that that there is no commit neither rollback , but i noticed by using tcode sm50 that all db updates are cleared after calling the log screen once it is appeared so it isn't supposed to post the last one also .

0 Kudos
442

If you use the SQL trace, you will see that displaying a screen does an implicit database commit, it's why.

raymond_giuseppi
Active Contributor
442

Not sure, but the dynpro, in the middle of BAPI executions, would trigger some implicit database commit that would break your list of BAPI call.

Could you

  • Execute the BAPI in another LUW (e.g. CALL FUNCTION ... DESTINATION NONE) insure to keep the session alive
  • Execute first the BAPIs in test mode, and then execute them in standard mode and COMMIT them