How to block the creation of a Sales Orders without a linked Purchase Order

Hi. I'm trying to block the creation of a Sales Order that doesn't have a linked Purchase Order. The first thing I did is using the SBO Transaction Notification as follows:
IF  @transaction_type = 'A' AND @object_type='17'
BEGIN
     IF (SELECT PoPrss FROM ORDR WHERE DocEntry = @list_of_cols_val_tab_del) = 'N'
     BEGIN
          SET @error = 1
          SET @error_message = 'Purchase Order Missing...'
     END
END
This works good. I create the Sales Order, I tick the purchase order field on the logistics tab, I click Add, and then the purchase order window appears...
Then, the problem begins... If I click the Cancel button, the purchase order is obviously not created, but the Sales Order is created.
Can someone tell me how to block the creation of the sales order If the user press the cancel button on the purchase order window (and the purchase order is not created)
As far as I can see, after clicking the add button in the sales order document, the Sales Order is created on the DB. If there's no way of blocking the creation of the Sales Order, can I avoid closing the purchase order window by the SBO_TransactionNotification? (if the purchase order has not been created)
Thanks...

Hi Yail,
I think you can't close the purchase order with the stored procedure.
Try to catch the Event when the user click on Cancel button.
So you can list the vents with event logger : https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ede3be37-0e01-0010-1883-cd1b5293473e
You can block the cancel button and force the user to create the purchase order.
Hope i help you
Best regards
Michael

