'BAPI_PRODORDCONF_CANCEL" for cancelling confirmation

Hi,
We are using customized report for Production order confirmation . Below are steps
1. Goods issue
2. Calling transaction Co11 for confirmation (BDC)
3 Goods receipt using BAPI_GOODSMVT_CREATE
while running the program , it throws the "Order processed by RFC_USER" . We have tried enquque, dequeue , wait  but error pops up randomly.
We have carried out few steps but still we are getting error sometimes.
The issue is that goods issue & confirmation is happening but not goods receipt hence we are  are now trying to revert the goods issue & confirmation through "BAPI_PRODORDCONF_CANCEL" .  i have pasted my code , please  suggest if by using "BAPI_PRODORDCONF_CANCEL"
will it  revert goods issue & confirmation .
SELECT RUECK RMZHL
   from AFRU
   INTO IT_AFRU
  WHERE   AUFNR = zaufnr
AND ERNAM = Sy-uname
AND ERSDA = sy-datum . 
SORT IT_AFRU descending RUECK RMZHL.
   DO N Times.                                                                                                    " N=2
               CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
                 EXPORTING
                   goodsmvt_header  = ls_goodsmvt_header
                   goodsmvt_code    = ls_goodsmvt_code"'02' "ls_goodsmvt_code
                 IMPORTING
                   goodsmvt_headret = ls_goodsmvt_headret
                   materialdocument = lv_materialdocument1
                 TABLES
                   goodsmvt_item    = lt_goodsmvt_item1
                   return           = lt_return.
               CLEAR : IT_ENQ, IT_ENQ[],wa_enq.                
               READ TABLE lt_return INTO lwa_return WITH KEY type = 'E'.
               If sy-subrc  = 0  .
                 Count = Count + 1.
                 IF Count < N .
                   CLEAR : ls_goodsmvt_headret,lv_materialdocument2.
                   CLEAR : lt_return, lt_return[].
                 ELSE.
   READ TABLE IT_AFRU into WA_AFRU index 1.
                  CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL'
                    EXPORTING
                      CONFIRMATION              = WA_AFRU-RUECK
                      CONFIRMATIONCOUNTER       = WA_AFRU-RMZHL
*                    POSTG_DATE                =
*                    CONF_TEXT                 =
                   IMPORTING
                     RETURN                    =   ZRETURN
                     LOCKED                    =  ZLOCKED
                     CREATED_CONF_NO           =  ZCREATED_CONF_NO
                     CREATED_CONF_COUNT        =  ZCREATED_CONF_COUNT
                ENDIF.
               else .
                 EXIT.
               ENDIF.
*              READ TABLE lt_return INTO lwa_return WITH KEY type = 'E'.
*              If sy-subrc  NE 0  .
*                EXIT.
*              ENDIF.
             ENDDO.

I am getting error while cancelling the confirmation "Order Processed by RFC_USER"
But it goes to BAPI_TRANSACTION commit but the problem is confirmation is not cancelled(commit does not happen) .
when i try putting breakpoint in bapi_transaction_commit , may be while debugging it gets more time and
then confirmation is cancelled only during debugging . Please help me with below code to cancel confirmation
CALL FUNCTION 'BAPI_PRODORDCONF_CANCEL'
                          EXPORTING
                            CONFIRMATION              = WA_AFRU-RUECK
                            CONFIRMATIONCOUNTER       = WA_AFRU-RMZHL
                 POSTG_DATE                = sy-datum
*                    CONF_TEXT                 =
                         IMPORTING
                           RETURN                    =   ZRETURN
                           LOCKED                    =  ZLOCKED
                           CREATED_CONF_NO           =  ZCREATED_CONF_NO
                           CREATED_CONF_COUNT        =  ZCREATED_CONF_COUNT.
If SY-SUBRC = 0 .
                         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                           EXPORTING
                             wait = 'X'.
                       ENDIF.

