Application Development and Automation 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: 
Read only

Problem creating asset with BAPI

Former Member
0 Likes
1,486

Hi all,

I hope you can assist with this.

I have written a function module which in turn calls BAPI_FIXEDASSET_CREATE to create an asset. I have executed it via SE37 and it works fine. The code has gone to a client and they have incorporated this function module into a program that they have written themselves.

This program runs in the background and for some reason fails to create the asset.

A look at the logs via SLG1 reveals a message to the effect that the asset was created temporarily as follows:

"Asset 000040001299 with sub-number 0000 was created in company code Asset and was temporarily stored internally.

Procedure

The asset will be transferred to the database during the next COMMIT."

The reference to the commit confuses me as I have a COMMIT WORK AND WAIT at the end of my function module after the BAPI has been executed.

I logged onto the client's system and ran the function module via se37 with the relevant parameters and it worked fine. However this was in the foreground.

So it does look like there is some issue with background processing but I have an explicit COMMIT and it seems to be being ignored.

Any advice gratefully received.

Alistair

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
966

Hi,

Probably in your case, It is an RFC call and database is not getting committed.

If you are trying to make changes in the remote system, then use BAPI_TRANSACTION_COMMIT with wait parameter value 'X'.

If it is happening on the same system, then COMMIT WORK and WAIT should work.

Try using BAPI_TRANSACTION_COMMIT only..

Thanks,

Kartavya.

2 REPLIES 2
Read only

Former Member
0 Likes
967

Hi,

Probably in your case, It is an RFC call and database is not getting committed.

If you are trying to make changes in the remote system, then use BAPI_TRANSACTION_COMMIT with wait parameter value 'X'.

If it is happening on the same system, then COMMIT WORK and WAIT should work.

Try using BAPI_TRANSACTION_COMMIT only..

Thanks,

Kartavya.

Read only

Former Member
0 Likes
966

Turns out that it does work and the client was doing something which was preventing the commit.

Thanks for your help.