Production confirmation cancel through QM

Dear Sir/Mam
In our scenario when production order is confirmed we get inspection lot with inspection lot origin 04,if material is accepted i post the stock in unrestricted which acceptable by the user,but if the material has to be rejected we do not want put the stock in blocked.We required that if material is rejected its production confirmation should be reversed means its last operation should be cancalled that means mvt type 102.Please guide
regards
kunal

Dear Sir
Function module done and assigned to Follow up action of Manual and even assigned to catalog 3 in inspection lot orgin 04 in that rejected(R) selected and that follow up is assigned.
In qa32 when i m going to usage decision selecting 04, R-Rejected I can see follow up action but Function module is not triggered and where the stock to posted should it to be remained in quality.Can this function module can used for the lot whose stock is posted to unrestricted.Awaiting for your valuable answer.
Please go through  below code
Let me know the changes if any.
FUNCTION ZQM_BAPI_PROD_ORDER.
""Local Interface:
*"  IMPORTING
*"     VALUE(I_QALS) LIKE  QALS STRUCTURE  QALS OPTIONAL
*"     VALUE(I_QAVE) LIKE  QAVE STRUCTURE  QAVE OPTIONAL
*"     VALUE(I_QAPO) TYPE  QAPO OPTIONAL
*"  EXPORTING
*"     VALUE(E_SUBRC) LIKE  SY-SUBRC
*"  TABLES
*"      E_PROTOCOL STRUCTURE  RQEVP OPTIONAL
*"  EXCEPTIONS
*"      NOT_FOUND
*"      INVALID
**"     REFERENCE(PRUEFLOS) TYPE  QPLOS
*"     REFERENCE(I_QALS) LIKE  QALS STRUCTURE  QALS OPTIONAL
*"     REFERENCE(I_QAVE) LIKE  QAVE STRUCTURE  QAVE OPTIONAL
*"     REFERENCE(I_QAPO) TYPE  QAPO OPTIONAL
*"  EXPORTING
*"     VALUE(E_SUBRC) LIKE  SY-SUBRC
*"  TABLES
*"      E_PROTOCOL STRUCTURE  RQEVP OPTIONAL
*"  EXCEPTIONS
*"      NOT_FOUND
*"      INVALID
  DATA : CONFIR LIKE  BAPI_PP_CONF_KEY-CONF_NO,
         CONFCOU LIKE  BAPI_PP_CONF_KEY-CONF_CNT,
         RETURN LIKE  BAPIRET1 ,
         LOCKED LIKE  BAPI_CORU_PARAM-LOCKED,
         CREATED_CONF_NO LIKE  BAPI_PP_CONF_KEY-CONF_NO,
         CREATED_CONF_COUNT LIKE  BAPI_PP_CONF_KEY-CONF_CNT.
  DATA:   P_RUECK TYPE AFRC-RUECK,
          P_RMZHL TYPE AFRC-RMZHL.
  DATA: BEGIN OF IT_QALS OCCURS 0.
          INCLUDE STRUCTURE QALS.
  DATA END OF IT_QALS.
  DATA: BEGIN OF IT_AFRC OCCURS 0,
          AUFNR TYPE AFRC-AUFNR,
          RUECK TYPE AFRC-RUECK,
          RMZHL TYPE AFRC-RMZHL,
        END OF IT_AFRC.