Similar Messages

  • Function Module for cancelling confirmation

    Dear all,
    Can u please tell me the function module used for cancel confirmation in cn29?
    Regards,

    Hi Kumar,
    For excuting the Fuunctional module  BAPI_NETWORK_CONF_CANCEL abaper has to write some coding. Discuss with your abaper on this.
    For more details on coding search in ABAP fourm.
    Regards,
    Nag.

  • Cancel Confirmations for Limits Orders in SRM.

    We are able to Create Confirmations in SRM for Limit orders and It creates a service entry sheet in ECC with Mvmt Type 101.. When we try to cancel these Confirmations from SRM. It a creates a Cancellation document in SRM but it doesnu2019t flow to ECC.. when Checked in the Shopping cart Related documents it is found that the Qty is getting added up even for cancelled Confirmation which got created.
    We are looking for Solution if we cancel the limit order confirmation from SRM , it should cancel the service entry sheet posted in backend ECC..
    And we will be doing confirmations/Cancellations only from SRM
    Please help us with your responses.. we are on SRM 7.0 EHP 1 .

    Hello,
    We have faced same issue in SRM 5.0
    We created a custom program for it using RFC FM BBP_entrysheet_cancel  we have to cancel the Entry sheet in  backend.
    Regards,
    Neelima

  • Reg BAPI to be used for cancellation of GI/GR

    Dear Experts,
    The requirement at our client side is , Through control recipe messages process order numbers and material details are sent to MES system and the Goods issue, confirmation and Goods receipts are taking place in MES and data is transferred to SAP via a middleware .
    What is the BAPI to be used to pass the message  cancel the Goods issue or Goods receipt document in middleware to SAP
    What is the BAPI to be used to pass the message of cancellation of confirmation from Middleware to SAP
    Thanks in advance
    Regards
    venkat

    Dear Venkat,
    for cancelling GI/GR you may use BAPI_GOODSMVT_CREATE with GM_Code 06
    for cancelling confirmations you may use BAPI_PRODORDCONF_CANCEL
    Regards, Andreas

  • User-exit for transaction co13: PP Order Cancel Confirmation

    Hello!
    Whether prompt, please,
    exist what that user-exit for transaction co13: PP Order Cancel Confirmation?
    Thanks,
    Anton.

    Hi Antonio,
    Please check this all user exits (SMOD) available for CO13.
    CONFPP01  -  PP order conf.: Determine customer specific default values 
    CONFPP02  -  PP order conf.: Customer specific input checks 1           
    CONFPP03  -  PP order conf.: Cust. specific check after op. selection   
    CONFPP04  -  PP order conf.: Customer specific input checks 2           
    CONFPP05  -  PP order conf.: Customer specific enhancements when saving 
    CONFPP06  -  PP Order Confirmations: Actual Data Transfer               
    CONFPP07  -  Single Screen Entry: Inclusion of User-Defined Subscreens  
    CONFPS01  -  PS confirmation: Determine customer specific default values
    CONFPS02  -  PS confirmation: Customer specific input checks 1          
    CONFPS03  -  PS confirmation: Customer specific check after op. selection
    CONFPS04  -  PS confirmation: Customer specific input checks 2          
    CONFPS05  -  PS confirmation: Customer specific enhancements when saving
    CONF0001   -  Enhancements in order confirmation                         
    CONFPI01   -   Process order conf.: Calculate cust.specific default values
    CONFPI02   -   Process order confirmation: Customer spec. input checks 1  
    CONFPI03   -   Process order conf.: Cust. spec. check after op. selection 
    CONFPI04   -   Process order conf.: Customer specific input checks 2      
    CONFPI05   -   Process order conf.: Cust. spec. enhancements when saving  
    CONFPI06   -   Process order confirmation: Actual data transfer           
    CONFPM01  -  PM/SM order conf.: Determine cust. specific default values 
    CONFPM02  -  PM/SM order confirmation: Customer specific input checks 1 
    CONFPM03  -  PM/SM order conf.: Cust. spec. check after op. selection   
    CONFPM04  -  PM/SM order conf.: Customer specific input check 2         
    CONFPM05  -  PM/SM order conf.: Cust. specific enhancements when saving 
    Regards,
    Ferry Lianto

  • Mass change for field Confirmation control Key in PO / SA

    Dear All,
    There is a need to do mass change in value for field Confirmation control Key in PO / SA. Some of them have PO history. If we have PO history system wont allow to change conf. ctrl key. Also since it is a production system we can not cancel previous po histories. This is in SAP 4.7 where we dont have mass change tcode for Scheduling agreements.
    Can we maintain the values thru table entries. like using se16n maintain entries check box. This option is greyed out. can we activate that & do this requirement.
    please suggest.

    hi Greetings!
    The confirmation control key can not be changed in the scheduling agreement if GR for item had already been posted. If the GRs can be canceled , it is possible to change the confirmation control in the SA item.
    Version 4.7 do not support Mass change of scheduling agreements, hence you have to either create a SCAT or BDC to perform the task.
    Gobinathan G

  • How to do batch cancel confirmation

    Hi:
    guru, I can use C013 to cancel confirmation one operation by one operation. can i cancel all confirmation of one  production order or severel production orders just one step. is there any solution for Standard SAP.

    Hi Wang,
    Use CORS to reverse the phases.
    After canceling if you want to view it again then use CORT (here there is one check box named 'Reversed' means that phase is reversed).
    If there is a Inspection lot in between then you need to use customize program to cancel the usage decision.
    regards,
    Chintan

  • Smartform print program for order confirmation

    Hi experts.
    I am looking for a smartform print program for order confirmation.
    The order confirmation in standard is a script with the name RVADOR01 and I tried to copy and change but I don't know which to eliminate and whcih to keep it.
    If any body written the program already please provide me or provide the link to check.
    Thanks in advance
    Sai

    this is the processing form.
    form processing.
      data: lf_fm_name            type rs38l_fnam.
      data: ls_control_param      type ssfctrlop.
      data: ls_composer_param     type ssfcompop.
      data: ls_recipient          type swotobjid.
      data: ls_sender             type swotobjid.
      data: lf_formname           type tdsfname.
      data: ls_addr_key           like addr_key.
      data: document_output_info type  ssfcrespd,
            job_output_info type ssfcrescl,
            job_output_options type ssfcresop.
      perform get_data.
      check retcode = 0.
      perform set_print_param using      addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         retcode.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        message e001(/smb40/ssfcomposer).
      endif.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
        exporting
          formname           = lf_formname
        importing
          fm_name            = lf_fm_name
        exceptions
          no_form            = 1
          no_function_module = 2
          others             = 3.
      if sy-subrc <> 0.
      error handling
        retcode = sy-subrc.
        if sy-subrc = 1.
          message e001(/smb40/ssfcomposer).
        endif.
        if sy-subrc = 2.
          message e002(/smb40/ssfcomposer) with lf_formname.
        endif.
        perform protocol_update.
      endif.
      call function lf_fm_name
        exporting
          archive_index        = toa_dara
          archive_parameters   = arc_params
          control_parameters   = ls_control_param
          mail_recipient       = ls_recipient
          mail_sender          = ls_sender
          output_options       = ls_composer_param
          user_settings        = ' '
          is_nast              = nast
          is_vbdka             = vbdka
          is_addres            = addr_key
        importing
          document_output_info = document_output_info
          job_output_info      = job_output_info
          job_output_options   = job_output_options
        tables
          it_vbdpa             = tvbdpa    "Item information
          it_vbdpau            = tvbdpau   "Subitem numbers
          it_vedpa             = tkomservp  "Contract Item Validity
          it_vedka             = tkomservh  "Contract Header Validity
          it_vedpn             = tkomservpn "Contract Item Cancellation Data
          it_vedkn             = tkomservhn "Contract Header Cancellation DA
        exceptions
          formatting_error     = 1
          internal_error       = 2
          send_error           = 3
          user_canceled        = 4
          others               = 5.
      if sy-subrc <> 0.
        retcode = sy-subrc.
        perform protocol_update.
    get SmartForm protocoll and store it in the NAST protocoll
        perform add_smfrm_prot.
      endif.
    endform.                    "processing

  • Reversing a cancelled confirmation in SRM 4.0

    We are currently running SRM 4.0 in an extended classic setup.  We have had many questions about reversing a cancelled confirmation in SRM 4.0 once it has been cancelled. 
    Some user who are very familar with SAP recognize this functionality extend in SAP but are seeing that this is not the case for SRM 4.0. 
    Currently when a confirmation has been cancelled in SRM 4.0 is there any way to reverse the cancellation?  Is this functionality available in SRM 5.0?

    Hi,
    See the foll link:
    http://help.sap.com/saphelp_srm50/helpdata/en/d1/77623c44696069e10000000a11405a/frameset.htm
    BR,
    Disha.
    Pls reward points for useful answers.

  • Can i cancel confirmation without goods movement?

    when i cancel confirmation (co13) it will default auto reverse goods movement 102. but material are not in stock and then COGI will occur.
    does anyone know any T-code to cancel confirmation without goods movement? because i want to cancel just activity.
    thank you all.

    Hi,
    If your are cancelling the operation which is having the the Control Key : PP03 (auto GR) then only system will try to reverse the Goods Movement (Movt Type 102)., And if the material is not in Stock (sloc) then system will through the Goods MOvt failure and same can be seen in COGI and COrrected later, once the stock comes in Sloc.
    There is NO Seperate transaction for just cancelling the Operation (Activity) without reversing the Goods Movement. Even it is not logical to do so as it may show as Negative WIP for the Order.
    Hope this will help you.
    regards
    radhak mk

  • Partially cancel confirmation relating to WM

    Hi all,
    Please help with this business case:
    After confirming a process order, components are auto GI from Production Sloc, stock is auto GR into Finished Goods (FG) Sloc; a TO is auto created and auto confirm with 2 Storage Unit (SU) 1001 & 1002, from Storage type 901 to s.type 302 in FG Warehouse.
    Then we transfer these two pallets to BoF Warehouse and export pallet 1001 to another plant, pallet 1002 stays in BoF WH.
    Afterward, we find that pallet 1002 was over - confirmed, and need to be canceled.
    The problem is we cannot pull pallet 1001 back because it's already received by another plant, so we can only partially cancel confirmation of pallet 1002.
    My question is: Is it possible to partially cancel confirmation for pallet 1002? if yes, how to do that?
    Thank you very much,
    Duc.

    Hi Mario,
    Actually I cannot fully understand your answer. I've tested this way:
    1/ using COR6N (as we previously confirmed by COR6N), yield qty = qty in 1 pallet, change 101 to 102 for finished goods & all components, then post.
    2/ Manually reverse the GI of components that were not backflushed
    3/ After step 1, a TR is auto created. Create TO from this TR, storage unit number = SU number we want to cancel. This TO is auto confirmed after creation. After this step, stock has already been adjusted at WM level.
    Using this way,  stock of FG & components at IM and WM level are okey. It's seem that there's no problem, which mean we can use this procedure to cancel partially.
    Is there any thing risk when using this? Do you have any advise?
    Regards,
    Ba Duc.

  • WM  how to cancel confirmed Transfer Order

    Hi,
    I am new to WM, can you please tell how to cancel confirme Ttransfer order in WM.
    for example if post goods issues is compleated for delivery then the Transfer order will be created and the Trnasfer order confirmed manually, now  how to reverse or cancel the Transfer order.
    please advice
    Regards
    Kumar

    If the goods receipt is created, for example goods receipt for purchase order.After receiving the goods then we will putaway the stock by confirming transfer order.
    If we want to reverse the goods receipt then how to cancel the To.
    Pls advice
    First you should reverse the GR and then (based on settings in IM-WM interface) a new TR will be created and processing that TR (e.g. from trx LB10) you will create a NEW TO (stock removal TO).
    Regards,
    Csaba

  • Excise Invoice Tab is not display in MIGO for Cancelled document

    Hi,
    We are execuating the incoming excise cycle then in MIGO and J1IEX.It is perfectly working.But in case of cancellation the excise tab is not dispplaying in MIGO.We are using option "Only Capture and Both Capture & Post".Whatever the excise captured and Posted , it is updated in Excise Invoice tab in MIGO.
    As per my understanding the excise tab should come for cancelled doucment also.
    Regards
    Rajev

    Hi,
    You are correct it won'y come for 102 but it will come for 101.But it is not coming for 101 .It is not coming when we cancelled the document.
    but it will come for 101
    .But it is not coming for 101
    can you explain your statement  ?
    If it is not coming for 101 movement type
    check following point
    1) tax code in PO ,all excise condition should be there
    2) Maintain chapter ID material combination in J1ID
    3) Maintain Vendor and Plant excise details in J1ID
    Regards
    Kailas Ugale

  • Accounting Document not posted for Cancelled Invoice -error in FI interface

    Hi,
    When I create a billing document then an accounting document gets created automatically in the background and then when I cancel the billing document no accounting document gets generated and the field Posting Status in header Detail of Billing document updated as "Errors in Financials Interface.
    I tried to release it for Posting via VFX3 but failed due to below error message in Log:
    "Incorrect doc.no.: 4900000005. Select document number between 3000000000 and 3099999999"
    I have checked the Number range assignments to the Invoice type and Accounting type.
    The number range is same for both Invoice type (Y0F2) and Cancelled Invoice type (Y0S1).
    The Accounting document type (RV) is also same for both the cases. But it is working fine for Y0F2 (Acounting document generated and cleared automatically). But not working fine for Cancelled Invoice (Y0S1).
    Can anybody please help me find out a solution to the issue.
    Thanks, Ram.

    Hi,
    The error message F5151 refers to the number range of the FI document.
    Please have a look at the note 1259505: FAQ: New cancellation procedure in SD, which covers this issue in detail.
    Question 5:
    Q5. What is the FI document type, generated by the cancellation ?
    In the old cancellation procedure, the FI document type is always
    determined in SD, and passed to FI (the same when a normal invoice  -
    not a cancellation -  is transferred to accounting).
    In transaction VOFA there is the field 'Document type' (TVFK-BLART).
    If this field is filled, then the FI document will have the document
    type maintained here.
    If TVFK-BLART is empty, then the FI document will get the default
    document type 'RV'.
    If the new cancellation procedure is performed, the FI document type is
    always determined in FI, based on the document type of the FI document
    to be reversed.
    In transaction OBA7 the FI document type has assigned the field 'Reverse
    document type' (T003-STBLA).
    If it is filled, then the FI cancellation document will get the document
    type maintained here.
    If T003-STBLA is empty, then the FI document cancellation will get the
    same document type as the cancelled FI document.
    Notice that an unexpected FI document type can cause the error message
    F5 151.
    Example:
    F2 invoice 90000001 was released, creating an accounting document with
    document type 'RV'.
    This F2 invoice is reversed by the S1 billing document 70000001.
    In customizing of SD there is:
    Billing Type    Document Type
    F2              RV
    S1
    In customizing of FI there is:
    Document Type    Number range   Reverse Document Type
    RV               00             AB
    AB               01             AB
    The FI number ranges (object RF_BELEG) are:
    No  From number    To number   Ext
    00  0090000000     0099999999  X
    01  0100000000     0199999999
    Different situations can occur, due to these customizing settings of the
    FI document type, caused by the type of cancellation.
    If the new cancellation is used:
    The FI document type 'RV' has 'Reverse Document Type' = 'AB'.
    Document type 'AB' has number range '01' set as internal.
    So the FI document will have its own number included in
    100000000-199999999.
    There is no issue.
    If the old cancellation is used:
    The cancellation billing type S1 has no 'Document type' maintained, so
    the FI document will get document type 'RV'. It has number range '00',
    set as external number range.
    So the FI document should get the same number of S1 billing document.
    But the S1 billing document has number 70000001, not included in the
    interval of number range '01'.
    This will cause error F5 151.
    I hope this information helps you.

  • Can we combine Query for cancelled requisitions and query for internal requisitions without internal sales order into a single query

    Hi All,
    Greetings.
    I have two queries namely,
    1.Query for cancelled requisitions and
    2.Query for Internal Requisitions without Internal Sales Orders.
    I was on a task to combine those two queries..
    Can we do that? if so, please help me do that..
    Thanks in Advance,
    Bhaskar.

    Hi All,
    Greetings.
    I have two queries namely,
    1.Query for cancelled requisitions and
    2.Query for Internal Requisitions without Internal Sales Orders.
    I was on a task to combine those two queries..
    Can we do that? if so, please help me do that..
    Thanks in Advance,
    Bhaskar.

Maybe you are looking for