06-13-2007 10:34 AM
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 ????????
06-13-2007 10:36 AM
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
06-13-2007 10:41 AM
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,
06-13-2007 10:43 AM
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
06-13-2007 10:45 AM
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
06-13-2007 10:50 AM
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
06-13-2007 11:11 AM
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 =
06-13-2007 10:39 AM
Hi,
Do not use COMMIT WORK after each BAPI
instead use FM BAPI_TRANSACTION_COMMIT.
Jogdand M B
06-13-2007 10:39 AM
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
06-13-2007 10:41 AM