SP for Validating BOM & Production Order item wise

Dear Experts,
                    Here I am validating the Production order  items  with BOM for the same items, any addition or deletion in production order should not be allowed. Hence the production order should consist of same items what it has in BOM. But below the my query is allowing this scenario. Kindly help me to achieve the same..
Query Follows :
@object_type = '202' and @transaction_type in ('A','U')
if exists (SELECT distinct 'error'
FROM OITT A INNER JOIN ITT1 B ON A.Code = B.Father
LEFT JOIN OWOR C ON C.ItemCode = A.Code
LEFT JOIN WOR1 D ON D.DocEntry = C.DocEntry
LEFT JOIN OITM E ON E.ItemCode = B.Code AND D.ItemCode = B.Code
Where c.DocEntry = @list_of_cols_val_tab_del and d.ItemCode not in (select b.Code from ITT1 b))
Begin
Select @error = N'13002'
select @error_message = N'BOM Mismatch'
END
Thanks,
Bhoopathi.K

Hi,
Try this:
IF @transaction_type IN ('A', 'U')AND @object_type in ('202')
BEGIN
If exists (SELECT T0.DocEntry FROM owor T0
inner join itt1 t2 on t2.father = T0.Itemcode
where t0.DocEntry =@list_of_cols_val_tab_del AND t2.code not in (SELECT T1.itemcode FROM wor1 t1 where t0.docentry = t1.docentry))
Begin
SET @error = '202'
SET @error_message = N'order can not be added if not match with BOM.'
End
END
Thanks & Regards,
Nagarajan

