2009 Apr 07 3:02 PM
Hello,
i have a problem in a program and i don´t know how to solve it. I´m using BAPI_CUSTOMERQUOTATION_CHANGE to modify a quotation. The Bapi works perfectly when i debug the code, but when I delete the breakpoint, the bapi doesn´t work.
Does anyone knows what can i do?
Thanks!!!
2009 Apr 07 3:05 PM
Hi,
try to use FM BAPI_TRANSACTION_COMMIT and set the parameter wait.
Regards,
Leo.
2009 Apr 07 3:05 PM
Hi,
try to use FM BAPI_TRANSACTION_COMMIT and set the parameter wait.
Regards,
Leo.
2009 Apr 07 3:31 PM
This might be because when you see in debugging you see the internal tables directly..
But when you run it you check in database tables...
So you might have not written commit work at the end of Bapi,
Regards,
Lalit Mohan Gupta.
2009 Apr 07 3:39 PM
Try using BAPI_TRANSACTION_COMMIT after BAPI_CUSTOMERQUOTATION_CHANGE . It will work.
2009 Apr 07 3:50 PM
While using bapi transaction commit,
set the parameter WAIT = X.
Are you using the bapi in a loop?
Then for wait problem the problem happens.
Thanks
2009 Apr 07 4:00 PM
I think i´ve solve the problem locating some "wait up to 1 seconds" instruction just before each bapi call.
Thank you!
2009 Apr 07 5:07 PM
Wait upto 1 seconds works for some particular cases with increasing load you may require more time to wait.
Better handle the time dynamically
CALL FUNCTION ' BAPI***** '
Check return table for errors
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
constant_max_time = 8. ** maximum seconds of looping
w_counter = 0. ** initialize counter
WHILE w_counter < constant_max_time.
w_counter = w_counter + 1.
WAIT UP TO 1 SECONDS.
Now check for exit conditions, like object is unlocked, table is updated, etc
IF <example: object is unlocked>.
EXIT.
ENDIF.
ENDWHILE.
IF w_counter = constant_max_time.
Sanity check:
throw an error if the update was not completed within the max allotted time
to allow to investigate the possible causes of exceptional delay
ENDIF.
Usuallly with z-bapi-s and some standard bapi-s this happen.