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

BAPI_TRANSACTION_COMMIT not working in debuging mode

former_member235717
Participant
0 Likes
1,619

Hi All,

I have a inbound proxy which is using BAPI_OUTB_DELIVERY_CREATE_STO  to create delivery for PO and if success I'm using BAPI_TRANSACTION _COMMIT.

However, when I'm testing in ECC (both normal and debugging mode) I'm getting a return error from COMMIT FM saying "Updates was not possible" .

but when the proxy is triggered from third party the delivery was created and successful.

Please let me know the reason for the failure.

After commit work I'm using " WS_DELIVERY_UPDATE " to update the delivery. I'm seeing some issues in this FM, to find out this I need BAPI COMMIT work to be successful in debugging mode.

Thank you!!

6 REPLIES 6
Read only

Former Member
0 Likes
1,389

Hi.

what is the code that you are using with the FM BPI_TRANSACTION_COMMIT ?? post it.

Regards

Miguel

Read only

0 Likes
1,389

I'm passing the PO, line item, quantity, posting date, material , salesunit to it_trans_items.


CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_STO'
               TABLES
                 stock_trans_items = it_trans_items
                 created_items     = it_items
                 return            = it_bapi_return.

             APPEND LINES OF it_bapi_return to it_bapi_return_log.

             READ TABLE it_bapi_return_log WITH KEY type = c_e
             TRANSPORTING NO FIELDS.

             IF sy-subrc <> 0.

             CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                 EXPORTING
                   wait   = 'X'
                 IMPORTING
                   return = it_return_temp.
              endif.


In debugging, this is the error I'm getting in it_return_temp-message = "Updating could not be completed"

Read only

0 Likes
1,389

Hi,

Check use this

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

          DESTINATION 'NONE'

exporting......

Regards

Miguel

Read only

0 Likes
1,389

Thank you for the response!!

Now I don't see any error from BAPI . however, my actualy issue is I'm updating the delivery document by calling ' WS_DELIVERY_UPDATE ' FM. So even now I see the same error - Delivery xxxxxx doesn't exist. This is the same issue I have been seeing even when BAPI commit failed.

Here is the code after commit.

READ TABLE it_created_items INTO wa_created_items INDEX 1.

              wa_vbkok_wa-vbeln_vl  = wa_created_items-deliv_numb.
               wa_vbkok_wa-vbeln     = wa_created_items-deliv_numb.
               wa_vbkok_wa-wabuc     = 'X'.

               CLEAR wa_vbkok_wa-wadat_ist.
               CONCATENATE wa_records_temp-posting_date+4(4) wa_records_temp-posting_date(4) INTO wa_vbkok_wa-wadat_ist.  "posting date

               v_update_delivery     = wa_created_items-deliv_numb. "delivery doc
   *               Call the delivery update FM
               CALL FUNCTION 'WS_DELIVERY_UPDATE'
                 EXPORTING
                   vbkok_wa                 = wa_vbkok_wa
                   synchron                 = 'X'
                   commit                   = 'X'
                   delivery                 = v_update_delivery
                   update_picking           = 'X'
                   if_database_update       = '1'
                   if_error_messages_send_0 = '  '
                 TABLES
                   vbpok_tab                = t_vbpok_tab
                   prot                     = t_prot
                 EXCEPTIONS
                   error_message            = 4.


Initially there wasn't any EXCEPTION statement written, due to this when I get "Delivery doesn't exits" error , the FM terminates and bypass the FM and response message is not triggered.


Is there any other way we could handle the response back or by adding "EXCEPTIONS
                   error_message            = 4." this statement handles the error?


My actual error in production is, sometime the delivery doc is not updated with the picked qnty which is being sent to the FM.We are unable to replicate the issue and the reason is not known since there was no proper error handling for WS_DELIVERY_UPDATE and no response error is triggered in Production system due to which the legacy system fails to get the response back.

Read only

0 Likes
1,389

Swetha,

If you need to commit when in debug mode, use the menu option EDIT->DATABASE->COMMIT. This is just an option while debugging.

Thanks,

Vikram.M

Read only

0 Likes
1,389

Hi,

sorry but those are 2 differents topics, the first u r talking about "BAPI_OUTB_DELIVERY_CREATE_STO" with "BAPI_TRANSACTION _COMMIT" ..did u get a solution? if yes, close the topic and open another with the new issue.

Regards

Miguel