Skip to Content
avatar image
Former Member

Unable to change User Status in VA02 because of BAPI in MV45AFZZ

Hi All,

Scenario: We want to place a delivery block (Awaiting Inspection) on deliveries when the sales order is set to a certain user status (QA To View). We need to stop certain deliveries from being sent until an additional QA inspection is carried out.

I've created an include in MV45AFZZ-USEREXIT_SAVE_DOCUMENT that places a delivery block using BAPI_OUTB_DELIVERY_CHANGE when the sales document is saved. I've tested this and it works just fine on its own.

The issue has appeared when attempting to invoke this code based on the user status being changed (e.g. Created > QA To View) in VA02:

When I change the status, and select save, VA02 reports that the document has been successfully saved and exits to the selection screen. When I go back into the order header afterwards, the status has not changed and it still displays as Created.

I can change the status to any of the other 3 above and it works fine. The issue only occurs when BAPI_OUTB_DELIVERY_CHANGE is run, as the status change works when I comment it out of my include code.

My code below: All I'm doing before this part is checking the document type, and ensuring the user status isn't already QA To View:

Has anybody come across a similar issue, or can suggest a fix?

Cheers,

Sam

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    Hi All,

    I've managed to 'fix' the issue by just calling FM STATUS_CHANGE_EXTERN after my BAPI call.

    This ensures that the status changes to QAVW as expected, however it doesn't necessarily answer the question as to why the BAPI affects the standard functionality - so I'll leave this unanswered for a while longer.

    Cheers,

    Sam

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Apr 06, 2017 at 02:03 PM

    Hi Sam,

    Issue is with commit statement 'BAPI_TRANSACTION_COMMIT' inside User exit.

    I would suggest to call BAPI function for Delivery change 'IN UPDATE TASK' and update results.

    Thanks

    Mahendra

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 06, 2017 at 08:55 PM

    Hi Sam,

    Can you please try with calling only BAPI for changing OB delivery in regular way. Without addition Update task.

    FM 'BAPI_TRANSACTION_COMMIT' should be commented or not called. SAP standard commit would take care of posting of OB delivery changes.

    Regards

    Mahendra

    Add comment
    10|10000 characters needed characters exceeded