Similar Messages

  • Query for getting Outtanding Production Order items

    Dear Experts,
    With a query, please advice how I can get a list of outstanding Production Order items?
    Much Thanks in Advance for your advice.
    Warmest Regards,
    Chinho

    Production Reports --->Open Item List --.> Production Orders

  • Sales order for a make to order item

    HI
    when i create a sales order in crm for a make to order item. its not creating any requirements.
    like for a make to order item  will have a BOM  and routing attached to it. it creates  a production order or a purchase requisition.  but  its not happening
    a sales order is getting created in ECC. but its not creating any requirements.
    so no planned order ( production order) or purchase requisition is getting created. even after running MRP.
    but when i create any thing in ECC everything is working fine.

    Hi,
    There is a difference in the ECC sale sorder and CRM sales order in ECC sales order when you sale a product then all the parts of the product and billed and for this they create a purchace order and maitain route of the material and transpotation point all the things but in CRM we dont maintain these thing so product does have parts in it self it is one type of dummy product in showroom thata have only price so when we create a sales order in CRM then we dont maintain the BOM of that product,.
    Regards,
    Sid

  • Committed Date For Components in Production Order

    Dear All,
    I m facing this,  Committed Date For Components in Production Order,
    the date appeared as 31.12.9999,
    How can i make this correct.
    please tell me..
    Thanks
    Raghu

    Hi, Thnkx,
    You Are correct, I got this while doing Availability Check, 2 dates.
    Requirement Date, and Committed Date.
    I tried your solution,
    I change the Quantity of one of my BOM , I tried to change the Quantity by Change Number,
    So in CS 03 I can see the Validity of that component up to 01-09-2010,
    I run MRP agian, new planned Order, tried to convert, the question is same.
    I still get the date as 31-12-9999.
    Thanks
    Regards
    Raghu

  • Query for Alert on production order to be released

    Dear all users and experts,
    I need a query for getting an alert on production orders to be released (from planned status to release status) by whether reading the release date of production orders created from 'order recommendation window' or by reading the due date of production order and substract the lead time(days) of the item from its due date or by any means you know best.
    Thanks and best regards,
    Farhan Sufi

    Hi Gordon and Joseph,
    Thanks to both of you for giving me queries.
    Gordon, I made 3 production orders for testing from MRP order recommendation window from which 2 production orders has release date of today 9th July, 2010 (due date 12th July monday) and the 3rd one has release date of after weekend i.e. 12th July 2010 (due date is 13th July). release dates are calculated by MRP acording to the items' lead time and due date.
    Gordon, when I applied your query It gave me msg 'no data was found as a result of this selection criteria' Can you explain what your query will give me in result?
    where as Joseph, when I applied your query on alert, it gave me all 3 production orders as an alert to be released. I was expecting it will give me alert for 2 production order for today as their release date in MRP is today(9th July, 2010) and the alert for 3rd production order should come on 12th July and not today.
    what I understood your query is displaying all production orders which have status 'planned' regardless of their release date.is it?
    Joseph can you edit this query in such a way that It should consider the release date (calculated from due date and lead time in MRP order recommendation window) and display only those production orders which should be released today and exclude those which have release date in future. so that I can get alert for only those production orders which should be released today.
    I hope good response from both of you
    Thanks and best regards,
    Farhan

  • BAPI_SALESORDER_CHANGE to update reason for rejection of sales order item

    Hi,
    The FM BAPI_SALESORDER_CHANGE is not working properly as I am getting below error when try to update the reason for rejection at sales order item level.
    The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?
    error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010  ready for input"
    Request your suggestions to avoid this error.
    Thanks

    >
    anikaushi wrote:
    > Hi,
    > The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?
    >
    >  error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010  ready for input"
    >
    >
    > Thanks
    Yes, Most likely.. You can confirm this by trying to change a order without delivery and see if it goes thru (to ensure that you have passed correct parameters)...
    you may have to delete the delivery (and if billing document exist, cancel it), before you can reject the line item... it would be safer to raise an error message and let the users manually delete delivery document as long as you don't have large volumes of this scenario..
    Please see the SDN thread for how you can avoid this error...
    Re: Cancel Sale Order after Issued Billing

  • FM for creation of production order creation

    Hi All,
    Can anyone tell me the BAPI for the production order creation.
    BAPI for creation of production order through CO01 transaction code.
    Thanks in advance
    Ramesh.

    Hi,
    Please check this FM CO_ZF_PRODUCTIONORDER_CREATE.
    Regards,
    Ferry Lianto

  • BAPI/FM for Confirmation of Production order at operation level

    Hi ABAPers,
    I am using the 'BAPI_PRODORDCONF_CREATE_ACT'for Confirmation of Production order at operation level.
    I am able to pass the Production order number and Active Operation get the confirmation done.
    But the Confirmed Qty is not being updating in AFKO table.
    The 'BAPI_PRODORDCONF_CREATE_HDR' cannot be used for Confirmation of Production order at operation level as there is no Operation/Activity(Vornr) field in the input table. Hence using this bapi confirmation of Prod order can be only at Order level.
    Can someone know any FM/BAPI which can be used for the Confirmation of Production order at operation level(not order level).
    Thanks in Advance
    Ramesh Babu Cikka

    Hi Ramesh,
    Please use FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'.
    This will work as like as T/Code "CO11".
    I hope this will help you.
    Example :
      CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'
        EXPORTING
          POST_WRONG_ENTRIES = '0'
          TESTRUN            = ' '
        IMPORTING
          RETURN             = ZRETURN
        TABLES
          TIMETICKETS        = ZBAPI_PP_TIMETICKET
          DETAIL_RETURN      = ZBAPI_CORU_RETURN.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT = 'W'.
    Lanka

  • Worklfow for GR of Production order.

    HI .... is there any standard worflow template for GR of production order using MB31.
    Thanks in advance.

    Hi ,
    Please check this SAP provide WF: WS20000387.
    You can copy and make changes as per your requirement.
    Thanks and Regards,
    Swaminathan

  • For a Production order - Operation wise Inspection Lot

    Hi Experts,
    Please help me out to resolve the following problems.
    1. How can we create inspection lot for each operation for a production order?
    If a production order has 10 operations, I will have to have 10 inspection lots for that order.
    2. I have a final assembly called A with components B & C. Some other material called D has similar characteristics of B.
        But sometimes, for A, instead of B (if stock is not available), i want to use D also. Please note that, if B is not available, then
        only, I will use D. Otherwise always B only, so we cannot go with probability.
    How can we map this scenario? and MRP run also should consider D if B is not there.
    Thanks in advance.
    Regards,
    Vijay.

    Dear
    Answer Q1 : Go to SPRO > Production> Shop floor control> operations > confirmation> define confirmation parameters
    Maintain
    1)Operation sequence u2013 error when operation sequence is not adhered to
    2) Over delivery u2013 Error when over delivery tolerance is exceeded
    3) Results Rec. (QM)- Error message if no Insp results exist
    So what these setting helps is that  :
    1)All operation has to be confirmed operation wise means 0010 has to be confirmed for confirming 0020 operation. SO production guys can only confirm 0040 operations only after 0030 operations is confirmed by quality personal.
    2)Over delivery is not allowed means of in 0030 operation if only 50 quantity is confirmed in 0040 operation only 50 can be confirmed. Production people cannot confirm more than 50 quantities
    3) Also PP personal cannot confirm operation 0030 through C011N till the result recording of that operation is done through QA32.
    4)Maintain Operation Control Key -PP01 with marked Inspection Character Marked -OPJ8  and maintain this Control Key for   those operation which are required for Inspection Lot .
    Now For QM stand point , activate inspection type 03 and 04 in material master. For 03 type of inspection, you have to make routing in CA01. So when you release your production order, an inspection lot will be generated. This lot will not be stock relevant. This is just to check that you production is in accordance with quality norms. Only after clearing this lot from quality you can do your order confirmation, otherwise system will give hard error due to 3rd point of prev post.
    For 04 type of inspections, prepare inspection plan in QP01. Now when order is confirmed, an inspection lot of 04 origin will be created in quality, and this is stock relevant and for final inspection of production order material.
    If you need you can set for early inspection as well. That will give you another intermediate stage before final inspection. Inspection points are also an option if suites your requirement.
    If you need more inspections, I suggest go for manual inspection lots of 04 origins, they are created in ref to order and are not stock relevant.
    Q2 : Please explore this thread for options explained for Alternative Item selection .
    Alternate Item in BOM
    Regards
    JH

  • Error when no production BOM exists for material in production order.

    Experts,
    I have materials with production BOM's and other materials without production BOM's.
    When I create a production order, I get an error message (not blocking) that I don't have production BOM.
    Can I configure my production order type in a way that a production BOM is optional?
    Many thanks!
    Jan

    Hi,
    Please cheeck with OPJB.
    SPRO-> Shop floor control->Sytem modfications-> Define sytem message attributes.
    As you can convert the meassages only defined here
    SPRO ( Production > Basic Data> BOM > General Data > Change Message Type .
    Or
    Goto SE91; press F4; select SAP Applications as PP and find all messages under it
    Regards,
    R.Brahmankar

  • Production order item details (For Archived Production Orders)

    Dear SAP Buddy,
    Please can anyone tell how to get the Document Goods Movement list of archived Production orders alongwith the G/L accounts assigned with all Documents Goods movement
    Awaiting reply from all genious SAP Buddy
    Answer will be highly appreciated
    Rgds
    BV
    Edited by: Brijesh Verma on Jun 17, 2009 2:37 PM

    Hi
    Try in MB51 with tick for check short documents in archive along with  proper Archive info structure  at the bottom of the screen
    Regards
    Brahmaji

  • To find 'Maintenance Work Center' for Equipment (without Production order)

    Hi,
    I have a Report for - 'Equipment BOM' - IB03.
    Problem: How to find the 'Maintenance work Center ' For Equipment ? (IE03--> Organization > Responsibility> Main. W.Cntr)
    [ Note: For Client -->  It's not necessary that each Equipment has Production Order, Few Equipments are taken only for Repair purpose, Equipment is there in table - EQUI,
    So - Not possible to fetch from AUFK, HIKO or any other order tables. ]

    I have a Report for - 'Equipment BOM' - IB03.
    Problem: How to find the 'Maintenance work Center ' For Equipment ? (IE03--> Organization > Responsibility> Main. W.Cntr)
    [ Note: For Client --> It's not necessary that each Equipment has Production Order, Few Equipments are taken only for Repair purpose, Equipment is there in table - EQUI,
    So - Not possible to fetch from AUFK, HIKO or any other order tables. ]
    EQUZ-GEWRK has the main work center. Pass the equipment number and valid-to date to get the main work center.
    Cheers
    Sujay

  • Tolerance limit for GI against production order

    HI
    Is there any standard functionality of having tolerance limits at Goods issue level - against the production order?
    Just like GR.
    or can we make this functionality using any Exits?
    -ashok

    Dear,
    Rstriction of excess goods issue against production order is not possible in standard setting.
    For achiving this you have to go for User exit.
    The logic should be
    In MIGO check mvt. type 261
    Pass the order through table RESB and select all the components with quantity.
    Capture the header material of order and use this as input along with the order creation date, plant and BOM application to explode function module CS_BOM_EXPLOSION.
    This will give you the BOM components which were valid at the time of order creation.
    Now compare these BOM components with the components from RESB with quantity.
    Here conditions will come in picture
    If quantity is exactly matching then GI will be possible
    or if you want to keep tolerance limit say for 10% then accordingly you can map the condition.
    Regards,
    R.Brahmankar

  • Mandatory Goods Recipient for components in production order

    Hello Experts,
    I want to control the field Goods Receipt for Plant Stock items in Production orders. I need it to be mandatory.
    This is the scenario.
    I have a Production Order assigned to a WBS element. This production order in its BOM has Plant materials (no value for Special stock indicator) and Project stock (Value 2 for Special stock indicator).
    I need the field Goods Receipt to be mandatory for the reservations for Plant materials.
    I have been checking PPCO00XX Exits but the only thing that I can do is include a warning in PPCO0007 when the reservation does not have value in database.
    Is there any way to control this value??
    Thanks in advance
    Laura

    Hello,
    The problem is still the same, as I am checking the database is not possible to set an error, if so, the production orders will never be saved.
    I need to know if it is possible to access Goods Receipt not from the database but from  RAM memory…
    Regards

Maybe you are looking for

  • Change Null Display on Apex Reports

    Consider this scenario: You have a report that pulls some information. Some rows have information that is NULL. This a report. It has report columns and not items. Is there anyway to display these Null values as something else, i.e. 'TBD' or 'Blank'?

  • Multiple key cache lookup cases for the same values

    Hi, Just curious whether someone else on this forum has dealt with this use case: we'd like to use the Coherence cache to store objects of say class Foo with fields a and b (Foo(a,b)) using a as the key. The named cache is backed by a database and pu

  • Deploying Forms

    I am a newbie to Forms development. I have Forms Builder downloaded, also WebLogic Server. Oracle Classic 11g and Oracle Fusion Middleware 11.1.1.2.0 I have WLS_FORMS started and I can access the Weblogic admin and EM applications. I have left the We

  • Ciscoworks LMS 3.2 Processes down

    Hello all, I have installed ciscoworks lms 3.2 on windows 2003. The discovery ran successfully and the devices were added to dcr. After a few days, the ciscoworks processes were automatically down. "Processes NOSServer, CmfDbMonitor, FHServer, IPMPro

  • How do I activate Genius

    I don't know why the Genius icon isn't showing up when I am playing music... I don't know if I don't have enough songs, I have 72 songs.