Open Production Order with Mark for deletion

Hi
Friends again stuck in open production order
i want to calculate  production order quantity for open production order,
only those production order which dont have mark for deletion.
I find a field in afpo XLOEK ..but it wont get reflects when done changes in CO02
Then i used the table JEST and i want to delete those aufnr which has deletion flag i wrote the folowing code pls do correct me where iam wrong .
IN this code  deletes aufnr which are marked as deletion  ?
SELECT afko~aufnr
       afko~gamng
       afko~plnbez
       afpo~dwerk
       afpo~psmng
       afpo~matnr
       INTO CORRESPONDING FIELDS OF TABLE i_afko
       FROM afko INNER JOIN
       afpo ON afpoaufnr = afkoaufnr
       WHERE afpo~dwerk = s_werks
      AND   afpo~matnr IN s_matnr
      AND afpo~elikz = space.
LOOP AT i_afko.
  CONCATENATE 'OR' i_afko-aufnr INTO i_afko-aufnr.
  MODIFY i_afko.
ENDLOOP.
IF NOT  i_afko[] IS  INITIAL.
  SELECT jest~objnr
         jest~stat
         jest~inact
          INTO CORRESPONDING FIELDS OF TABLE i_jest
          FROM jest
         FOR ALL ENTRIES IN i_afko
         WHERE objnr = i_afko-aufnr.
ENDIF.
LOOP AT i_jest INTO wa_ijest.
  IF wa_ijest-stat = 'I0076' and ( wa_ijest-inact = SPACE  ).
    DELETE i_afko WHERE aufnr = wa_ijest-objnr.
  ENDIF.
ENDLOOP.
i_afko1[]  =  i_afko[].
SORT i_afko BY matnr dwerk.
DELETE ADJACENT DUPLICATES FROM i_afko COMPARING matnr dwerk.
loop ....
calculate :quantity
endloop.
Regards and answers will be rewarded points

thnks
solved the problem
regards

