Copy A/R Draft Invoice to Invoice

How do we convert open draft A/R Invoice to Invoice ?
If any one can help me with the code...

I think I read somewhere that this feature was being added in 8.82, but there is not any way of doing it easily through the DI-API in current versions.
Here is a sample from the SDK help to do it through XML.
This sample saves a draft document to xml and then creates a new order based on the xml.
Private Sub cmdDraftToOrder_Click()
    Dim pDraft As SAPbobsCOM.Documents
    Set pDraft = vCmp.GetBusinessObject(oDrafts)
    Dim pOrder As SAPbobsCOM.Documents
    vCmp.XmlExportType = xet_ExportImportMode
    vCmp.XMLAsString = False
    pDraft.GetByKey (3)
    pDraft.SaveXML ("c:\drafts.xml")
    'Here you should add a code that will change the Object's
    'value from 112 (Drafts) to 17 (Orders) and also you should
    'remove the DocObjectCode node from the xml. You can use any
    'xml parser.
    'Create a new order
    Set pOrder = vCmp.GetBusinessObjectFromXML("c:\drafts.xml", 0)
    pOrder.Add
End Sub
Otherwise, you essentially need to read the necessary fields from the draft, create and add an invoice document, and then cancel or remove the draft.

Similar Messages

  • Converting draft document to invoice document

    Hi everyone -- new SBO developer here, trying to come up to speed on the SDK.  I'm curious how you manage to "convert" an existing draft document (in my case, a draft A/R invoice) to an actual A/R invoice, and then add it at the same time.  Say, for instance, you were to add an "Add" button to the Document Drafts form (3002) so the system would convert the draft to an actual document (just like it does when you double-click the matrix line) and then add that document right then-and-there.
    Right now, my guess is that you simply change several properties on the document object, but I cannot figure out which ones.  I'm assuming I can call the Add method once I change the right properties.  Am I on the right track?
    Thanks for your help!
    Anthony

    Hi Anthony,
    Surprisingly, you cannot "convert" a draft document into a real one.
    If I remember correctly, you will have to copy the data (header + line-by-line) into the invoice (When you want to create an Invoice e.g. based on an order it is a bit easier, but still you have to touch every line setting the reference to the base document... - check-out the sample code in the helpfile + the SDK "COM DI" samples).
    DI API is very much "straightforward" in such things.
    As you certainly already discovered, you have to specify the exact object type when you request a business object (it's just a "container"/reference - no real object on your side of the interface) from Company object.
    This means that in DI API itself would have to happen some more things than just to set a value in case you wanted to set the "type" from draft e.g. to invoice...
    Therefore this feature is unfortunately not yet available.
    Regards,
    Frank

  • Copy from Options on  A/P invoice for purchase orde is not working all time

    Hi Expert,
    Currently we are using SAP Business one 8.81 PL09 upgraded from PL05
    Even after the upgrade, we still having problems with the purchase orders. When I go
    into the A/P invoice and try to copy the purchase order over, it doesn't list any
    purchase orders which was already added .  As soon as we bring up the purchase order and then copy it into a A/P
    invoice, then all  purchase orders work like they are supposed to.  What do I need to do
    to fix this?
    Thanks
    Arun K Singh
    Edited by: Arun Singh on Dec 29, 2011 2:52 AM

    Dear Arun,
    try following scenario,
    1) Create one purchase order with only one  Non excisable item with non Excisable warehouse and try to add A/p.
    2) With same Vendor try to create excisable item and with Excisable warehouse and try to create A/p.
    As per me need to work 1st scenario.
    But in second scenario system not allow you to create A/p invoice directly without GRPo and excised invoice.
    Try and let me know.  
    REGARDS
    MANGESH PAGDHARE

  • Copy from a closed A/R invoice to a A/R Credit Memo.

    Hello Forum,
    I have a closed A/R invoice that is paid up.
    Now, if the customer returns that  item, I would create an A/R Credit Memo and pull up from the above A/R Invoice. However, SAP B1 8.8 does not allow copy from a closed A/R invoice. In that copyfrom list only the open A/R invoice show up.
    Is this how it has always been, or am I missing something here.
    Basically my need is to be able to create a A/r Credit Memo from a closed A/R invoice. Without this, we have to enter items one by one, rather than be able to copy them all and remove the ones we don't want returned. Right?
    Thank you.

    Hi Syed,
    It had been always like that, from version 2004 until latest version. Never used version prior to 2004, but I believe it should be the same case. The reason is quite simple, closed Invoice couldn't be credited again with a credit memo document. However I understand that your intention here only to copy all item (as a template only), but that's not how SAP B1 worked.
    Best Regards,
    Hendry Wijaya

  • How can I copy the price from a reference invoice

    Hi,
    How can I programmatically copy the price from a reference invoice to the orders which I am creating using FM SD_SALESDOCUMENT_CREATE.
    Regards,
    Tanmay

    Hi,
    Try using the BAPI BAPI_SALESDOCU_CREATEFROMDATA1.
    In that pass REFOBJECTTYPE
    REFOBJECTKEY
    REFDOCTYPE
    to create from an invoice..
    Thanks,
    Naren

  • Copy price conditions from order to invoice

    Dear experts,
    I have a problem I can't solve myself !
    When we create an invoice from an order, the conditions are copied using a predefined pricing procedure in customizing ... Now, I think I have a strange problem ... When the conditions are copied from the order to the invoice, the inactive conditions are not copied (which seems normal) ... Now, I would like one inactive pricing condition (ZPRO) to copied always, because this one is mandatorry on invoice and otherwise I get an error while copying ... Is there a userexit where I can force this ? And how do I implement this ?
    Thanks in advance for the answers ...
    Greetz,
    Kurt.

    Hi,
    Try this.
    GO to the VTFA transaction..
    Give the source sales document type and target billing type..
    Press item button..Choose the item category..
    In the pricing type give "D" (Copy pricing elements unchanged)...And check again..
    This might work..
    Thanks,
    Naren

  • Edit "Copy From button" on  A/R Invoice

    Hi
    I've added two extra Forms  "Loading"  &  "Unloading" under A/R Invoice . This is not the problem.
    The problem is---
    I want to get the "Copy from Unloading" dropdown  after clicking the Copy From button  on A/R Invoice  Form.
    Rgds
    Subrata

    Hello,
    (I didn't understand the answer. Would I solve the following problem by that answer?)
    I've made a form for Unloading of goods.
    Now I have to copy the details of the form from "Unloading Form"   to
    "A/R  Invoice"  .
    So, I've to add  one item "Unloading"  with others-"Sales Quotaions",  "Sales Orders" ,  "Deliveries"   in the "Copy From"  button  of  A/R Invoice Form.
    Is it possible?
    If yes, then How?
    Rgds
    Subrata

  • Create a button similar like "Copy To" button in A/P Invoice in Customised

    I have created a customised form using SDK and want to create a "Copy To" present in A/P Invoice Form for copying data from one customised form to another customised form .Is it possible to create that button using SDK .

    Amit Sharma
    This question should be asked in category SAP Business One SDK session

  • Invoice Reduction Invoice Payment Terms - Due Date

    Hi gurus,
    At the time we apply invoice reduction in MIRO screen, both invoices (regular and reduction) take vendor payemnt terms (for ex Due in 30 dyas). Is it possible to assign the invoice reduction invoice a fix payment term "Due Immediately" via configuration?
    Thanks in advance

    Hi there,
    Im afraid there is no setting that will have the system post different payment terms in the invoice reduction
    than what is in the invoice. In MIRO, if you use PO reference to create the IV document, the payment terms are copied from the PO and not from the vendor master. The business reason is, that the PO represents the contract between vendor and customer including the terms of payment. Also check out note 322430 as this gives a good description of the proposal logic for the terms of payment.
    I hope this helps,
    Best regards,
    Adam.

  • Purchase Invoice (AP Invoice)

    Greetings from India.
    we have some issues with some purchase invoice AP invoice.
    we buy some materials and some consumables which are second sale.  The supplier give us an assessable tax invoice for us to avail the CENVAT tax credit, which is a different invoice then the Original invoice.
    how are we to pass this "with copy from GRPO" and how to tabulate the amount for CST/VAT, Excise, Packing, Freight and how to pass the Invoice.
    i wish and hope that i get some kind advice and guidance in this issue.
    thanks and regards.

    Hi
    This is the case of First Stage Dealer & Second Stage Dealer For this type of Invoice.
    1.In which amount CST/VAT are calculated put this Rate in to Unit Price Field
      so Unit Price * Qty = Total Amount CST/VAT calculated on it.
    2.In which amount Excise are calculated put this Rate in to Assessable Value (INR) Feild
      so Assessable Value * Qty = Total Amount Excise calculated on it.
    3.Enter freight in to bottom level of GRPO if no Excise on freight  OR
    4.Enter freight in to Raw level of GRPO if Excise on freight
    But make sure all activity done at GRPO level because all accounting effect start at GRPO level.
    Thanks,
    Srujal Patel

  • Customer Invoice (F2) Invoice refer twice in Invoice correction request(RK)

    Hi,
    Is there any possibility to give message when we give refernce of invoice to invoice correction request more than one time. what happened my users ceate invoice correction with refernce to invoice and they have ceated two invoice correction document with refernce to one invoive. Its mean they have created one extra invoice correction request and process. System have not give any message at that time.
    Regards,
    Danish Alam

    Hi Danish Alam
    If you need a message when you create Invoice correction request  wrf to  billing document more than once then you need to include the small program  in the subroutine assigned in the VTAF , because instead of changing the subroutine in VTAF , if you modify the subroutine by including your requirement then your requirement can be fulfilled and even the standard subroutine will also work as it works in standard(without including the requirement)  and if Invoice correction request
      wrf to  billing document is copied more than once it will give a message also . So you need to take help of the ABAP'er to meet this requirement
    Regards
    Srinath

  • Billing type ZF2 contains split crit. , n invoiced: 123456789, invoice notr

    Hi All,
    I am getting the following error at the time of doing billing,VF01....Help to resolve the same....
    *Error:  Billing type ZF2 contains split crit. , n invoiced: 123456789, invoice not req.*
    Rgds,
    Pavan.

    Check for the line item what is the item category you got. and then check in VTFL whether that item category is available or not. If it is not available then maintain the item category in VTFL. Also check in VOV7 for that item category whether relevant for billing has been maintained or not.
    You might be aware of Invoice split takes place because of the following criteria
    1) Payment terms
    2) Payer
    3) Billing date
    4) Foreign trade data
    5) Account assignment grp of MMR
    You might have maintained some group data in the sales order bcoz of that this is taking place.
    So check in the sales order whether all are same or not. for the two line items you had created in the sales order.
    Note : Check the copy control VTFL(if it is delv related billing or VTFA for order related billing) , whether invoice split 001 has been maintained or not.
    Hope it can assist you.
    Thanks & Regards
    JP

  • Document on Collective invoice and invoice splitting.

    Hi Experts,
    Can you guys please help me on getting some documents on collective Invoice and "Invoice splitting"?
    Thanks and Regards
    Anshu

    http://help.sap.com/saphelp_46c/helpdata/en/dd/560fb6545a11d1a7020000e829fd11/content.htm
    http://help.sap.com/saphelp_46c/helpdata/en/dd/560f63545a11d1a7020000e829fd11/content.htm
    Follow the above links and it will answer basic questions about collective billing & Invoice split.
    As a rule, the system combines into one billing document all transactions for the same customer, default billing date and sales organization
    An order contains terms of payment at header as well as item level. These are stored only at header level in the billing document, however. If there are different terms of payment in the reference documents, an invoice split will always be made.
    If data from the related reference documents differs in the item fields of the billing document, the system does not split the invoice.
    The order basis is stored at header level in the order and at item level in the billing document. The system does not split the invoice. If you require an invoice split, you must first define the appropriate split requirements in Customizing for copying control. Copying control depends on the following criteria:
              o Billing Document Type
              o reference document type (i.e. type of order, delivery or billing document on which the sales document is based)
              o item category in the reference document

  • Display  Purchase order, PO Item , Order Number ,entry sheet quantity ,entry sheet price ,invoice quantity, invoice price  against each line number

    hello all,
    i have an ALV report requirement like this,
    on the initial screen i have displayed(for a given agreement number like in ME33K )
    in the selection screen i have taken agreement number as EKPO-EBELN.
    purchase document number        item number        short text        target quantity      net price
    5400000019                                  1                      xxx                  1.000                  304300.00
                                                        2                     xxxx                 1.000                  500000.00
    the above fields i have taken from EKPO table.....
    and on double clicking the  item number i have displayed
    line number          service number       short text           quantity    units    gross price   quantity released
    1                           swr10                   xxxx                 2.00          kg          500             2
    2                           swr11                    xxxx                5.00          EA         500             2
    the above fields i have taken from ESLL (esll-extrow, esll-srvpos, esll-ktext1 , esll-menge  etc......)
    this i have done by passing EBELN to ESLH and getting PACKNO and passed this PACKNO to ESLL.
    now my question is i need to display  Purchase order, PO Item , Order Number ,entry sheet quantity ,entry sheet price ,invoice quantity, invoice price
    against each line number above.....
    from which table do i need to take these fields.....
    please guide me....
    thankq....

    Thanks Andra,
    The problem is the multiple invoices is for non goods receipt item so there will be no delivery.At the time of creating a PO the GR is not checked so there will be no delivery .
    Also this setting is for invoices which are comming from Vendors.But if we are genrating the invoices manually it is not blocking those invoices.Also i there is nowhere mentioned in Incomming invoice to set tolerence for incomming invoice.Are you talking about Vendor tolerences?
    Thanks in advance
    Edited by: Metroid01 on May 14, 2009 6:52 PM

  • Status of Purchase Order should be "Fully Invoice" / "Partially Invoiced"

    Hi SAP,
    Purchase Order is made and goods receipt (MIGO) is done against the particular
    line item of that Purchase Order, For some reasons the FI entry is entered in the system.
    The Purchase Order Line Item is blocked in ME22N for avoiding booking of MIRO Transaction
    The Requirement is to change the status of Purchase Order as “Fully Invoiced”
    as the same is showing as "Not Invoice" in Purchase Order Header > Status Tab
    Advance Thanks,
    Bhaskar Reddy.S

    Go to ME22N..
    Just tick the Final invoice in Invoice tab..

Maybe you are looking for