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 updating DB table in using BAPI

Former Member
0 Likes
1,003

HI,

The code below does not update the DB table even if the commit work is executed... is there something wrong or missing??? Thanks a lot!

  • Technically complete process Order

CALL FUNCTION 'BAPI_PROCORD_COMPLETE_TECH'

IMPORTING

return = i_messages

TABLES

orders = i_orders.

IF i_messages-type NE c_error.

REFRESH i_messages3.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

IMPORTING

return = i_messages3.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
641

Hi this is your code right.

You have to check the return table not messages.

Check the return table is there any message type is there with 'E' .

if it is there then the commit work won't give the result in fact the BAPI function is not executed successfully.

If you got any Error message in return table please have a look into that table errors and take the necessary action.

Pass the required paramaters for the BAPI function module.

Regards,

Madan.

3 REPLIES 3
Read only

Former Member
0 Likes
642

Hi this is your code right.

You have to check the return table not messages.

Check the return table is there any message type is there with 'E' .

if it is there then the commit work won't give the result in fact the BAPI function is not executed successfully.

If you got any Error message in return table please have a look into that table errors and take the necessary action.

Pass the required paramaters for the BAPI function module.

Regards,

Madan.

Read only

Former Member
0 Likes
641

Check the value of i_messages3 after execuing each FM, if it executes sucessfuly database is bound to update

Regards

Bikas

Read only

0 Likes
641

Hi,

That was also my thinking... that the commit work and wait should work to update the database... but this was not the case...

The bapi sometimes work,, sometimes not... though no error is generated...

Is it due to the sequence of BAPIs used?? since Im using 3 BAPI's:

BAPI_PROCORD_CREATE

BAPI_PROCORDCONF_CREATE_HDR

BAPI_PROCORD_COMPLETE_TECH

Thanks a lot!