Planned order check

Hi,
How to check stock and open production in location b4 creating planned order?..am making a report to create planned order...
Please suggest with code if possible.

Check the below code :
Lock the planned order : 'ENQUEUE_EMPLAFE'
Unlock the planned order :'DEQUEUE_EMPLAFE'
data i_plaf like plaf occurs 0 with header line.
select * from plaf into table i_plaf
                  PLNUM = '0000999923'.
loop at i_plaf.
Lock planned order
    CALL FUNCTION 'ENQUEUE_EMPLAFE'
         EXPORTING
              plnum          = i_plaf-plnum
              _scope         = '3'
         EXCEPTIONS
              foreign_lock   = 2
              system_failure = 3.
    IF sy-subrc > 0.
   message
    ENDIF.
    clear : w_cm61w.
Get MRP control indicator at plant level
    CALL FUNCTION 'MD_READ_PLANT'
         EXPORTING
              ewerks = i_plaf-plwrk
         IMPORTING
              icm61w = w_cm61w.
Delete planned order
    CALL FUNCTION 'LOESCHEN_PLANAUFTRAG'
         EXPORTING
              ecm61w              = w_cm61w
              eplaf               = i_plaf
         EXCEPTIONS
              undefined_interface = 1
              OTHERS              = 2.
    IF sy-subrc = 0.
      COMMIT WORK.
    ELSE.
      MOVE: i_plaf-plnum TO i_error-order,
            text-012     TO i_error-messg.
      i_error-val = 'E'.
      APPEND i_error.
      CLEAR  i_error.
      continue.
    ENDIF.
Unlock planned order
    CALL FUNCTION 'DEQUEUE_EMPLAFE'
         EXPORTING
              plnum = i_plaf-plnum.
  endloop.
Reward Points if helpful.
Thanks
Seshu

