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: 

changes + commit work ...Strange behaviour

Former Member
0 Kudos

Hello Friends,

I am facing very strange behaviour, Actually I am dooing following

creating new operation in service order ( iw72 )

creating new document

attatch this newly created document to this operation

and for this purpose, I have to use a couple of FM/BAPIS, insert and update dict tables:

Now what strange behaviour is when ever in a particular order I tried to create the operation it does not work, however after few tries ( 2nd or 3rd time ) it really creates the operation + document + prts etc.... ( like actually expected )...

I have no clarification why one time does not work, and other time works !!!!

Getting mad

Regards,

PS: after each bapi and updating and inserting I am doing commit work, so there are around 7 or 8 commit works in program ? can it be a reason ????????

9 REPLIES 9

gopi_narendra
Active Contributor
0 Kudos

Hi Shah,

In addition to that after the commit BAPI use the Wait command to wait for 5 seconds or some time accordingly.

for Ex : wait up to 4 seconds.

Regards

Gopi

P.S: Make sure u use the BAPI_TRANSACTION_COMMIT after each BAPI call

Message was edited by:

Gopi Narendra

0 Kudos

Hi Gopi,

wait should resolve the issue ? I mean what I do not understand why it works after a couple of tries, and then keep working on..... but next day when I take another cs order, and try first ... do not work, however again after couple of tries works fine.....

regards,

0 Kudos

hi,

in help its written :

"WAIT should only be used with asynchronous Remote Function Calls"

and I am not using asynchronous Remote Function Calls

Regards

0 Kudos

Yes, It will resolve the issue, the time taken to execute the next statement after the commit statement is not sufficient to update all the tables thats the reason WAIT statement is needed in addition to the BAPI_TRANSACTION_COMMIT

Never use a Commit statement insted use the BAPI : BAPI_TRANSACTION_COMMIT always

Regards

Gopi

<b>Just add the wait statement, this solves</b>

Message was edited by:

Gopi Narendra

0 Kudos

but I have gone through a couple of fourms, and there they wrote,

there is actually no difference between commit work, or this bapi "BAPI_TRANSACTION_COMMIT"...

And I am not using asyn bpai, and in help they wrote wait should use with asyn bapis ?

Regards

0 Kudos

Hi,

Actually there is a difference! You should use BAPI_TRANSACTION_COMMIT with active wait.

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = c_cons_x

  • IMPORTING

  • RETURN =

Former Member
0 Kudos

Hi,

Do not use COMMIT WORK after each BAPI

instead use FM BAPI_TRANSACTION_COMMIT.

Jogdand M B

former_member196280
Active Contributor
0 Kudos

The problem is tables are getting locked, wait until everything is save.. Use FM for delay or use WAIT.

I guess it will solve your problem.

Reward points if useful.

Regards,

SaiRam

former_member378318
Contributor
0 Kudos

Hi,

Try using the function BAPI_TRANSACTION_COMMIT.

Cheers