Similar Messages

  • How to block the Creation of Mulitple Excise Invoice in J1IS

    Hi Sap Gurs,
    Can any tell me how to block the System allowing  to Create One more Excise Invoice in J1IS against Same GI Material Document no (Ref Trans Type:MATD) for Outgoing Materials ie:Stock Transfer from One Plant to onother Plant by Mvt Type 351(Single Step Procedure)
    In SD, System is not allowing to Create One more Excise Invoive against One Billing Document Untill we Cancell the same.
    I want to make it like same for the above Issue.
    Pls check it in your system and give a Feed Back.
    Thanks in advance.
    Bye
    Sathish

    Hi Yail,
    I think you can't close the purchase order with the stored procedure.
    Try to catch the Event when the user click on Cancel button.
    So you can list the vents with event logger : https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ede3be37-0e01-0010-1883-cd1b5293473e
    You can block the cancel button and force the user to create the purchase order.
    Hope i help you
    Best regards
    Michael

  • Block the creation of planned order

    Dear experts
    How can I control the creation of planned order? I want to block the creation of planned order if the BOM or routing is not exist.
    BRs

    Hi,
    I think this can be done using 'Material status' try the following and let me know if it works.
    Create a new material status in transaction OMS4 (like R1 - "Created but BOM and Routing not maintained" )and in the details screen select Option "B" for MRP messages.
    You designate a material as a "R1 -Created but BOM and Routing not maintained" In the master record.
        MRP                          "B" = warning
    Please try this and let me know the result.   
    Regards,
    Prakash

  • How to Block the material

    Hi friends,
    How to block the material ,
    what are the implecations if we block a material?
    Regards
    Krishna

    Hi,
    The best way is to keep the materail status with deleted or blocked for puchase / sales and need to maintain in the materail master.
    You cannot delete the material from material master until archiving but you can block that material for any procurement
    Goto Basic data 1
    X-plant matl status -
    01 Blocked for procment/whse
                                           02 Blocked for task list/BOM
                                           10 Blocked for MRP
    Select any one.
    Valid from  -
    Here you enter valid date from which the material should be blocked.
    So from this your material will be blocked for any PR/PO/any transactions related to Procurement
    BR,
    Krishna

  • How to block IT Creation in PA30 ??

    Hi Everyone!!
    I would like to block the creation of an occurrence in Pa30. And authorise the creation only in a measure.
    Do you have any idea how can it be achieved?
    Any help would be greatly appreciated.
    Have a great day

    Hi Quentin,
    I assume that you've found the user-exit for PA30. Now the code you can place there is as follows.
    *****************Begin of code by Sam********
    DATA: GS_PERNR LIKE P9020-PERNR,
          GS_PERNR1 LIKE P9020-PERNR,
          GS_CNT TYPE I.
    To check Transaction Code.
    IF SY-TCODE = 'PA30' and INNNN-INFTY = '0000'.
      MOVE INNNN TO I0000.
    To check whether - Creation of new record.
      IF IPSYST-IOPER = 'INS'.
    To check for user-id. 
         IF SY-UNAME <> 'SAMUEL_D' AND SY-UNAME <> 'HRADMIN'.
            MESSAGE E000(ZH) WITH
            'You are not authorized to create a new record'.
         ENDIF.
      ENDIF.
    ENDIF.
    *********END OF CODE**********
    Put this code in the user exit for PAI of PA30. It'll work perfectly. In this case, you can also store the user-ids in a ZTABLE and check the same from it rather than hardcoding it in the program.
    Hope this helps. Kindly award points if this was helpful for u.
    Cheers,
    Sam.

  • How to block the invoice ,if the GR qty is in QA stock

    HI all,
    how to block the invoice,if the GR stock is in QA tock?
    But i have maintianed quality control key wiht the parameter like ivoice block and maintained in the respective material master data, even though invoice is not blocking?
    plese tell me is there any seetings required.
    thanx in advance.
    Regards
    Srinivas

    Hi,
    It is not the total invoice which is equal to zero but only one post.
    As I explained it at first the problem is the following one:
    In the rules of copy we use the field " Pricing type " with the value " C = Copy manual pricing elements and redetermine the others ".
    he order is complete and the price of the post is not equal to zero.
    +During the invoicing the system makes a new search for the prices in the tables of conditions.
    If the condition does not exist in the date of invoice the post takes the zero value.
    I look for a solution to block the creation of the invoice if a post only is equal to zero after the updating of the prices.
    Thanks
    Frédéric

  • How to block a article to make sales order & STO

    how to block a article to make sales order & STO.
    actually one new article has been created and listing has been done only for DC, but one store is able to make sales order for this article. how can i block this article to be used by other sites except DC?
    thanks & regards'
    manoj gupta

    Dear Manoy Gupta,
    Go to Transaction MM02 -> Basic data 1 -> X-plant matl status :
    01 Blocked for procment/whse
    02 Blocked for task list/BOM
    10 Blocked for MRP etc.
    Select any one.
    Valid from  - Here you enter valid date from which the material should be blocked.
    So from this your material will be blocked for any PR/PO/any transactions related to Procurement
    Hope this will help.
    Regards,
    Naveen.

  • Blocking the Creation of PO in Service Order

    Hello SAP folks,
    I have got an issue where I have to block the Creation of Purchase Requisation Number(BANFN) which is generated  in the background after the creation of the Service order(IW31)  I have tried the user exit EXIT_SAPLCOIH_009 but while coding i could'nt trace the field which is holding the value of PR number.Please let me know is it possible to stop the creation of PR if Yes, Please guide me in this issue in terms of coding.
    Thanxs in advance.
    Regards,
    Indira

    Hi Indira,
    Try these User Exits.
    CNEX0013  Order: Cust. enhancement: Default item category comp. a
    CNEX0026  Customer enhancement for general inspection of material
    CNEX0027  Customer enhancement: Plant, storage loc. finding for c
    IWO10004  Maintenance order: Customer check for order completion
    IWO10005  Maintenance order: Cust.-specif. determination of profi
    IWO10006  Maint. order: Fcode exclusion through cust. enhancement
    IWO10007  Maint.order: Customer enhancement - permits in the orde
    IWO10008  Cust. enhancement: Determination of tax jurisdiction co
    IWO10009  PM Order: Customer Check for 'Save' Event
    IWO10010  Maint. order: Cust. enhancement for determining WBS ele
    IWO10011  Maint. order: Customer enhancement for component select
    IWO10015  Maintenance order: F4 Help for user fields on operation
    IWO10016  PM Order: Cust. enhancement to check operation user fie
    IWO10017  Determine external order number by customer logic
    IWO10018  Maintenance order: User fields on order header
    IWO10020  Maintenance order: Automatically include task list
    IWO10021  Automatic task list transfer when creating order from n
    IWO10022  Determine calendar from user exit
    IWO10023  Service order: Change header data for advance shipment
    IWO10024  Service order: Changes to items for advance shipment
    IWO10025  PM/SM order: Finding responsible cost center
    IWO10029  Inclusion of bill of material in PM/SM order
    IWO10030  Preset Fields for Event Object
    IWO10031  Hide personnel number in PM/SM order
    IWO10033  Customer-Specific Authorization Check Maint./Service Or
    IWO10034  Operation status based on the status of capacity reqs
    Regards,
    Vijay

  • How to clear the delivery group in sales order?

    Dear All: 
          My sales order is auto created from CRM by BAPI, but in vbap table, the GRKOR field is 001, only one order ,  how to clear the delivery group in the sales order ?
    Regards
    Peter.

    Thread Locked - Reason Duplicate Post
    How to clear the delivery group in sales order?
    Please dont post the same query twice.  Continue all your queries in one thread
    G. Lakshmipathi

  • How to change the Profit Center in Sales Order

    Hi Gurus,
    Previously they setted the profit center (YB999) in sales order, now i want to change the profit center and need to give the amount into this profit center 100500.
    So, could you guide me how to change the profit center in sales order.
    Thank you for your replies.....
    Thanks & Regards,
    Chandrababu.B
    Edited by: Chandrababu Naidu on May 25, 2011 12:44 PM

    Hi
    If this SO is processed partially - i.e. transactions happened - You cant change it
    You can use ABAP and change it in Debug mode, but not advisable... Better to short close the SO and open a new SO for Balance qty
    br, Ajay M
    Edited by: Ajay Maheshwari on May 25, 2011 5:10 PM

  • How to pack the More than one sales order delivery qty in one packing

    Hi Folks,
    How to pack the more than one sales order quantity combinely during packing?
    Thansk in advance and points wil be rewarded for the reply.
    Best Regards
    Srinivas

    Packing is done during Delivery.
    In Sales order also Packing function is available but as a Packing proposal.
    So actual packing is done in Delivery.
    When you process several sales orders together, the sales order items having same Ship-to-party, Shipping point, Route, Delivery due date & Incoterm are combined into one Delivery in the standard system.
    In the delivery overview screen,do the picking by subsequent function rom the menu bar, you will get a button "PACK", click on this system will take you to the packing screen.
    In the packing screen, give the packaging mterial number, select the materials to be packed, select the packaging material also and the click on the "PACK" button.

  • How to make the status of a sales order complete of which PART DELIVERY

    How to make the status of a sales order complete of which PARTIAL DELIVERY has already done. <b>(Assigning rejection status not accepted)</b>

    Hi Gyana
    There is no document with me. But I can confidently say that because I am using this functionality.
    In my case I have created a Order Reason as "Short Closed". once you short close this order only the balance quantity gets rejected (provided you have already made previous delivery and PGI).
    Try it in one of your test clients if you have. Once it is short Closed it wont also show in the orders due for processing in Production.
    Also you can generate reports based on this if your customer wants to know how many order he has short closed, qty of item short closed etc.
    Try it.
    Rgds
    Sunil

  • How to block the cost center

    Dear Guru's
    Can any tell me how to block the cost center, can we detele which is having values. can we delete which is not having values
    Regards
    Chandra Sekhar Reddy.P

    Hi,
    Once you post actual values or any planning exists on this cost center you cant delete.
    To ristrict posting to cost you have two options.
    1.You can change validity period.
      change  end from 12/31/9999 to what ever date you want to stop posting(e.g. as of today 10/23/08)
    2. lock all postings to cost center on Control data tab in KS02.
    Thanks,
    Rau

  • How to block the GR against a PO

    Hi All,
    how to block the GR against a perticular PO item or full PO.
    I use "Delivery Complete" option in "Delivery" tab, but still it allow me to make the GR against the PO.
    I am waiting for the quick reply.
    Thanks & Regards
    Pankaj Garg

    delivery complete indicator willnot help u fully.what u can do is after selecting the delivery complete indicator change the quantity of the PO to what u have already received i.e. if ur po has 10 pcs and u have already received 4 pcs and dont want to receive any further quantity then change the PO quantity to 4 pcs.
    Again if u havent received any quantity against the PO then u can select the line items and select the block (key like) indicator or delete (dustbin like) indicator.
    regards,
    indranil

  • How to find the creation date for a released requests..

    Hi friends ,
    In se09 tcode , we a date which represents the last changed date .. Now , for a particular Released request i want to find out the Creation date for it . How can i find it . I checked the tables like E070create there also we have requests that not released yet , i have also checked se03 and other tcode and a fn mo dules like TR_READ_GLOBAL_INFO_OF_REQUEST .
    So how to find the creation date for a released requests. Iam waiting for ur inputs..
    Thanks in advance..

    hi,
    Did u found the way to get the request creation date?
    I also need the same information.
    This needed for audit purpose........so it is must.
    Please help me in this.
    Best regards,
    vinod

