Code to create a credit note in VOFM

hi all
I have a requirement - a credit note should be created for each sales order in case of a return order.
Ive also been told to add a routine under Billing Documents but then I dnt know which code to write...
Has anyone done this before?
If so, can you please tell me wat I should code?

How did you sell the asset?
You can just reverse the sale transaction by going to transaction AB08.
Hopefull this may work for you.
Regards,

Similar Messages

  • How to create a Credit Note to the client for purchasing of an Asset last y

    Hi,
    I have an issue in Asset Accounting as it showed bellow:
    Assets depreciation start date is 1st October 2007.
    We have run the depreciation up to November 2007.
    Than we sold the asset in December.
    However, after the end closed year 2007, client returned the asset in 1 st January 2008.
    So i need to create a Credit Note to the client for purchasing of an Asset last year, but we don't know how to create it?
    We thinks that correct movement should be debit in extraordinary cost / profits account, debit in asset account, credit in accumulated depreciation account and credit in client account.
    Plz help. I will assign full points for any useful answer.
    Thanks
    Edited by: Ricardo Pedro Rodrigues Ferrão on Dec 20, 2007 10:09 AM

    How did you sell the asset?
    You can just reverse the sale transaction by going to transaction AB08.
    Hopefull this may work for you.
    Regards,

  • While creating the credit note getting error

    hi
    while creating the credit note getting error
    MsgType       Message                                       Msg.no.
    E                  Enter country                                 216
    E                  Sales document  was not changed   219  
    pls suggest me

    Is COPA activated? If yes go to teh button PA and give country value in the line item.
    Reward if useful
    sarma

  • Corrupt Credit Note created via DI API

    Hello,
    when i try to create a credit note via di api i get the error message "one of the base documents has been closed", even if the source document is not closed. But this is not the main problem. After this i have a corrupt credit memo in my system, that means a credit memo with out any detail lines. The error occurs only on one customer systems, on a lot of other systems the creation of credit notes works fine. Had anybody the same effect or clue what causes this problem.
    Regards

    Hello we found the problem, i can reproduce it on a belgium database.
    I want you to inform about a critical error in the SBO_SP_TransactionNotification.
    If you check the line data of a document and send an error for this data the front end works fine. But if you use the DI-API the header data of document will be saved and the lines will be not saved.
    if @object_type in ('14','19') and @transaction_type = 'A'
    begin
    declare @corrCRD as varchar(8)
    if @object_type = '14'
    set @corrCRD = (select distinct(correction) from ovtg where code in (select vatgroup from RIN1 where docentry = @list_of_cols_val_tab_del) and correction = 'N')
    else if @object_type = '19'
    set @corrCRD = (select distinct(correction) from ovtg where code in (select vatgroup from RPC1 where docentry = @list_of_cols_val_tab_del) and correction = 'N')
    if @corrCRD = 'N'
    begin
    set @error = 1
    set @error_message = 'You have entered a regular VAT Code on the document, this is not allowed'
    end
    end

  • Creating Credit Note based on Invoice

    HI there,
    I am trying to create a Credit Note through the DIAPI using VB. This Credit Note must be linked to the Invoice 88 for example :
      Try *
                'Get the required business object *
                ''Dim oCreditDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)*
                Dim queryString As String*
                Dim oRecSet As SAPbobsCOM.Recordset*
                oRecSet = oCompany.GetBusinessObject(300)*
                queryString = "SELECT T0.CardCode from OINV T0 where T0.DocNum = 88 "*
                oRecSet.DoQuery(queryString)*
               Dim oCreditDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oCreditNotes)*
                'Set the business partner code*
                oCreditDoc.CardCode = oRecSet.Fields.Item(0).Value*
                'set the documents due date -mandatory*
                oCreditDoc.DocDueDate = Now*
                'add first line on invoice*
                'use the SO order specified in the text box *
                'as a base document*
                oCreditDoc.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oInvoices*
                oCreditDoc.Lines.BaseEntry = CInt("88")*
                oCreditDoc.Lines.BaseLine = 0*
                'add the new invoice document*
                lRetCode = oCreditDoc.Add*
                'check return code*
                If lRetCode <> 0 Then*
                    oCompany.GetLastError(lErrCode, sErrMsg)*
                    MsgBox("Error : " & lErrCode & " : " & sErrMsg)*
                Else*
                    'store newly created object code in a new string*
                    '(could have stored it in OrdCodeStr)*
                    Dim OrdCodeStr2 As String*
                    OrdCodeStr2 = ""*
                    oCompany.GetNewObjectCode(OrdCodeStr2)*
                    MsgBox(" Created Credit Note : " & OrdCodeStr2)*
               End If*
            Catch ex As Exception*
                MsgBox("Exception. Connect: " & ex.Message)*
            End Try*
    I am getting an "Item code missing" error. Does this mean i must set up each and every line to credit? What if there are millions of lines? Can we not just set a BaseEntry and BaseType for the document as a whole so it knows which Invoice needs to be credited completely?
    Kind regards,
    Greeshma
    p.s. i tried to get this to display as code but seems this editor is either confusing me or it doesnt work! sorry. when i find the right person to complain about it to i will!
    Edited by: Greeshma Gulab on Nov 18, 2009 11:13 AM
    Edited by: Greeshma Gulab on Nov 18, 2009 11:15 AM

    Hi,
    I am not able to make out ur code because of the formating problem, but anyways check the below thread, it might be helpful to u..
    Create Credit Memo based on A/R Invoice
    Vasu Natari.

  • Credit note should be issued to newly created customer

    Hello Gurus,
    I need to issue a rebate credit note for  2013 – Jan-Aug   1200746,44 INR
    Agreement 70 was created for customer 4000240- Royal plastic (Royal group) this customer was sold to Melton group as per 01.09.2013 – new account 4000488 with new name as Melton plastic was created.
    The old account 4000240 has been marked for deletion.
    Now I need to create a credit note for the customer, but it has to be issued to new customer account 4000488.
    Now client wants to make sure that the credit note will be booked in a way that the credit amount it related to rebates and not revenues.
    Can you please advise how to handle this ?
    Regards
    Soumendu

    HI,
    you can achive this by assigning customer account to different credit risc class in credit master data.
    The risc class triggers system behaviour/response for credit risc management (what is checked during credit management process, what happens if the check is fullfilled,...).
    Best regards, Christian

  • Uploading and creating multiple subsequent credit notes

    Hi All,
    Can someone help me on how I can create multiple subsequent credit notes in ECC6.  I have tried using the FM 'BAPI_INCOMINGINVOICE_GETDETAIL' and I am getting the error 'No reversal possible. Reverse value must be reset'.
    if i try and using the BDC it doesnt update the screens in the back ground, but it does in the foreground.
    regards
    Stan

    Hi,
    thanks for your answer!
    well, there is no link between the company B and the intermediate business partner..
    I thought of something like that:
    1. I create a sales order for the material : "licence" for 100000.-
    2. I create a rebate agreement (B003) of 10% for "initermediate business partner= M.Wagner"
    3.I create an invoice to company B of 100000.-
    4. Company B pays 100000.- but 10% is automatically "stocked" in the accounting of company A
    5 I create a credit note of 10000 (linked with the invoice) to pay M.Wagner.
    Is that possible? if not do you have other suggestion??
    thanks a lot!!!
    M.

  • Credit note..Urgent

    Hi Gurus,
    When i am creating a credit note with reference to billing document, how to customize that the user should not exceed more than the previous billing doucment value???
    Ex:
    we have raised a billing value of  10000/-
    our user cannot create a credit note morethatn that value(10000/-)
    How is it possible.
    Limitations: No deliveries..
    Thanks in Advance..
    RAVI

    Hi Ravi,
             First you try with copying routines in the transaction VTAF,(to DevelopT.code VOFM),if you are not able to get requirement through the routines, then you better to go for the User Exit.
    USEREXIT_SAVE_DOCUMENT_PREPARE  in the program MV45AFZZ
    Thanks,
    Murali.

  • Credit note from a credit memo with reference - Pricing

    Hi Gurus,
    I have created a Credit Memo (CR) with reference to an invoice (F2). The pricing procedure in the F2 is copied to CR, following the copy control defined. (what I expected).
    However, when creating the credit note (G2), the pricing procedure selected is the one defined for credit notes, and not the one in the credit memo. (I didn't expect this).
    I have this config. in the system:
    - XD03: Cust.Pricing Proced: "1"
    - VOV8: Docum.Pricing Proced: "P"
    - OVKK: for the combination of Sales ORgDCH"P"+"1" --> pricing procedure is ZPROAC  (this is pricing procedure for G2.
    The pricing procedure in the Credit Memo (CR) is ZNETO1.
    Copy control config is the following:
    - VTFA:  G2 - CR.
    Copy requirements at header level: 001
    At item cat. (G2N): copy requirement: 002 Item/order-related; Data VBRK/VBRP: 002 Ord-rel.credit memo
    Pricing type: G
    Could you provide any comments here?
    Thanks
    Julian

    Dear Julian,
    First of all Copy control does not controls the copying of pricing procedure from one doc to another.
    Pricing procedure will be same as per your pricing procedure determination.
    It controls the copying of values for particular condition types from one doc to another.
    I have created a Credit Memo (CR) with reference to an invoice (F2). The pricing procedure in the F2 is copied to CR, following the copy control defined. (what I expected).
    In this case I think Pricing procedure defined for both doc types F2 and CR is same, thats why all the pricing is copied as it is to CR.
    if they are not same but all the condition types which are there in pricing poc. of F2 are also in pricing proc. of CR then pricing values will be copied without any change. (Still sequence of condition types in pricing proc. can make diff.)
    pricing procedure is ZPROAC (this is pricing procedure for G2.
    The pricing procedure in the Credit Memo (CR) is ZNETO1
    Since the pricing procedure is different for both doc types, There could be some condition type which are there in ZNETO1 but not in ZPROAC.
    Which ever condition types are common will be copied.
    I will suggest you to keep pricing procedure same for both the doc types CR and G2.
    Or atleast all condition types of ZNETO1 should be there in ZPROAC in appropriate sequence. (ZPROAC can have addition condition types as per your requirement.)
    Regards
    Mayank

  • DI API: Wrong PriceAfterVAT value in credit note based on A/R invoice

    Hi all,
    I have serious problem with creating Credit Note based on existing A/R Invoice in Sales module.
    I use SBO 2004A patch level 32. With SDK I've created A/R Invoice with 2 items. First item has discount percent 0% and price after VAT 1. Second item has 100% discount, this means, doctotal is 1. Document VAT is 7,6% and VAT is calculated correctly in invoice. Then I've created credit note only with 1 item and this row is bounded with 1 row in invoice. After calling oCreditNote.Add, in Business One this credit note has all prices (price, price after VAT, row total) with the same value -> there is no vat calculated although in invoice the vat calculated is.
    Is it bug in DI API or do I something wrong?
    I use the standard ways to create new invoice and credit note through DI API.
    Many thanks for your answers.
    Best regards
    Libor.

    Hi Libor,
    To create a Credit note for a Invoice you should use the Invoice as the base document for the Credit note. Here is an example of how I create a GRPO from a draft GRPO. Try this (for your Invoice - Credit Note) and see if it does not work for you (SAP suggests this way of doing it).
    (Draft will be your invoice - GRPO will be your credit note)
    Dim oDraft As SAPbobsCOM.Documents
    Dim oGRPO As SAPbobsCOM.Documents
    If oDraft.GetByKey(YourInvoiceNumber) Then
                            'Build the GRPO (new GRPO Obj for each GRPO Doc)
                            oGRPO = oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes)
                            oGRPO.DocDate = oDraft.DocDate
                            oGRPO.DocDueDate = oDraft.DocDueDate
                            oGRPO.DiscountPercent = oDraft.DiscountPercent
                            oGRPO.CardCode = oDraft.CardCode
                            For i = 0 To oDraft.Lines.Count - 1
                                oDraft.Lines.SetCurrentLine(i)
                                oGRPO.Lines.BaseType = oDraft.Lines.BaseType
                                oGRPO.Lines.BaseEntry = oDraft.Lines.BaseEntry
                                oGRPO.Lines.BaseLine = oDraft.Lines.BaseLine
                                If i < oDraft.Lines.Count - 1 Then
                                    oGRPO.Lines.Add()
                                End If
                            Next i
                            'Add the GRPO
                            iRetCode = oGRPO.Add
                            If iRetCode <> 0 Then
                                oComp.GetLastError(iRetCode, sErrMsg)
                                Log.WriteLog("Error Adding GRPO : " & sErrMsg, EventLogEntryType.Warning)
                                Return False
                            End If
                        End If

  • Creation of Credit Note in Background

    Hi,
    I have a peculiar scenario over here. Currently we are creating a commerical invoice and against it we are creating an excise invoice in the background which is as per the normal procedure. 
    I want to know whether it is possible to create a credit note also in the background at the time of invoice creation. I know we can create the credit note seperately through normal SD process, but I want to know whether it is possible to simultaneously create an excise invoice and a credit note in the background against a commerical invoice and if it possible what configuration needs to be done. 
    Thanks in advance.
    Regards,
    Amol

    Hi Manfred,
    please try to use CRM_SRV_ORDER_API_CREATE.
    When tracing the creation of a new contract there is also CL_CRM_1O_MAIN=>CREATE_ORDER, maybe this can be used.
    best regards,
    Johannes

  • Credit note with invoice reference are not concatenate in F110

    When I create a credit note with invoice reference by VA01, the fields payment term,  Baseline date for due date calculation, Assignment and Payment method are copied correctly from invoice to credit note, but in FI document the field invoice ref.  'BSEG-REBZG' is not filled. So when I run the transaction F110 Automathic Payment (for Italy) the invoice is rigthly payed but the credit not is included into Exceptions with the note 'No pymt possible because items with a credit bal.still exist'. If I put in the field 'BSEG-REBZG'  the reference to  the invoice, the one and credit note are concatenated and I have a rigth parzial payment.
    There is a way to have this link when I post the Fi document by vf01-vf02 without putting it manually using FB03?
    Thank you in advance
    Gianluca.

    hiii
    please refer thi link reconciliation in 2005
    https://websmp208.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700000789632007E
    i would suggest you to upgrade your version, as reconciliation is very easy in higher versions
    please refer sap note no 1051038.
    Thanks
    Rizz
    Edited by: Mohammed Riyaz on Apr 24, 2009 4:01 PM

  • BAPI for creation of Credit Note with custom pricing condition

    I need to create a Credit Note with reference Invoice via program.  So, I am planning to use BAPI. Could you please suggest appropriate BAPI?  I need to send a pricing condition that is set manually in the credit note as well.  So, I will needto pass pricing condition and value.  Thanks.

    Hello,
    Why you have to create the credit note using BAPI w.r.t. invoice ? Can you brief the senario .
    The simple way is create a credit memo request in VA01 w.r.t. invoice number. It will have the block . Remove the block and Create credit memo in VF01 .
    Thanks
    RK

  • Unable to post credit note on Assets

    Hello All,
    At the end of FY 2008, we posted an invoice on PO 4800XXXXXX.
    But, at the beginning of 2009, the supplier created a credit note to cancel this invoice , and sent us a new invoice to a total amount lower than the invoice 2008.
    On the PO, i can post the new invoice, but i can't post the credit note :
    I have the following message :
    "Balance for transaction type group 10 negative for the area 01"
    Please let us know why credit memo is not getting posted.
    Our analysis:
    1. We observed that the Acqusition postings are done in 2008, and no Acqusition postings are done in 2009. We observed that we are trying to post credit memo in 2009 where no acqusition postings exists. As per the configuration done for the Depreciation Area 01,no negitive postings (i.e credit memos) can be posted if there is no acqusition (Stand alone)
    Hence we beleive that we have to post a credit memo in 2008, then post an acqusition postings in 2009 and post a credit memo in 2009.
    Could you please let us know if our assumption is correct OR is there any alternative to post credit memo in 2009 (Fiscal year 2008 closed)
    Thanks in advance
    Best regards
    Lavanya

    Try to post the credit invoice with ABGF - ... in Next Year  is using transaction type 160. I think this one is not used with the posting from you credit invoice?

  • Credit note is having different pricing procedure

    Hi All,
    We have an issue with the Pricing procedure determination.
    While creating Return order, we are creating with reference to standard Invoice.
    Document pricing procedure in the Standard Invoice and Return order are different.
    We maintained different pricing procedure for Return order. But system is copying the Pricing procedure from Invoice into the Return order.
    We are creating Return credit note with reference to Return Delivery.
    Here in the Credit note, Pricing procedure is different, that is actually what we maintained in OVKK.
    But in VTFL, Pricing source field is maintained as "Order" only.
    Does this setting not enough to copy the pricing procedure from the Return Sales order.
    We need the same Pricing procedure what is available in the Return order to be copied into the Return credit note.
    Advice me what standard settings to be done to achieve this.
    Regards,
    Rajesh Lingadurai

    Dear Manoranjan,
    Thanks for the reponse.
    Return order part is clear to me. As per standard, system is copying the Pricing procedure from the Invoice.
    But I am not clear about Return Credit memo i.e. Billing part.
    As I explained above, I believe the Pricing procedure will be redetermined in the Billing only when the Document Pricing Procedure in the Billing is different from the Sales document type.
    But in my case, Document pricing procedure is same in Sales document type and Billing document type, but why system is redetermining the Pricing procedure in the billing level.
    As per our requirement, system has to copy the Pricing Procedure and Condition values whatever is determined in Return order level into Invoice level.
    Is it possible to copy the entire pricing from Sales order into Billing even if it is Delivery related billing.
    I hope it is clear now.
    Regards,
    Raja Durai

Maybe you are looking for