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 with bapi

Former Member
0 Likes
900

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!!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
865

Hi,

try to use FM BAPI_TRANSACTION_COMMIT and set the parameter wait.

Regards,

Leo.

6 REPLIES 6
Read only

Former Member
0 Likes
866

Hi,

try to use FM BAPI_TRANSACTION_COMMIT and set the parameter wait.

Regards,

Leo.

Read only

Former Member
0 Likes
865

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.

Read only

0 Likes
865

Try using BAPI_TRANSACTION_COMMIT after BAPI_CUSTOMERQUOTATION_CHANGE . It will work.

Read only

Former Member
0 Likes
865

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

Read only

0 Likes
865

I think i´ve solve the problem locating some "wait up to 1 seconds" instruction just before each bapi call.

Thank you!

Read only

0 Likes
865

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.