Similar Messages

  • HOW TO BLOCK THE PURCHASE ORDER AND MARK FOR DELETION ?

    Hi ,
                        During the Creation of the Purchase order in the SAP System... After creation of the Purchase order should be blocked and a work item is created for the approver. If the Approver approves the Order then the Order is Unblocked and a mail send to the initiators inbox and the Order is Released. Similarly if the Approver Rejects the Purchase Order then its set for Mark for Deletion.
    I did Po creation and release part. But i am facing problem during the Blocking & Unblocking the Purchase order. If he rejects i need to set for "Mark For Deletion". plz help me to solve this...

    Hi,
    You can use bapi 'BAPI_PO_CHANGE' to change the status of PO and for release use bapi BAPI_PO_RELEASE.
    Hope this will help you.
    Smit

  • Error Messages saying that Firefox, as well as other programs when trying to open them, have been marked for deletion"?

    I know this probably is more of a Windows problem, but I can't figure out that site for the life of me, so I'm asking my question here.
    So I went to use a program called Combo Fix to check for any viruses and all that. It worked fine and I restarted my computer just in case I needed to. Then when I went to open Firefox, an error message came up saying something like "Illegal Operation Attempted on registry key marked for deletion." I then tried to open another program that I've had for a few years now that runs perfectly (MikuMikuDance aka MMD). It did the same. I went to open Microsoft Word and I still got the error message.
    I have no idea how I should fix this. I'm currently typing this in Safe Mode because its the only way I could get online again to search for solutions.

    By the way, the fact that the error does not occur in Safe Mode is interesting, as in normal mode Firefox may be checking the registry key related to Firefox extensions at startup. And that key would be a logical target for deletion of any references to malware. However, I've never seen a specific list of registry read/writes for Firefox startup, so that's just a guess.

  • PR Marked for deletion after Business Complete

    Hi gurus,
    My PR created from work order are marked for deletion after business complete and/or why is it being marked for deletion?
    the requirement is to not mark it for deletion. is this possible?
    Thank you.

    Dear,
    Technical confirmation is followed only after all confirmations and GR/GI and reservations posted which means that the work has been completed on ground.,The remaining Capacities, reservations, partial confirmations, Open PR's(Not processed into subsequent material documents like RFQ/Quotations, PO) Open PO's get cancelled as soon as you TECO the Work order. so this clearly states that all your PR's ad PO's are delted at TECOstage much before settlement and Business Completion is done.
      If you want ur PR's not to get cancelled then you can lock the PR's and then TECO the work order. However this lock will prevent PO creation.The best way to do this is to give  a user status and hold the PR from getting deletd. User status can be provided at PR or Work order level.

  • LSMW for Open Production Order Creation

    Hi all,
    I want to migrate open production orders from legacy system to the other SAP system. Please let me know how should I do it?
    I tried using the idoc method with  Message type LOIPRO and the Basic Type LOIPRO01 but the it gives a error that No process code for message type LOIPRO. I guess this is a Outbound Idoc.
    Next I tried searching for a BAPI for prodcution orders. I found the BAPI,   BAPI_PRODORD_CREATE. But it does not contain all the fields I need. Also this BAPI cannot be used in LSMW as it ALE message type does not exist for it.
    So please let me know how can I use the idoc method to create the production order as I have all the fields required in the idoc basic type. Also please share if any other method is there to upload the data.
    Regards,
    Mozila

    We had to use BAPIs to upload the production orders.
    It was not possible with LSMW.

  • Mark For Deletion of STO's which purchase order history

    Is there a way, where I can set mark for deletion for a STO which has partial goods issue/receipt { i.e. it has purchase order
    history }
    Thanks In Advance!!

    Dear,
    Check solved question: Re: To close old STO with inbalance GI and GR
    Regards.
    Syed Hussain.

  • How to delete  Open Production Orders

    Hi,
    I would like to Delete Open Production Orders.plz tell me How to delete  Open Production Orders

    Hi
    for deleting POs you have to delete the line items. First select the line items and then choose the icon 'delete' in the item overview screen of PO.
    For open PO s also you have to do the same Or else change the PO quantity to the desired qty for what GRN has been made.
    Regards
    Siva

  • Report for Production orders with name of Customers

    Dear Expert,
    Kindly suggest to view the production orders with customer numbers for which the sales orders is created.
    I tried in MB51 with layout settings but the customer number comes out be blank despite the sales order number is populated for an production order.
    Kindly suggst a way or any report in the system  to get the corresponding information of production order number and corresponding customer name mentioned in the sales order .
    Thanks in advance for your help and inputs..
    Best regards,
    Nitish jain

    Nitish,
    MB51 is a Material Document list.  Many production orders exist that have no entries in this report, so it would be an unlikely candidate to be a solution for your requirement..
    The standard production order reporting tool is COOIS.  The output for MTO orders can be configured to display Sales order and Item and Soldto.
    Obviously, displaying even the customer order number in COOIS is impossible in a MTS scenario.
    In addition, a user experienced in using SAP Query  (SQVI or SQ01/SQ02/SQ03) could also create a production order report without having to know ABAP, by properly linking tables AFKO, AUFK, AFPO (production order data) with VBAK (sales order header data) to get customer number, and KNA1 to get customer name..
    If you are not expert in SAP Query, I suggest you discuss this requirement with a local ABAPer.
    If you are feeling like educating yourself in the wonders of SAP query, try this doc.  Although old, SAP query hasn't changed very much since this document was written.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    Rgds,
    DB49
    Edited by: Dogboy49 on Apr 20, 2010 10:47 PM

  • BAPI for Open production orders

    Hi All,
    Any BAPI for open production orders?.... Using BAPI i want to upload open production orders informatiomations.... Please help
    Thanks & Regards
    Santhosh

    Hi,
       Please check the following BAPI,
    Goto BAPI tcode, select hierarchical tab
      Production orders,ProductionOrder ,ProdOrdConfirmation , RCVPRORDCF and check the BAPIs

  • BAPI for creation of Production Order with Ref to sales order

    Hi all,
    we are using BAPI_PRODORD_CREATE  for creating Production Order with ref to sales order.
    As per the Business Scenario, we are not creating any masters like BOM and Routing, instead
    we are creating Routing directly into the Production Order under operation overview screen.
    during creation of routing system is generating a default operation.
    the following is the error results after running the Bapi.
    "No routing selected"
    Best Regards.
    GTNRNR.

    Hi GTNRNR,
    with out creation of BOM you created routing and in routing for the operations which components did you allocated so that can be used to manufacture the final product. Can you be please specific?
    Regards,
    Madhu.G

  • Manual Reservation for Production orders with automatic reservations

    Hello SAP Experts, i have a question regarding Order Reservations, in my company when we create a Production order the reservations for each component are created automatically and assinged to a reservation number, the thing is when i try to create a Reservation through MB21 for the same Production order the system says that" for that type of production order i cant generate manual reservations", can you please guide and tell me if i can change this in the configuration ?? , if you need additional info please tell me , thank you in advance.

    Dear German,
    Your system working according to std SAP setting, u don't need to change any config setting. Because wehn u release order, it automaticaly genarates reservation for each and evry component of the order.
    when u do goods issue to order or to reservation either way it gets issue to the order.
    suppose if u need to issue any extra component to the order u can just add in order componet overview before u release the order. so reservation gets genarated for this componets too along with BOM components.
    In case afer release, if u need further components go to MB1A give mov type 261 and S.Loc and then click on new item push button, it pop ups one more window give all required parameters and post the goods. These goods issue will also gets updated in the order.
    But for the order uc an not manually create the reservations
    sree

  • Mark for deletion - Process Order

    Hello friends,
    I am getting the following error when I am trying to activate the deletion flag in process order. Kindly guide.
    System status ORRQ is active (ORD 50000369)
    Message no. BS013
    Diagnosis
    Object ORD 50000369 has system status ORRQ (Order record required). According to this status, transaction 'Mark for deletion' is not allowed.
    Procedure
    You can only carry out the requested function if this is allowed according to the status of the object.
    Regards,
    Narendra

    Hi,
    I am also doknow , how to overcome that status in process order.
    Letus wait for more reply,
    Meanwhile u can achive  through system status.
    BS22 - > select Sytsst =IO278, stat =ORRQ -> double click on Sysst  - >Set as permtd for Mark for deletion.
    Now try to set del flag.
    This not a right way, it will affect all the order type and i ahve not also tired this.
    Regards
    Pradeep

  • Change production order with deletion indicator

    Hello
    We have some production order with deletion indicator, status 'DLT'. We want to reative them and do GR. How can we do, can we remove the status 'DLT'
    Thanks
    Hailiang

    Hailiang,
    Its not possible to revoke the deletion flag.
    so you need to create new orders, and thats why its being suggested that think twice before setting deletion flag.
    if you are not sure with the orders you can set TECO , and it can ve easily revokeas and when required.
    Regards
    Ritesh

  • Variance calculation for production order with settlement receiver as SDI

    Hi...
    I have one query reference to Variance calculation for production order with settlement receiver as SDI(Sales document item).
    I am working on Varaint configuration with strategy 25(Make-to-order for configurable material) with requirement class 046.
    I have created sales order ref. to configurable material,subsequently created planned order & then converted to production order.
    In production order settlement receiver is SDI(Sales document item).
    While doing production confirmation ,variance has been created.
    Now during variance calculation KKS2, I have got error message as no suitable settlement rule found for object Order no.
    Is there any way to come out of this?Or variance calculation KKS2 is not applicable with settlement receiver as SDI(Sales document item).
    Pl. guide
    Redards
    Tushar

    Hi
    In case of non valuated material, concept of variance does not apply...
    Variance is Actual Cost - Cost of Goods receipt posted in stock.. If the later value is zero, your entire actual cost is variance... That is one way of saying it
    But, in SAP, var not calculated in case of non valuated material and that makes sense as well.. Since you are in MTO scenario, it would make sense to analyse costs vs revenues @ sale order level as each SO will be unique in itself
    Regards
    Ajay M

  • Pick List and Open Production Order

    Our WMS clerk confused about open Production Order and Pick up due list for the Production Order.We want to check the list of open production order and what are the materials due for picking up the open production order   Please suggest us the best way you are doing for your Production Order.
    Thanks

    Nick,
    Co27 will give only open orders and materials to be picked.
    Open production orders mean - orders which are not teco/closed/deleted.
    All the materials will appear in the list which have a status - FInal issue not ticked.
    You can slos use coois
    with list = components
    profile = picking profile.
    here we have more options.
    please come back if required.

Maybe you are looking for