Maybe you are looking for

  • Problem during ORACLE 9.2.0 on HP-UX 11.11

    Hi, I am installing Oracle 9.2.0 on HP-UX 11.11. During the start of the isntallation in File locations Destination and Path" in Destination i write "ORACLE_HOME" in path i write " /opt/oracle/product/9.2.0" Now when i write product in path it change

  • Transfer itunes to a new laptop?

    I just purchased a new Gateway laptop and a new 6th generation iPod classis.  How do I transfer my iTunes and everything on it to my new laptop and my new iPod???  Thank you VERY much!

  • Old games on Lion

    I'm sorry, I know there's already a thousand discussions about this but I had to get it off my chest. The question is just rhetorical. Lion does not support PowerPC applications, and Rosetta has been stopped after SL. Now, what is bugging me is that

  • Re: Help me Please!! Getting OutOfMemory Error!!

    if you want to read the whole file at once, you may give the virtual machine some more heap memory by adding the option -Xmx. for example "java -Xmx128m ..." will set the max heap size to 128 mb. the default value is 64mb, thats why 80 mb is to big.

  • Audio problems - soft sound, no line-out detected

    ok, so a number of things went wrong with my computer. it was working perfectly, and i opened garage band up to record music, and all of a sudden, no sound was coming out. at this stage i was using the line-out to my stereo amp. it also wouldnt let m