Skip to Content
avatar image
-1
Former Member

Sales order confirmation output not to be triggered if all the line items are unconfirmed with 0 qty

Dear All,

We implemented the below routine but when the BESTK=A, the routine is not getting triggered in the debugging.May be we need to make some changes in the routine, please suggest.

FORM KOBED_9XX.

TABLES: vbap.
data ws_vbap LIKE vbap.
SY-SUBRC = 0.
IF KOMKBV1-BESTK EQ 'A'. "Order confirmation status
clear ws_vbap.
SELECT SINGLE * INTO ws_vbap
FROM VBAP WHERE VBELN = KOMKBV1-VBELN
AND KBMENG NE 0.
IF SY-SUBRC NE 0.
SY-SUBRC = 4.
EXIT.
ENDIF.

ENDIF.

Thank you,

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 20, 2017 at 05:37 PM

    Kindly do some home work before posting questions on SCN. You're saying "the routine is not getting triggered in the debugging" but then asking if changes could be needed inside the routine. How does that make sense? If the whole routine is not triggered then the problem is clearly not inside it. Could it be that the routine is not even assigned in the configuration? And are you actually debugging output? It runs in a separate process and you likely won't see it if you just start debugger in the order transaction. Googl output debugging.

    The code inside the routine seems to do the exact opposite of what stated in the title as a requirement. But it should become more clear in debugger.

    Add comment
    10|10000 characters needed characters exceeded

    • Then the statement "routine is not getting triggered" is incorrect. It's the specific code fragment that is not executed, which is different.

      I've never had such requirement before but, as mentioned elsewhere in this post, SELECT does not seem a suitable option in VA01. I've just checked and requirement is triggered before the update process (doesn't seem to be triggered again afterwards). You can try to store some value in memory or add a custom field to KOMKBV1. An additional user exit would be needed in both cases.

  • Mar 20, 2017 at 03:36 PM

    Hi,

    In which transaction are you trying this? It does not work with VA01 because, before the sales order is saved, KOMKBV1-VBELN does not contain any sales order. This routine will get triggered only in VA02.

    Also, you need to query VBEP table to check the schedule lines

    Thanks,

    Shanthi Kumar Juluru

    Add comment
    10|10000 characters needed characters exceeded