break abap-core.
*START-OF-SELECTION.
  SELECT single  *
    FROM QALS
    INTO IT_QALS
   WHERE PRUEFLOS = I_QALS-PRUEFLOS.
  IF IT_QALS[] IS NOT INITIAL.
    SELECT AUFNR
           RUECK
           RMZHL
      FROM AFRC
      INTO TABLE IT_AFRC
      FOR ALL ENTRIES IN IT_QALS
      WHERE AUFNR = IT_QALS-AUFNR.
  ENDIF.
  READ TABLE IT_AFRC INDEX 1.
  MOVE : IT_AFRC-RUECK TO P_RUECK,
         IT_AFRC-RMZHL TO P_RMZHL.
  IF SY-SUBRC NE 0.
    MESSAGE 'Value Not Found' TYPE 'I'.
  ENDIF.
  CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL'
    EXPORTING
      CONFIRMATION              = P_RUECK "CONFIR
      CONFIRMATIONCOUNTER       = P_RMZHL "CONFCOU
  POSTG_DATE                =
  CONF_TEXT                 =
   IMPORTING
     RETURN                    =  RETURN
     LOCKED                    =  LOCKED
     CREATED_CONF_NO           =  CREATED_CONF_NO
     CREATED_CONF_COUNT        =  CREATED_CONF_COUNT .
  COMMIT WORK.
  IF SY-SUBRC EQ 0.
    WRITE 'PO Canceled'.
  ENDIF.
ENDFUNCTION.
regards,
Kunal.

