Error while cancel Purchase Order

Hello everyone.
I'm trying to cancel a Purchase Order which has a Purchase Delivery Note.
First I cancel the Purchase Delivery Note and than I try to cancel the Purchase Order, but I'm having the following error: "The requested action is not supported for this object."
If I manually cancel the Purchase Delivery Note, I can successfully cancel the Purchase Order by code.
Here is the code I'm using:
Documents lDocumento = Globals.AddOn.ConexaoAuxiliar.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes);
lDocumento.GetByKey("DocEntry");//DocEntry is just an example
Documents lCancelamento = lDocumento.CreateCancellationDocument();
if (lCancelamento.Add() != 0)
     throw new Exception(Globals.AddOn.ConexaoAuxiliar.GetLastErrorDescription());
Then I try to cancel the Purchase Order:
Documents lDocumento = Globals.AddOn.ConexaoAuxiliar.GetBusinessObject(BoObjectTypes.oPurchaseOrders);
lDocumento.GetByKey("DocEntry");//just an example..
if (lDocumento.Cancel() != 0)//if can't cancel, try to close
     if (lDocumento.Close() != 0)//if can't close, show error..
          throw new Exception(Globals.AddOn.ConexaoAuxiliar.GetLastErrorDescription());
SAP 9 PL 10

Hi Leandro,
Sorry, I missed that bit. But that brings to mind, you create the cancellation document, but apparently you do not explicitly cancel the purchase delivery note.
Could you please test that ? So for example:
if (lCancelamento.Add() != 0)
  if (lDocumento.Close() != 0)
//etc.
Could you also please test commenting out the code that closes the purchase order, and then check from the B1 client that the delivery was closed and linked to a Returns document ?
Regards,
Johan