Similar Messages

  • Planned Order Component check and Scheduling.

    Hi,
    Current Process: MRP runs automatically over a finished product and creates a planned order. This planned order checks in-house prodcution time of the product and backward schedules the dates.
    New Requirement: MRP runs automatically over finished product and creates a planned order. This planned order checks in-house production time and "component availability". If all components are available, then the planned order gets standard in-house production time. If a component is missing, then system checks the delivery date of the purchase requisition/ order and reschedules the planned order to acommadate for the late arrival of components.
    How can this new requriement be achieved? Is it possible that when I check component availability of a planned order, system automaticall re-schedules the order?
    Thanks in advance.

    Hi Srao, the concept of MRP is to schedule requirement dates and qty's based on the delivery date of the finished product. If any component is not available according to this scheduling, the system generates a reschedule proposal of e.g. an existing purchase req. or creates a new purchase req. or planned order.
    MRP considers planned GR's on sub-level only if they fit the schedule. What u want is simply not the concept - sorry

  • Order type for planned order in repetitive manufacturing

    hi
    In repetitive manufaturing there is no prodcutiion order
    planned order only. so i want know what is order type  for repetitive manufacturing
    In configuration order type for  reptitive is required or not   if  yes  then how will define order type ,where
    In Discrete order type will define to control  prodution order
    like that i want know details about order type in repetive manufature
    ravikumar

    HI
    Planned order in REM is of PE type thar s non convertible in PO and also these planned orders are assigned to PVs thru Planning table and the Confirmation is done agianst these planned orders.
    check these links:
    Re: order type in repetitive manufacturing
    http://www.sapfunctional.com/PP/REM/page1.htm
    Regards
    Anupam Sharma

  • Planned order confirmation

    I have created a new material with REM activation..
    I have created a planned order for 1000 qty for the material..
    When i confirm even a partial amount of the planned order for eg 100 qty, then in the system i am not able to see the planned order again.. I guess fullly confirmed planned orders will not exist in the system.. But this is partial only,then why the planned order is not seen in the system.. Can anyone tell me what s the problem and how to clear that..
    And a very important information for me,where can i find the components that are issued for a planned order..Please tell me is thr any reports for this..

    HI
    Please check  REM profile in OSP2 > Control data 2 for Planned order reduction> Select reduce planned order assigned to version and also reduction period 0
    Check also after running MRP MF27 should be executed so that reports MCP6/MCP8 get updated to see GR agianst Planned order
    check and revert
    Regards
    Anupam Sharma.

  • User exit/ badi needed for planned order create/change,collective ATP check

    Dear All,
    I'm looking for a user exit/ badi which can be used for planned orders at the stage of
    mass collective availability check (COMAC tcode) update; or at some other relevant stages of mass update of planned orders.
    I need after collective availability check to perform the following:
    1) to copy date from "total comitment" field on header tab of planned order and paste it (replace old date) to order finish date on header screen
    then
    2) to start a scheduling.
    Very appreciate your help.
    Best Regards,
    Andrey
    Edited by: Andrey Kruglov on Apr 15, 2010 3:06 PM
    Edited by: Andrey Kruglov on Apr 15, 2010 3:07 PM

    Dear,
    Use the BAPI : BAPI_PLANNEDORDER_CHANGE
    Or use the function module MD_SET_ACTION_PLAF for Schedule planned order.
    and the transaction MDAC Execute action for planned order
    This function module includes the following actions:
    Explode BOM
    Explode BOM, check availability
    Check availability, only explode BOM in the case of a requirement
    Check availability, do not explode BOM
    Reset availability
    Change planned order data
    Schedule planned order
    Delete planned order
    Assign the key for the respective action control to the materials in the material master (MRP 4 view).
    Please refer this thread,
    Re: MDVP for collective orders
    Regards,
    R.Brahmankar

  • Availablity Check and Planned order

    Hi,
    In Material Master Record in MRP3 view , we have a field for "Availablity Check".
    Whether it is required for MRP run ?
    As we are not doing any stock transfer orders , as SD module is not implemented.
    So my Question is :
    1) Whether "Availablity Check"field is required for MRP run?
    2) While running MD03 Transaction we see Planned order getting generated....What is the use of it and Can we avoid this Planned orders to get generated?
    Utsav

    Hi,
    Availabilty check will check the available stock of the material as per its defiunition .
    When the material is MRP material if there exists a requirement for the material either in the form of a sale order or planned independant require ments, SAP checks these requirements anb compares with the available qty and generates the requirements like planned orders , which in turn will get converted into either PRs or Orders depending upon the procurement type of the material in MRP view.
    If your material is not related to MRP this data need not be maintained
    For more details please refer to the link
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/f4/7d327a44af11d182b40000e829fbfe/content.htm
    and
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/f4/7d326d44af11d182b40000e829fbfe/content.htm
    and
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/f4/7d315744af11d182b40000e829fbfe/content.htm
    ansewe to your first question yes
    second question:Planned order is a requirement generated for the short fall of the material when checked with the avauilability check.It can be converted into either PR or Order depending upon the procurement type.
    If do not want the planned order to get generated means material need not be maintained with MRP.Means you does not want the shortfall requirement to get generated(if this is your criteria)
    Please reply back if you are not satisfied with the answer.
    Regards,

  • Bapi or Function Module to do the availability check for Planned Orders

    Hi all,
    I need a Bapi or a Function Module to do the availability check for a Planned Orders. Anyone knows how?
    I will use it in an Exit.
    Thanks in advance
    Points will be given

    I think I found it.
    If anyone is searching for it too, we will use these one:
    CO_ZA_AVAIL_CHK_ORDER_MULTI

  • Check in Production order qty with ref to Planned order

    Dear all,
    Please suggest me, when i am creating a productin order with ref to planned order , so the order qty should not exceed the planned order qty.
    How can i control this , please give ur valuable inputs on the same.
    regards
    Ravi Arora

    Dear
    If you are not particualr to conver the planned order to production order through CO40 , then you can control with the help of
    Enhancement : PPCO0007 (Exit when saving production order)
    Functional Module : EXIT_SAPLCOZV_001
    Include : ZXCO1U06
    Compare the Order header Qty with the sales order Qty If the production order header qty is more do not allow the system to save the production order..
    Otherwise please check those out for your requirement :
    Planned Ord. to Production Order User Exit (PPCO0005)
    EXIT / BADI for Tcode CO40
    Regards
    JH

  • Planned order availability check

    Hi All,
    The planned order generated is checking for the availability of raw materials .,
    Im presently changing the planned order start date and finish date according to the commited date getting from availability check for components
    The issue is the committed date is displaying when the raw material will be available ., this is fine
    when there is stock for rm is available in rm stores it is not considering the stock, it is considering only the stock in wip store only(system showing a date according to the material planned delivery time , there is enough stock and no PR have been generated
    help me in sorting out the issue
    Regards
    Anand Srinivasan

    Hi anand
    During MRP run . The BOM gets exploded and it will be based on your Strategy only.
    If you use MTS 10 it will include stock, if it is 11 it will not include stock. If you use 20 it will not include stock during BOM explosion.
    Availability check also depends according to your strategy.
    That is why it not cosidering the stock and creating dependent requirement. On further conversion this will be converted to reservation.
    Hope this is clear
    Regards
    J . Saravan

  • Availability check - Planned order not considered

    Hi Experts,
    I am facing an issue in Make to Order scenario.
    My sale order is of quantity 10.
    when i save the sale order, i get confirmed quantity as Zero.
    But in my controls setting of availability check i have selected consider all firmed planned order.
    Now  i have a firmed planned order for this sale order.
    but still system shows confirm quantity as Zero.
    Let me know what is the correct procedure and whether planned orders are considered for availabilty check for MTO scenario or not.
    Regards,
    Birendra

    Hi Venu,
    Please find answers of your query:
    1.    First have you maintained any safety stock in mm01:
    No
    2. Tcode: Md04
    3.> Tcode : Co09
    4> If that stock related to batch Please check in MSC2N Because if batch is restricted you cant get stock
    Not related to batch
    5.> schedule lines
    Let me know if any more information required.
    Regards,
    Birendra

  • Availability Check in planned order

    Hi Everyone,
    What is differecnce between MDVP  collective ATP check and MD12 ATP.
    I am getting different result for the same planned order.
    could you plase tell me why this so.
    Thanks
    Siddhesh

    HI R.Brahmankar,
    Thanks for your quick replay.
    But I am getting different results for same materil in MDVP and MD12 Component Avail check.
    I am not getting  the logic why the system is giving this results.
    can you please tell me the same.
    Thanks a lot in Advance.
    Siddhesh

  • Set Availability Check to Exclude Planned Order

    Hi All,
    anyone know how to set the availability check so it will not include the planned order in the calculation ?
    I find one setting in SPRO, the path is :
    Sales & distribution ==>  Basic functions ==> availability check and Transfer of Requirements ==> Availability Check  ==> Availability Check with ATP Logic or Against Planning ==> Carry Out Control for Availability Check
    select one of the record, and update filed "Incl. Planned Orders".
    I've uncheck that field, but I can't get the appropriate result. When I create a new sales order, the availability check still take the planned order I created before into account.
    The problem is, my user want to prevent creating delivery before the goods are already put in the stock. So the planned order should not be considered in the availblity check.
    Thank you in advance
    Rudy

    Hi Rudy,
    Concept of availability check is to verify if the stock is available at the time of creation of sales order. If available, when it can be ready for delivery (as Packing, arranging for transportation, etc may have lead time) & if not available, when it would be available considering Packing, arranging for transportation, etc lead time.
    Availability check whether material is available on required delivery date (backward scheduling) or not. If not available on required delivery date, system will propose next available date (forward scheduling)
    1.     Define Checking Groups
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Define Checking Groups
    You define checking groups with which you specify the type of requirements records the system is to create when processing sales orders or deliveries
    2. Define Material Block for Other Users
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Define Material Block for Other Users.
    3 .Define Checking Groups Default Value
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Define Checking Groups Default Value.
    4. Carry out Control for Availability Check
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Carry Out Control for Availability Check.
    5. Define Procedure by Requirements Class
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Define Procedure by Requirements Class.
    6. Define Procedure for Each Schedule Line Category
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Define Procedure for Each Schedule Line Category.
    7. Determine Procedure for Each Delivery Item Category
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Determine Procedure for Each Delivery Item Category.
    8. Checking Rule for Updating Backorders
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Checking Rule for Updating Backorders.
    9. Define Default Settings
    Menu Path: SPRO>SD>Basic Functions>Availability Check and Transfer of Requirements> Availability Check with ATP Logic or Against Planning>Define Default Settings.
    Availability checks
    1. Availability check is an integral part of the business process that determines if the required delivery quantity can be met on a required delivery date. For this purpose the system takes into account pre-delivery activities such as scheduling for picking or packing times and the time taken to produce or obtain the material. It also performs several background functions such as Backorder processing, rescheduling and ATP quantities.
    2. Backorder processing: processing of a sales order that has not been fully confirmed or not confirmed at a certain delivery date.
    3. Rescheduling: is a proposal of how – confirmed quantities already assigned to a sales order can be reassigned to other sales orders that have a higher priority.
    4. Available to promise (ATP): is a process of checking the available quantities of a material. The ATP quantity consists of warehouse stock + planned receipts (incoming stock) – planned issues (outgoing stock). to examine stock on hand (CO09) proceed to logistics – sales & distribution – sales – environment – availability overview.
    5. Replenishment lead time (RLT): is the time taken for the material to become available either internally (in house production) or externally (from a vendor). The most important things to consider during an external procurement are purchasing and MRP 2 (procurement) views of MMR where the processing time for purchasing, planned delivery time and goods receipt processing time are taken into account. On the other hand internal procurement is based on in house production time (MRP 2 view) goods receipt processing time or alternatively RLT time, which is found on MRP 3 view.
    6. RLT (Replenishment Lead Time) is the time taken for the material to become available. RLT is only used when doing an ATP check (Available To Promise). The value of RLT for a material is specified on material master record.
    7. There are three types of availability checks –
    Check on basis of ATP quantities.
    Check against product allocation.
    Check against planning.
    Configuring Availability check through Checking Groups –
    1. The checking group + checking rule determine how the availability check is to be performed.
    2. The checking group determines whether and how the system checks the stock availability and generates requirements for material planning. The checking group defines what type of requirements will be passed on i.e. summarized requirements (daily/weekly) or individual requirements for each sales order.
    3. The checking rule applies to how the availability check is to be carried out at the transaction level. Note that you must define checking rules for each individual application such as for production orders for example. In Sales and Distribution, the checking rule is specified internally within the system and cannot be changed.
    4. The checking rule, in conjunction with the checking group, determines the scope of the availability check for every business operation; that is, which stocks, receipts and issues are to be included in the availability check and whether the check is to be carried out with or without the replenishment lead time.
    5. Briefly explaining the above – checking group determines which type of requirement to be passed on to MRP whether it be individual or summarized and checking rule which is at the transaction level and can be configured independently for each application module, determines which stocks, receipts and issues to be taken into account. For performing an availability check checking group has to work in conjunction with checking rule.
    6. Advantages of individual processing over summarized processing –
    Backorder processing is possible.
    You can access (MD04) order, line and schedule line individually which gives a greater control on available stock and requirements placed on stock.
    The system automatically uses individual requirements in case of special stock items.
    7. Required data for the Availability check to be carried out –
    The Availability check must be switched on at the requirement class level.
    The Availability check must be set at the schedule line level.
    A requirements type must exist by which the requirements class can be found.
    A plant must be defined in the sales order for each schedule line item (in other words plant must be defined for every material in MMR).
    A checking group must be defined in the material master record in the MRP3 screen in the availability check field.
    8. Configuring Availability check and defining Checking Groups –
    Checking groups are introduced into the sales order based on the setting in the material master record.
    SAP standard checking groups are 01 – summarized requirements and 02 – individual requirements or you can create your own by copying the standard ones.
    Total sales and total deliveries columns are there to configure a checking rule to sum up requirements to post to MRP either individually or by day or week.
    Block quantity required can be set if you want several users to be able to process the material simultaneously in different transactions without blocking each other.
    The no check indicator is CHECKED when you DO NOT want the system to carry out ATP check.
    9. Defining material block for other users – the block check box is an indicator that enables you to block material master records of a particular material during the availability check and restrict other users from accessing same master record and reserve the material. If the block is not set, two users can confirm the same material at the same time for two different orders, not knowing if the stock is available or not. If you select this field, the material is blocked during the availability check and other users cannot: a) Make changes in the material master record. b) Create purchase orders for the material. C) Create orders for the material.
    10. Defining default values for checking groups - Checking groups are introduced into the sales order based on the setting in the material master record.
    However if there is no entry present in the material master record for the checking group, a default value can be set here, depending on material type and plant.
    This default value will be used by the system depending on the material type mentioned in MMR and plant in sales order.
    If an entry exists, this default value is over written by MMR.
    11. Controlling Availability Check – in this section, you tell the system what stock on hand and what inward and outward movements of stock it must take into account when performing the availability check in addition to whether or not to consider the replenishment lead time.
    12. These settings are based on the checking group that is assigned to the material master record and the checking rule that is predefined and assigned to the sales and distribution transaction.
    13. These settings carry out control both for sales order and delivery as well. This is due to the fact that you may want to include specific stock or incoming stock for the sales order, yet at the time of the delivery only include physical stock on hand waiting to be shipped.
    14. It is possible to indicate to the system that you would like the availability check NOT TO CHECK the stock at the storage location level. This indicator is used to set the scope of the availability check.
    15. It is used to switch off the check at storage location level. You create a reservation for a particular storage location. However, the scope of the availability check is set in such a way as to exclude the storage location. In this case, the system carries out the check at plant level only and does not take the storage location into account that is specified in the reservation.
    16. Should you not want the system to automatically check RLT, you may indicate so here. RLT is the time taken for a material to become available. It is only used when doing an ATP check and is taken from MMR.
    17. Defining the elements in the availability check entirely depends on the business needs, but a few tips are given under –
    When controlling the Availability check at the time of the sales order, a purchase requisition does not necessarily indicate by it is going to come into the plant.
    A shipping notification on the other hand - a confirmed purchase order – is a good indicator of receiving stock on a specified date.
    It is always recommended not to select the shipping notifications for the delivery requirements type as you may not actually receive the stock into plant or warehouse for which you are creating a delivery.
    Please Reward If Helpful,
    Thanks and Regards,
    Sateesh.Kandula

  • Capacity check during Planned order to production order conversion

    Hello Gurus,
    I have a strange situation during capacity check.
    While Converting the planned order to Production order, I release the order and I don't get any warning. All work centers are available
    But for the same material/quantity/dates, if I create the Production order manually, release it, system check the capacity and I got the message the Capacity Over loaded (which is correct also as there are overload on the work centers).
    My question is why I am not getting this message while converting the planned order to production order.
    There are overload on the work centers and manual creation of Production order is working fine, but problem is during planned order to production order conversion.
    For information, I have maintained Finite scheduling indicator in OPKP, capacity availability indicator "NO CHECK" is also blank in OPJK.
    It will be grateful if you can please help me here.
    Thanks in advance,
    Sandeep Kumar

    Hi KK,
    Thanks for your feedback.
    I have checked all these settings but still no success.
    I am surprised but it is not a customizing issue I believe, because capacity is checked in Dev client while converting planned order to production order. I am facing this issue only in Staging client.
    Master Data is same. In CM01, in Quality(Staging) client, it is showing overload. while creating production order, it shows overload but only when convert from planned order to production order, it does not show overload .
    Please suggest what else I need to check.
    thanks in advance.
    Br,
    Sandeep Kumar

  • Sales order checks stock and auto planned ord created for shortage quantity

    Hi,
    I have a requirement like, when I create a Sales order, it should check for the available stock. If stock exists, the delivery could be done using the stock. But if stock is less or partially available then, a planned order should be created automatically of the shortage quantity. Please guide

    Yes strategy 40 will work for the first part, but if stock are not there, then how to get Planned orders with reference to Sales order? Infact as i wrote before, we can get that as well using MD50 MRP run, but the process order has non valuated GR, the price for FG is zero. Can you help me with that, to get a valuated Goods receipt for the Finished product?
    You can check your self, in the Documented Goods list of Process order, the non valuated material marked "X"

  • ATP-check - check completely confirmed planned orders

    Hi everyone,
    I just stumbled over sth. during checking the ATP-settings in my system.
    In OVZ9, when double-clicking on any of the combinations of checking-group and checking-rule, in the lower part of the righthand-side, I got the option to include planned orders as well. Now, if I open up my options, I find 4 of them:
    - empty: Do not check
    - A: check firmed planned orders only
    - B: check completely confirmed planned orders
    - C: check all planned orders
    So... can anybody tell me what's the story with completely confirmed planned orders? I know what it means to firm planned orders and I know how to do it, but what's the point with that?
    Any help greatly appreciated!
    Regards... Bobby

    Hi,
    There was a bug in the standard program.
    SAP create a new SAP Note '1616590' for the above correction.
    Thank You.

Maybe you are looking for