Similar Messages

  • Production Confirmation cancellation issue

    Dear All,
    After Production Confirmation (101), stock is in QM and Insp Lot Status is REL. Still System is not allowing CO13 as well as CO11 with 102/262, saying "Change the inspection stock of <material> in QM only".
    Inspection Type: 04, 05 is activated for both Produced Material (101) and consumed material (261). We tried by removing 05 inspection type for both Materials.
    Above error message appeared for Producted Material (101).
    Ideally, System should allow to cancel Production Confirmation when stock is in QM with REL status.
    Request to guide what went wrong.
    Regards,
    Tanuj Parikh

    Dear All,
    Issue solved as per Note: 48815.
    Regards,

  • Reg. MFHU Production confirmation cancellation

    HI All,
    I have an requirement to cancel the production confirmation happened via MFHU.Please let me know what is the process and steps to be followed.
    My process is I have booked production confirmation in MFHU by Inputing the Handling unit.
    Now I want to cancel it the reson because during confirmation one of my SFG is issued in wrong UOM that is instead of KG it was issued in EA hence the wrong goods issue of SFG was happened. So I need to correct those stock entries.
    Please guide me how i can achieve this.
    For eg. FG has 3 Components 1 SFG and 2 RM
    here FG and SFG are batch managed.
    FG has handling unit.
    BOM Proportion for FG
    To produce 10 ea of FG i need
    SFG - 10 kg
    RM1 - 5 pc
    RM2- 5 pc
    Now i did production confirmation via MFHU, my baclflush has posted FG with 131 for 10 EA and the SFG as 10 EA instead 10 KG and rest two RM1 and RM2 as 5 PC.
    The SFG has posted wrongly here due to that my stock shows incorrect figures, hence i need to correct those SFG from10 EA to 10 kg.
    How do i do that? Kindly advice
    As i am new to Handling unit confirmation, please explain me in detail to achieve the above functionality.
    Also tell me what is process to cancel the entire Production confirmation of MFHU, I tried MF41 but it is not allowing me to cancel by saying the error- Few material could be Handling unit managed hence not possible to cancel.
    Though we cancel the MFHU posting, again if we try to book the production confirmation via MFHU we don't have option to correct the components as like we have in MFBF - post with correction.
    Kindly advice.
    Regards,
    MBN.

    Hi,
    In AFRU table, there is the STZHL field (Confirmation counter of cancelled confirmation)
    It's the confirmation counter of the original confirmation which was cancelled by the current confirmation.
    For example:
    Confirmation    Counter     STZHL
    1000                 1                blank
    1000                 2                1 --> this means that this is the cancellation entry for the line above.
    1000                 3                 blank
    I hope it helps.
    Regards,
    Marcelo

  • MFBF -Production confirmation through post with correction

    Hi Gurus,
    I am working on the Repeditive MFg Process. Actually our process is converting 25kg bult material into 7g sachet. so we are keeping this 25kg bulk materil as a raw material in 7g FG Bom and doing MD11, MF60 , and then MFBF using Assembly Backflush -post with correction.
    ISSUE is:
                    System not considering consumed quantity entered in production confirmation. It is rounding up.
    For Exp: While doing production confirmation, even though consumed quantity entered as 73 kg, but system rounding up to 75 kg (nearest multiples of 25 kg).
    Note : (Alternate Uom conversion is 1 Bag =25Kg in material master)
    How to get the exact consumed qty (UOM Kg) conversion to BAG .Like Consumed is 73 KG and the Bag conversion should be 73/25KG =2.92 Bag instead of rounding 73/25=3 Bag what we are getting now.
    Thanks,
    Manikandan.P

    Dear Manikandan,
    If my understanding is correct, then there is no meaning in maintaining the stocks of unit of measurement like bag,barrel,drums
    in decimal places.For eg a stock can be as 3 bag or 10 drum etc.
    Allowing decimal places through CUNI for these UOM is not recommanded.
    Check and revert back.(Also I guess there are similar issues that have been posted earlier,search and find the suggestions in
    those threads).
    Regards
    Mangalraj.S

  • Production order confirmation cancellation

    Hi
    Can any body suggest the process of prod order confirmationcancellation. In my case, the prod order was created and confirmed and goods movement 101 completed. Now If I want to post confirmation cancellation, how I need to proceed. Please suggest
    I tried to do it through CO13 and got error BK 888
    "Document incomplete -- transaction can not be executed"
    Please suggest

    Hi,
    For detaile error check in COGI t code.
    Arun

  • Reverse Production Confirmation After Usage Decision (UD)

    Hi All ,
                 We are using Quality Inspection Type 04 ("Good Recipt production Inspection ") . We have Done some wrong Entry in Production Confirmation after that quality person also did Usage Decision for the inspection Lot. now we want to cancel this confirmation . will some one help me how we can reverse UD (Usasge Decision) and Cancel the production confirmation .
    Thanks In Advance .
    Regards

    Dear Jaideep,
    Check out this,
    Do you mean to say you want to cancel the document for which 321 movement has been made where the stock has been
    cleared from quality to un-restricted?
    This is not possible,unless if you have used SAP notes,
    Note 1108313 - Cancelling usage decision and lot
    Note 175842 - Inspection lot: Reversal of goods movements from UD.
    Otherwise cancel the confirmation and the error movement 102 will be going to COGI.
    Do 102 through MB31 against that order and delete the 102 error from COGI.
    Check and revert back.
    Regards
    Mangalraj.S

  • Report for open orders and amount of product confirmed

    Hi All,
    Can some one give me an idea on a report which shows open orders and also shows amount of product confirmed against these open orders?
    Thanks,
    Neelima.

    Hi Veni,
    Incomplete order are the order's in which some data is missing so that particular order can't be further processed, that is what you could check through "Incompletion Log". Whereas Open orders are the orders which are open for further processing viz. deliver billing(but open order is a complete order i.e. no data missing).
    Check this program:
    *& Report ZGM_OPENPO *
    REPORT ZGM_OPENPO NO STANDARD PAGE HEADING LINE-SIZE 132 LINE-COUNT 36(2).
    TABLES: t001w, "Plants/Branches
    ekko, "Purchasing Document Header
    ekpo, "Purchasing Document Item
    marc, "Plant Data for Material
    mara. "General Material Data
    DATA:
    BEGIN OF itab OCCURS 0,
    matnr LIKE marc-matnr,
    werks LIKE marc-werks,
    beskz LIKE marc-beskz,
    mmsta LIKE marc-mmsta,
    END OF itab.
    DATA: BEGIN OF iekpo OCCURS 0,
    ebeln LIKE ekpo-ebeln,
    menge LIKE ekpo-menge,
    aedat LIKE ekpo-aedat,
    wemng LIKE eket-wemng,
    END OF iekpo.
    DATA: BEGIN OF iekko OCCURS 0,
    ebeln LIKE ekko-ebeln,
    lifnr LIKE ekko-lifnr,
    bedat LIKE ekko-bedat,
    ekgrp LIKE ekko-ekgrp,
    END OF iekko.
    selection-screen:begin of block b1 with frame title text001.
    SELECT-OPTIONS werks FOR ekpo-werks OBLIGATORY.
    SELECT-OPTIONS matnr FOR ekpo-matnr.
    SELECT-OPTIONS beskz FOR marc-beskz.
    SELECT-OPTIONS bsart FOR ekko-bsart.
    selection-screen:end of block b1.
    INITIALIZATION.
    AT SELECTION-SCREEN ON werks. "Validate for werks
    SELECT SINGLE * FROM t001w WHERE werks IN werks.
    IF sy-subrc 0. MESSAGE e429(mo). ENDIF.
    AT SELECTION-SCREEN ON matnr.
    SELECT SINGLE * FROM mara WHERE matnr IN matnr.
    IF sy-subrc 0. MESSAGE e429(mo).ENDIF.
    START-OF-SELECTION.
    SELECT * FROM marc INTO CORRESPONDING FIELDS OF TABLE itab WHERE werks IN werks AND beskz IN beskz AND
    matnr IN matnr.
    SELECT ebeln FROM ekpo INTO CORRESPONDING FIELDS OF TABLE iekpo
    FOR ALL ENTRIES IN itab WHERE matnr = itab-matnr AND loekz EQ space.
    SELECT ebeln lifnr bedat ekgrp FROM ekko INTO CORRESPONDING FIELDS OF
    TABLE iekko
    FOR ALL ENTRIES IN iekpo WHERE ebeln = iekpo-ebeln AND bsart IN bsart.
    SELECT ebeln menge aedat FROM ekpo INTO CORRESPONDING FIELDS OF iekpo
    FOR ALL ENTRIES IN iekpo WHERE ebeln = iekpo-ebeln. MODIFY iekpo INDEX sy-dbcnt.
    ENDSELECT.
    SORT iekpo BY aedat.
    DELETE ADJACENT DUPLICATES FROM iekpo COMPARING ebeln.
    SELECT wemng FROM eket INTO CORRESPONDING FIELDS OF iekpo FOR ALL ENTRIES IN iekpo WHERE ebeln = iekpo-ebeln.
    MODIFY iekpo INDEX sy-dbcnt.
    ENDSELECT.
    END-OF-SELECTION.
    DATA : file_name TYPE string.
    file_name = 'c:\pay_det\open_po1.xls'.
    DATA : BEGIN OF it_join_fields OCCURS 0,
    field_name(20),
    END OF it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'ebeln'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'menge'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'aedat'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    it_join_fields-field_name = 'wemng'.
    APPEND it_join_fields.
    CLEAR it_join_fields.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE =
    filename = file_name
    filetype = 'ASC'
    APPEND = 'X'
    write_field_separator = 'X'
    TABLES
    data_tab = iekpo
    FIELDNAMES = it_join_fields
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT iekpo.
    IF iekpo-menge NE iekpo-wemng.
    WRITE:/4 iekpo-ebeln,21 iekpo-menge ,46 iekpo-aedat, 56 iekpo-wemng.
    ENDIF.
    ENDLOOP.
    if sy-subrc 0. write / 'no data exist for this plant'. endif.
    TOP-OF-PAGE.
    uline 1(80).
    WRITE :/ sy-vline, 20 ' OPEN purchase ORDERs report' color 5,
    80 sy-vline.
    uline 1(80).
    WRITE:/ sy-vline , 4 'PURSCHASE ORDER' COLOR COL_HEADING,
    20 sy-vline, 21 'ORDER QUANTITY' COLOR COL_HEADING,
    45 sy-vline, 46 'item change' color col_heading, 55 sy-vline,
    56 'RECIEVED QUANTITY' COLOR COL_HEADING, 80 sy-vline.
    uline 1(80).
    END-OF-PAGE.
    WRITE :/ 'PAGE NUMBER' ,SY-PAGNO.
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • Restrict Authorization at Material level during production confirmation

    Hi SAP Gurus,
    I would like to ask if its possible to restrict authorization at Material Level during production confirmation.
    Our scenario is we have SFG and FG which are handled by different group of people but it has the same Order Type. Now we want to restrict authorization such as one department can only confirm SFG and the other department can confirm FG only.
    Is it possible to set authorization at material type or production scheduler level. IF not possible, is there other way except creation of new Order Type?
    Thanks,
    Raymond

    Hi Raymond,
    DO you mean I should create a customized table for this?
    Yes
    Are there no standard way?
    As per my knowledge, you can control through production order type, so you need to create seprate order type for this
    Thanks,
    Sankaran

  • Production Confirmation - Report

    Dear Sirs,
    I am doing production confirmation with a particular Scrap / Reject Qty. through CO11n / CO15.
    Client requires the following:
    1. Wants to Track the Scrap Qty. which is being posted.
    2. Wants to note down the Reasons of rejections and wants a report of the same.
    Do we have a Standard functionality for the above 2 points.
    Kindly help me in this regards,
    Thanks in advance,
    Harris Panchal

    Hi,
    Thanks.
    But if i do the same through QM, means that i have utilised All the resource in Production for All Qty. which is not the case.
    If i scrap the Qty. at the first opn. means the 2nd Opn is producing Qty. - (less) Scrap Qty.
    If i do through QM it would consider that all components manfactured are OK at prodn. which is not the case.
    Please revert back if i am wrong.
    Regards,
    Harris

  • Production order created through procurement wizard but purchase order connected in SO

    SBO Localization: Korea
    SBO Version:SAP Business One 8.82 (8.82.073) PL: 10
    Production order created through procurement confirmation wizard on the base of sales order. In sales order "Procurement document" field production order number showing correct. But if click on document arrow then same number of purchase order opening where as we expect that production order should open. This is something like connection bug. This happens only if sales order approval workflow is active. In relationship map we can see production order is connected. See details in attached pic.
    I have also tested this case in Belgium localization the result is almost same. The difference is only if clicked on procurement document number arrow (from sales order document) then different number of purchase order opens.
    Is this known issue? Could someone please provide me the solution?
    Yogesh Chaudhari

    Hi,
    It is application error. Please check SAP note:
    1718843 - Blank production order or purchase request displayed if
    “Procurement Doc.” selected in “Form Settings” window
    Thanks & Regards,
    Nagarajan

  • Can we do production confirmation withought routing

    Dear Sirs,
                   There are Sub asseblies(Phantom assembly) which get rejected in line ,we created routing for  each sub-aasly ,then manual confirmation (MFBF)& then reject those assembleis.
                   But in routing 11 it is calulated twice ...So how to handle this scnario

    Dear Sir,
    I am  new in SAP world  ...I am trying to explain once again ...Please dont hesitate to ask if you required more explanation
    We are Automobile manufacturing co. & having stages for each line.
    Production confirmation (131) is done once  at the end of line  so basically one routing is set  at  assly level .
                     But suppose in between line some assly is rejected or  suppose in assly there are 2 different parts 1 part is ok but because there is some problem in 2nd part  complete assembly is rejected & then we have to debit cost of complete assely to vendor who supplied 2nd part.
                    So  to handle such senarios for phantom sub-assly(E-50) we create  routing to get cost  ,then we confirm such sub-assly manually through MFBF ,create their stock in system & then reject.
                   We have routing 1,6 11 & Routing 11 is for cost roll up
    Now basically problem is that cost of subassembleis get calculated twice .As we have
    one work center -one routing - one production confirmation at he end of assly   so system calucalate  cost according to time mentioned in routing in which  we mentioned timing  of those  subassemblies(E50) also. but  as we create routing agasinst these sub asselibles(E50)  system  having double impact of routing .So how to handle this ...
    Regards,
    Satyajit

  • Error in production order cancellation

    hi all,
           i got an error message during production order confirmation cancellation.
    Confirmed activity must not be smaller than 0,Message no. RU033
    please suggest me what is the rigt way to solve the problem.
    details:
              i have two operation 20 & 40.
    20 - is final confirmed
    40 - is also final confirmed , i need to cancel it.
    regards
    nirmal

    Dear,
    When you enter operation confirmations you can also to enter negative
    activity quantities that are larger than the already confirmed actual
    activity of the already before entered confirmations.This problem can
    only occur when you entered the services in a unit that is not equal
    to the unit of the respective activity.
    If you want to enter a further confirmation, the system might issue
    message RU033 "Confirmed activity must not be smaller than 0 (check
    entry)".
    Or it could be due to program error. In that case we need to raise to SAP
    Regards,
    R.Brahmankar

  • Confirmation cancel

    hi
    iam have confimered the order ,after that i have cancelled confirmation of the  the operation,but in co02 still dlv stauts is there and in Delivered tab qty is there.and stcok is there .but in co14 i chekced the confirmation cancel goodsmovemnet tab,in that 102 movment is there for fert ,iam using control key automatic good recipt.wat could be the reason

    Hi,
    If you cancel a confirmation that triggered an automatic goods receipt then the cancellation tries to reverse the total quantity that was receipted.
    If enough material was issued in the time between the confirmation and the cancellation of the confirmation to take the stock level BELOW the receipt quantity and stocks of the material/storage location are not allowed to go negative (default behaviour) then the system is not allowed to post the 102 movement as this would take the stock level below zero.
    Any goods movement associated with a confirmation that fails to post is collected for further re-processing in transaction COGI.
    If you select "Individual Records" then you will get a line per material/production order. Once you are in the main transaction, select the line that you are interested in and click on the alarm clock to see what the error is. Typical errors are not enough stock, missing batch or storage location details, date in the past.
    If your missing movement is in COGI, you will need to make corrective action(s) in the system until you can save the line in COGI (which attempts to re-post the goods movement)
    Hope that has answered your question

  • Error at production order cancellation .

    Dear all ,
    I have posted same issue before this but due to technical problem i am not able to see your replies .
    So plz reply me again for the error at the time of production order cancellation .
    Production order has been confirmed for operation no 0010 , but some reason i want to cancel that . at the time of cancellation error is showing that .
    *enter only one true account .*
    Plz reply me again

    Hi
    If you have confirmed in CO11N, you should do cancellation in co13.
    you might have given by mistake the production order number in confirmation field.
    But you should input the production order number in the filed "order".
    Pl chk this .
    Regards
    YMREDDY

  • How to maintain scrap in Production Confirmation CO11

    Dear experts,
                            how to maintain the scrap qty in production confirmation , in CO11 there are two field  namely called as yeld qty and scrap, if enter scap qty here how system will calculate scrap  and what are all the setting to be done?
    regards
    rajakarthik

    Hi,
    In CO11 if you enter quantity in field scrap then system would scrap the quantity means no positive or negative entry of stock will be done.
    In SAP scrap stock in not maintained. If you enter scrap in that field then it will exhaust from SAP. You will not get that material in any form of stock.
    If you get fixed qty of scrap and you want to maintain the stock of it in different material then maintain that material with negative qty in BOM.
    When ever you do confirmation you will recieve the scrap material in stock through 531 movement.
    Regards,
    Vishal

Maybe you are looking for

  • Database link creation

    Hi i want to access the data from production to test let the production named as naren and other one as naren1 this link has been created in naren create database link test connect to naren identified by naren using 'test' conn naren1/naren1; i want

  • Duplicate records in input structure of model node

    Hi, Following is the way, I am assigning data to a model node: //Clearing the model input node for (int i = wdContext.nodeInsppointdata().size(); i > 0; i--)      wdContext.nodeInsppointdata().removeElement(wdContext.nodeInsppointdata().getElementAt(

  • Why cant i stream radio from this site?

    Hi all-- there is cool site that i like to stream radio from (armenian), and my MacBook Pro is not letting me. I was launching it from FireFox. Does anyone know why my MBP13 is not letting me? http://www.radiosevan.com/

  • Need info to find users who has multiple inbox i

    Need a query to find out all the users who are                                                               having multiple inbox in BoXI 3.0?

  • Material Ledger New Status - 05 "Period Opened Without Stock"

    Hello, We are thinking of implementing note 1120562 into our system and feel pretty comfortable so far, but I had one question that is stopping me.  If I implement this note and it applies the new status so that materials are not selected to run in t