Similar Messages

  • Error while saving purchase order

    Hi all,
    While saving purchase order i am getting the following error.
    Syntax error in program SAPLV61A
    in include RV64A932
    in line 10
    Statement"*&"is not defined.check your spelling.
    Thanks& Regards,
    Hari.

    Hi Hari,
    I've just encountered the same problem as you have now in your latest post.
    Normally the include that you mentioned is a formula condition value include which you can modify but you probably have
    to register this object first on the SAP OSS pages to get an Access key to modify it.
    After you've obtained a key launch transaction VOFM and comment out the line "TABLES: VBRK, VBAK".
    As you see below SAP did exactly the same thing in several other includes.
    Include FV64A582
    -> is a formula condition value
        tx VOFM
                -> Formulas
         -> Condition Value
         -> Routine number 582
    At line 37 I commented out "TABLES: VBRK, VBAK." which is not used
    anyway in this include.
    On top of that SAP commented out these definitions in several other
    includes: eg. FOICH002, FOICH002, OI_LV61ATOI.
    If other persons have comments on this topic please respond/advise.
    Hari, inform us if this resolved your problem.
    Also reward points if my post aided you in resolving your issue.
    Thank you for feedback.
    Best regards,
    Tom Cockaert.

  • G/L Account Error While doing Purchase Order In ME21N

    Hi,
    While Doing Purchase Order in ME21N,i am getting the below error.Kindly help me.
    G/L account 809001 cannot be used (please correct)
    Message no. ME045
    Diagnosis
    Comparison of the field selection strings from the G/L account 809001 and the account assignment category F reveals that there is an incompatible combination of field selections for the field selection group 'Network'.
    The G/L account field selection is stored in table T004F; that for the account assignment is stored in table T162K.
    Procedure
    Please enter a correct G/L account.
    Thanks
    Supriya

    Hi Supriya,
    U will have to check the field status of account assignment category F in tcode OME9 and compare it with the Field status group that is assigned to GL 809001.
    Kindly note that the field status has a prority in the following order.
    Supress
    Display
    Required
    Optional
    Thus if the network field is suppressed in GL field status and option in account assignment category F, then the below error would come.
    Regards,
    Kiran

  • Error while creating purchase order with account assignment category "A"

    Dear All,
                      At the time of creating purchase order with account assignment category A - Asset its throwing error as " GL Account 123400 can not be used"
    how to resolve this  issue"
    Edited by: Matt on Sep 16, 2010 10:09 AM - removed bold tags

    HI,
    Assign all assets GL to Asset Class
    spro --> financial accounting new -->assets accounting --> assets accounting (lean Implementation) --> organization structures --> Assign GL
    Hope Help U !
    Regards,
    Pardeep Malik

  • Error while transferring Purchase Order from ECC to SUS

    we are working on plan driven procurement and transferring the PO from ECC to SUS, we are getting the error as "No partner found for partner number ECCSUS8".
    In ECC the Vendor No is ECCSUS8, trasfered vendor from ECC to SUS. Vendor registration is done based on the mail generated and vendor login is created in the portal and assigned the roles.

    Hi
    Are you facing this error in PO transmission to SUS (as you mentioned below)? or you are facing this error while sending out the vendors from R/3 to SUS from BD14?
    If you are facing this in vendor transmission, you need to remove the tick (flag) "Use self reg component" in SPRO-SRM server-Supplier Self-ServicesMaster DataMake Settings for Business Partners. Then you can transmit the vendors from R/3 succesfully.
    If this error is in PO transmission, need to analyse further.
    Pls do let me know.
    Thanks
    Kiran

  • Error while posting purchase order invoice in microsoft dynamics ax 2012

    Hii friends,
    we are getting Excise record type is should not none while tax codes are calculated. but we have selected that Excise record type also we are getting
    same error. please help to solve this problem.

    Hi Chintan,
    But when my functional consultant was able to process same PO, by using the MIRO transaction and he was able reversal the same Invoice..
    The Functional Consultant gave me the amount and input details..  (He was able to using the standard transaction MIRO) Which i am hardcoding through the segments which are mandatory.
    When i try to do it through the IDOC process, where i am currently hardcording few values in the segments in we19 transaction and execute the same.
    Please let me know if there is any other process.
    Thanks
    Sunil Kumar

  • Error while creating Purchase order

    Hi Experts,
    No posting rules exist for account key
    Message no. FF714
    Diagnosis
    No posting rules have been defined for the account key in the tax table in table T007B.
    Procedure
    Change the tax table, enter an account key already defined for the transaction in question or define the posting rules for a new account key in table T007B.
    I have maintained all account keys in Tax Procedure.
    Plz let me y this error is coming.

    Hello,
    Goto T.Code OB40.
    Select the account key you have mentioned in your calculation procedure, and give your Chart of accounts.
    Then goto 'Rules' Tab and maintain the fields (against tax code or not) against which you want to maintain G/L accounts for tax processing.Save the entries and try the transaction again.
    Regards
    Gregory Mathews

  • Error while Changing Purchase Order quantity

    Hi experts,
            I am doing a BDC so that it should change the invoice quantity by the Received quantity, and also if the received quantity is 0 it should delete that particular Line item. It is doing well for the above, but i am getting stucked in a po number withe following error,
    "Quantity delivered differs from qty. invoiced (Function not possible)". Can any one please help me in this issue...
    thanks ,
    Ajeeth

    you can only set a deletion indicator if invoiced quantity and received quantites are equal.
    check the PO history in PO item detail , there you can see how much you received and how much was invoiced.
    Maybe you missed to clear GR/IR account with MR11

  • Error while Cancelling a PO Line

    My user faces a problem while Cancelling a PO Line.. here i explain the whole scenario..
    One PO with only one PO line was created by Autocreate from a Requisition with one line in a financial period 10 months before.
    Now, it is found that Ship-to Org was wrongly entered.. so now they created another same PO Line with correct
    Ship to Org.. and now wants to Cancel the wrong Po Line..
    But while doing so, an Error Comes,
    APP-PO-14056: User Exit #PO REQUEST_ACTION returned error
    Cause: #PO REQUEST_ACTION encountered an internal error.
    Parameters:
    REQUEST_ACTION,CANCEL,PO,STANDARD,998802,209526,227116,0,GLOBAL.info_request_fie
    ld,GLOBAL.status_field,GLOBAL.online_report_id,GLOBAL.return_code,REASON,CANCEL_
    REQS,ACTION_DATE,USE_GLDATE
    and Cancellation is not done...
    Please help..

    Hi,
    Please see these docs.
    System Hang When Try To Cancel Po Shipment - APP-PO-14056: User Exit #PO REQUEST_ACTION returned error [ID 413193.1]
    Rls11i - PO- POXDOCON.pld - Unable to cancel PO. APP-PO-14056: User Exit #PO REQUEST_ACTION returned error [ID 247418.1]
    APP-PO-14056 User Exit #PO Request_action Returned Error While Cancelling Planned PO Shipment [ID 303488.1]APP-PO-14056 User Exit #PO request_action returned error. While cancelling Purchase Orders with received quantity equal to ordered quantity . [ID 209591.1]
    After Patch, While Cancelling Purchase Order Get Error APP-PO-14056 [ID 563384.1]
    Receiving Error APP-PO-14056 When Trying to Cancel a Purchase Order [ID 142793.1]
    APP-PO-14056 When Cancelling a Blanket Purchase Agreement Shipment or its related Blanket Release Shipments [ID 398379.1]
    Cancelling Purchase Order Returns Error APP-PO-14056 [ID 371571.1]
    APP-PO-14056 User Exit #Po Request_action Return Error When Cancelling A Purchase Order [ID 848598.1]
    Cancel or Unreserve of Scheduled Release is Unsuccessful APP-PO-14056 [ID 300105.1]
    APP-PO-14056 When Canceling Release [ID 562673.1]
    Thanks,
    Hussein

  • Error in posting purchase order delivery

    Hi
    I got an error while posting purchase order delivery through Tcode- MIGO
    This is the Error Message:
    Posting only possible in 2009/04 and 2009/03 in company code XXXX
    I checked everything Fiscal year variant,Posting period variant,etc.
    And in Tcode- OMSY.
    Let me know as early as possible how to solve this issue.
    Thanks and Regards,
    Deepthi.

    Hi Deepthi,
    You need to understand that posting periods 3 and 4 does not necessarily mean march and april in SAP.
    Check your fiscal year variant for the months which correspond to periods 3 and 4.  Then you will be able to solve your problem by yourself.
    Open and close periods in FI -  OB52
    Close periods and open new periods in MM Side - MMPV
    Hope this helps you....
    Regards,
    Sreekanth....

  • PO doesnot exixt while creating purchase order

    Hi all,
    I am getting an error while creating purchase order that " PO number doesnot exist".
    When I repeat creating it, PO with next number is getting created.
    What could be the reason for this?

    Use SM13 and check if you have any entry for the update failure. If yes, analyse with tech person,

  • Error message while viewing Purchase order summary

    Hi all,
    we are in 11.5.10.2 , we are getting error message while viewing purchase order "Currency formatting cannot be performed without a currency code".
    is it beacuse of currency not popluated in Purchase order?
    Verified metalink note - 960504.1
    Thanks
    Kiran

    Hi Kiran,
    Verified metalink and other areas but could not get any appropriate solution.
    I tried to reproduce the issue in various available environments...but no luck!
    My guess would be the datafix/BUG that you have referred in the MOS note 960504.1
    Please check with your DBA for this patch in test instance.
    Thanks
    -Arif.

  • Deleated Valuation Type --Need Error Message while creating Purchase Order

    Hi,
    In our scenario , i need a message should flash , if enduser by mistake select the deleated valuation type while creating Purchase Order.
    In current configuration , it's not there.
    Await your expert opinion.
    Regards
    Shyam Kogta

    I investigated this recently in our company and gave this answer:
    A deletion flag does not restrict anything. It is just an indicator to tell SAP that you want this record to be deleted with the next archiving run.
    The archiving run then checks if a deletion is possible or not.
    So you can set such deletion flags long time in advance, even at a moment where you still have inventory.
    To block materials from beeing used in business transactions, usually the material and sales status are used. But these statuses can only be set at overall, plant and sales organisation level.  
    In some transactions SAP issues warning messages if a material has a deletion flag. This messages could be customized to be an error and prevent any business. However, this type of restriction is not designed for our machine, as we use the material and sales status.
    Anyhow, there is no message for valuation types that have a deletion flag in procurement area.
    There is one for goods receipts (but only for a certain industry solution that is not used by us)
    There is one for deliveries ( VL 211 ).
    The valuation types are defaulted from customizing to the transaction e.g. purchase order. Or from info record to the PO. So a standard purchase order gets valuation type  ABC , while an internal order (production) gets the DEF.  Usually there should not be a need to change this valuation type manually.
    So the only solution is to archive the material master at valuation type level.
    But I guess, you already have POs with that wrong valuation type, which means you have to archive the POs first. It you have already batches with wrong valuation type, then thy have to be archived as well before a material can be archived.
    And finally if you had stock in current year, then you can archive your material in year after next year, as SAP archives only materials that have no stock in current and previous year.

  • "Document doesnt exists error" in MM while changing purchase order

    While creating purchase order document number gets created but when i view the created document in me22 it shows the error "Document doesnot exists".can anyone help me in this issue
    Regards,
    Ramesh

    HI
    After creaating order check it in VBAK.
    Aditya

  • While creating Purchase order the system is showing error: vendor 200001145

    Hi experts,
    while creating Purchase order the system is showing error: vendor 200001145 on line 00010 for ctype ZB12 not defined as head office vendor.
    Plz  give solution for this.
    Thanks&Regards
    sreenivas

    Hi,
    Please check vendor schema maintained in the vendor master,. through this condition type arepicking from system
    Aboue condition type not mainatained inthe caluation schame ,which you assigend to vendorand purchasing organization
    regards
    Channa
    Edited by: channadodawad on Dec 3, 2009 9:22 AM

Maybe you are looking for