Skip to Content
-3

How we can block or stop order being saved if stock not available

How we can block or stop order being saved if stock not available

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Mar 09 at 02:50 PM

    Hi Ravi,

    The standard SAP does not meet this requirement. That is why, if there is not sufficient stock, creation of sales order could be prevented via modification before save it. Something like below illustrated code parts could be written.

    Include: MV45AFZZ

    Form: USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOCUMENT

    Data lv_labst like labst.

    LOOP AT XVBAP.

    Select labst from MARD into lv_labst

    where matnr EQ xvbap-matnr AND

    werks EQ xvbap-werks AND

    lgort EQ xvbap- lgort.

    IF lv_labst LT xvbap-kwmeng.

    Message '' There is not sufficient stock etc" type 'E'. ** or a message could be created via SE91**

    ENDIF.

    ENDLOOP.

    BR

    Engin Karaboğa

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 09 at 04:42 PM

    This whole intention has no logic in a sense of a ERP system.

    How would MRP run be enabled to create requirements for production or procurement if no demand was entered?

    And even if you do planning manually, how would a planner know what he has to produce if there are no sales orders visible?

    And how long could you hold the customers order unprocessed on a CSR desk before the customer gets impatient and is looking for another supplier?

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08 at 10:23 AM

    Hi Ravisankar,

    Your requirement cannot be fulfil by standard solution because system checks the quantity only when you are posting the material in delivery, so you have to enhance the code here with your ABAP team through user exit in VBAP table.

    Thanks,

    Add comment
    10|10000 characters needed characters exceeded