BAPI for vendor credit memo posting by FB65

Hi guys,
I need a BAPI to post vendor credit note by FB65.
I am trying BAPI_ACC_DOCUMENT_POST, but I cannot find the fields to fill with the information we input at FB65 Payment tab, such as: Inv. Ref (document, year and item ).
Could anybody help me?
Cheers,
Karla.

HI ,
Please Find below the relevant code to Fill the Fields while calling the BAPI for FB65
step1.
First of all fill the wa_bapiheader.
*header data
    wa_bapiheader-username = sy-uname.
    wa_bapiheader-comp_code = wa_final-bukrs.
    wa_bapiheader-doc_date = sy-datum.
    wa_bapiheader-pstng_date = sy-datum.
    wa_bapiheader-doc_type = c_blart.
    wa_bapiheader-ref_doc_no = 'GROWPAY'.   "Can be the refrence text
    w_waers = wa_final-waers.
Step2.
Fill this internal table. i_currencyamount  and i_accountgl.
i_final will be the Internal table conating all the Relevant data for Posting the Document.
Loop at  i_final into wa_final.
ADD 1 TO w_acc_lno.
    wa_accountgl-itemno_acc = w_acc_lno.        
    wa_accountgl-gl_account = wa_final-saknr.    "G/L Account
    wa_accountgl-plant = wa_final-werks.             " Plant
    wa_accountgl-costcenter = wa_final-kostl.       " Cost Center
    wa_accountgl-cond_type = wa_final-knumv.    "From EKKO for the Purchase Order
    wa_accountgl-po_number = wa_final-ebeln.    " Purchase Order no
    wa_accountgl-po_item = wa_final-ebelp.         " Line item in PO
    APPEND wa_accountgl TO i_accountgl.
    CLEAR : wa_accountgl.
    wa_currencyamount-itemno_acc = w_acc_lno.
    wa_currencyamount-currency = wa_final-waers.
    wa_currencyamount-amt_doccur = wa_final-kbetr.
    w_sum = w_sum + wa_final-kbetr.
    APPEND wa_currencyamount TO i_currencyamount.     " G/L line item
    CLEAR : wa_currencyamount.
*item  data
      wa_accountpayable-itemno_acc = 1.
      wa_accountpayable-vendor_no = wa_final-lifnr.
      APPEND wa_accountpayable TO i_accountpayable.
*Amount for the vendor line item.
      CLEAR : wa_currencyamount.
      wa_currencyamount-itemno_acc = 1.
      wa_currencyamount-currency = w_waers.
      wa_currencyamount-amt_doccur = 0 - w_sum.
      INSERT  wa_currencyamount INTO i_currencyamount INDEX 1.
Step 3.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
          EXPORTING
            documentheader = wa_bapiheader
          TABLES
            accountgl           = i_accountgl
            currencyamount = i_currencyamount
            accountpayable = i_accountpayable
            return                 = i_result_out.
i_result_out will conatin the messages returned by the BAPI.
    based on i_resuklt_out that is if the posting is Successful....call commit
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
                 Wait = X.
Endloop.
I hope the above code may solve your problem....Thanks
Regards ,
Sonu Krishna.
Edited by: Sonu Krishna PV on Aug 6, 2009 11:03 AM

Similar Messages

  • Dunning for Vendor Credit Memo

    Dear Expert,
    I have 5 open due invoices in vendor account of euro 10000 and now i have posted credit memo which is not relating to any of the invoices for value of euro1000.Now i want to run dunning only for credit memo (as this is seperate item receivable from vendor).System is picking up all line items in dunning run and saying that dunning not possible because balance is -9000 (payable). How can i execute dunning only for vendor credit memo which is not related to invoices and which is amount due to receive by us from vendor. And if i select only credit memo in parameters than system is assigning dunning level 0 to credit memo and not executing dunning run.appreciate quick help. Thanks...

    Hi Parag,
    Dunning should be done only for vendor and customer total outstanding balance
    as per below screen invoice  is of Rs.19000/- and credit memo of Rs.20000/-
    amount recovered from vendor is Rs.1000/- along with dunning changes  here
    in the below example i had  taken Rs.50/- so different of Rs.1000 (credti memo - invoice)
    so Recoverable from vendor is Rs.1050/- hope this solved your thread
    thanks
    Trinath

  • BAPI for subsequent credit memo in MIRO transaction

    hi,
    i need to upload the data for subsequent credit memo in MIRO transaction using BAPI.
    Is there any BAPI for subsequent credit memo in MIRO transaction?
    Thanks & regards
    Prajwala

    Hi,
    I am not 100 percent sure but try this BAPI:
    BAPI_INCOMINGINVOICE_CREATE.
    Regards,
    Rahul

  • Vendor Credit Memo posting to Asset when invoice did not

    Hi Experts,
    We are on SAP 604 and have the following scenario.
    PO to purchase an asset at $10,000.  (not an inventory item).
    Goods receipt has NOT been done.
    1st invoice comes in but is only for half of the asset.  (.5 qty at $5,000)  does not post to asset since there is no GR done.
    Postings:
    Debit 201010 $5000
    Credit 201015 $5000
    2nd invoice is data entered wrong.  It is for the remaing half but Acts Pyble enters quanty of 1 instead of .5.
    Debit 201010 $5000
    Credit 201015 $5000
    When reversing the second invoice (or even just entering a credit memo), instead of the posting doing a simple reversal of hte invoice like this :
    Debit 201010 $5000
    Credit 201015 $5000
    SAP posts to the asset even though there has yet to be any other postings done to the asset (no GRs and no invoices have posted to the asset).  Credit Memo posts like this:
    Credit 201010 $5000
    Debit 201015 $6666.67
    Credit Asset: $1666.67
    Please confirm whether you see this posting as an issue for the asset.  I have posted an OSS message to SAP and they are saying the system is working as designed unless I gather enough business requirements to do a development request.  I'm trying to see if this posting is just an issue for my organization.  Typically we would not expect a Credit Memo to capitalize the Asset.  - Or if you know of a fix, please let me know.
    Thanks!
    Cindy

    If you do not want negative posting/ balances in your asset, you can configure the depreciation areas to allow positive values only. That way if balance is negative (as in your example), posting is not allowed.

  • BAPI for  Invoice Credit Memo

    Hi Guys,
    Can you plz help me which BAPI is used  for Invoice credit memo.
    Thanks and regards
    Praveen

    use...
    'BAPI_CRED_MEMO_CREATEFROMDAT2'
    data: con_cr_memo_bus_obj like BAPIUSW01-OBJTYPE value 'BUS2094'.
    CALL FUNCTION 'ZBAPI_CRED_MEMO_CREATEFROMDAT2'
    EXPORTING
    ORDER_HEADER_IN = bapi_hdr
    business_object = con_cr_memo_bus_obj
    convert = 'X'
    IMPORTING
    SALESDOCUMENT = bapi_salesdoc
    TABLES
    return = bapi_ret_tbl
    ORDER_ITEMS_IN = bapi_itm
    ORDER_PARTNERS = bapi_prtnr
    ORDER_ITEMS_inx = bapi_itm_out
    order_schedules_in = bapi_schd_lin
    order_text = bapi_text.
    AND in the cloned ZBAPI above in SE37/80, add this Importing parameter: BUSINESS_OBJECT LIKE BAPIUSW01-OBJTYPE
    Please have a look in older topics:
    MWST taxcondition missing bapi_salesorder_createfromdat2
    sales order with reference to quotation
    Message was edited by: kishan negi

  • Bapi for debit/credit memo creation

    Dear all,
    I am using the BAPI_SALESORDER_CREATEFROMDAT2 for creating a credit/debit memo, the following error is displayed.
    "Unpermitted Combination of Business object BUS2032 & Sales Doc Category type K"
    Could you please provide me a solution and let me know if there are any BAPIs to create credit/debit memos.
    Thanks in Advance.
    Regards,
    Raj

    Raj you can try with these also:
    use...
    'BAPI_CRED_MEMO_CREATEFROMDAT2'
    data: con_cr_memo_bus_obj like BAPIUSW01-OBJTYPE value 'BUS2094'.
    CALL FUNCTION 'ZBAPI_CRED_MEMO_CREATEFROMDAT2'
    EXPORTING
    ORDER_HEADER_IN = bapi_hdr
    business_object = con_cr_memo_bus_obj
    convert = 'X'
    IMPORTING
    SALESDOCUMENT = bapi_salesdoc
    TABLES
    return = bapi_ret_tbl
    ORDER_ITEMS_IN = bapi_itm
    ORDER_PARTNERS = bapi_prtnr
    ORDER_ITEMS_inx = bapi_itm_out
    order_schedules_in = bapi_schd_lin
    order_text = bapi_text.
    AND in the cloned ZBAPI above in SE37/80, add this Importing parameter: BUSINESS_OBJECT LIKE BAPIUSW01-OBJTYPE
    Please have a look in older topics:
    <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="95866"></a>
    <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="82006"></a>
    Also:
    Did you try BAPI_INCOMING_INVOICE_CREATE with DOC_TYPE (CREDIT MEMO) field in BAPI_INCINV_CREATE_HEADER.
    Amit.

  • Bapi for cuatomer credit memo  f-27

    which bapi i should use in order to create cuatomer credit memo. F-27
    and how.

    Try to use this BAPI : BAPI_SALESDOCU_CREATEFROMDATA1 with sales order type 'CR'.
    Hope this link [Create credit memo request]helps you.Please check..
    Thanks,
    Manjula

  • AP-Credit Memo-Clear Vendor/Credit Memo

    Hi all, I am facing Problem during Vendor Credit memo, Clear it (F-44), and Manual Check using F-58
    Can I have different Due date For Vendor Credit memo , as I can see we have different Payment terms in Master data but whenever I post it gives the Due date as Immediate but if I see Open item report it says not Due and shows the Payment terms and the net due dates. Is this Normal?
    I would like to clear the credit memo using the F-44 with reference to another open line item but system says Difference is too large for clearing.
    The third thing I am trying to issue manual check I gave details, as per "J03_AP_CreditMemo_BPP_EN_US", when I hit Process open Items "system is not allowing to post document getting error "Select a valid function"".
    Any Ideas How to deal with the above 3 situations?
    Sandhya.

    Hi,
    To answer few queries,
    Data can be entered in the field for the terms of payment key in various ways as you enter a business transaction:
    In most business transactions, the system defaults the key specified in the master record of the customer/vendor in question.
    In some transactions (for example, credit memos), however, the system does not default the key from the master record. Despite this, you can use the key from the customer/vendor master record by entering "*" in the field.
    Regardless of whether or not a key is defaulted from the master record, you can manually enter a key during document entry at:
    item level in sales orders header level in purchase orders and invoices
    F-44--clearing problem
    If the amount of open item is not equal to clearing amount you enter and the difference is not with in the tolerance limit you specify in the configuration, you will face this error. If the whole amount of open item need not be cleared, then try partial payment/residual payment  options.
    The third situation I am not clear.
    Thanks
    Aravind

  • BAPI to park Debit Note (Vendor credit memo) Doc Type: 'KG'

    Hi All,
    A friend of mine desperately needs to know any BAPI for parking Debit Note (Doc.type : KG Vendor credit memo)... Please let me know if you know about any BAPI / Funcation module to do it and a little chunk of sample code will surely help me a lot....
    Thanks in Advance,
    Regards,

    Hi Savitha,
    Well, we have experiemented with this BAPI "BAPI_INCOMINGINVOICE_PARK" earlier, but we found out that it dose not work properly for Service Orders; also it dose not seem to post proper debit note. Anyways, we have used another BAPI "BAPI_ACC_GL_POSTING_POST", it worked but it posts the debit note (Vendor Credit Memo) but we only want to park the debit note and let the user review it and then the user can post it manually or so afterwards...
    Regards,
    Athar

  • FB65 - Vendor credit memo

    Hello Experts,
    I have a question reg vendor credit memo. When I post a credit memo, vendor account gets debited and what will be the GL account used for credit entry?  
    Am using this credit memo to balance the wrongly posted vendor invoice.
    Any help is highly appreciated and duly rewarded.
    Regards,
    Sriram

    First you check teh invoice ;
    Normally if you are using FB60 It will be
    Expence A/C Dr  TO      100000
       Vendor A/C                100000
    Suppose if you want  raise Credit Memo Using FB65(first you decide amount)
    then It will be
    Vendor A/C Dr TO    25000
    Expence A/C           25000
    THEN YOU PAY REMAINING 75000.
    SYSTEM WILL CLEAR ALL LINE ITEMS AT THE TIME OF PAYMENT.
    CHANDRA

  • Creating Vendor Credit Memo Using BAPI  BAPI_ACC_DOCUMENT_POST

    Hi,
    I want to create a vendor credit memo using the bapi BAPI_ACC_DOCUMENT_POST but with posting keys as 21 and 50.Is it possible to do so.I tested the bapi passing the data to the accountgl table.Do i have to pass data to another table ?

    hi Eric,
    I even tried passing the data to the accounts receivable and accounts payable tables passing the GL account no in these tables.Still teh document get posted with keys 40 and 50.Also the credit entries should be assigned to COPA segment of sales order/item.
    The vendor credit memo should look as follows look as follows:
    Dr Vendor (PK = 21) $ 35,000
    Cr Freight expense account (PK = 50) $ 10,000……….assigned to COPA segment of sales order/ item 20000397/10
    Cr Freight expense account (PK = 50) $ 5,000……….assigned to COPA segment of sales order/ item 20000397/20
    Cr Freight expense account (PK = 50) $ 20,000……….assigned to COPA segment of sales order/ item 20000398/10

  • Tcode for Print Vendor Credit Memo...

    Hi All,
    Can i Know the Tcode to printing  Vendor Credit Memo..
    Thanks and regards,
    Suraj

    try F.64 and then F.61
    Thanks and Regards

  • BAPI for Vendor Non-PO Invoice processed through MIR7 Transaction

    Hi All,
    I have a requirement where i will get data from flat file. Using this data Vendor Non-PO Invoice
    will be processed through MIR7 transaction with Multiple line items - Invoice Upload Parking the document for vendor non-po invoices.
    The data is in below format in flat file:
    Header fields in 1st line
    Dr. Key related fields in 2nd line
    Cr. Key related fields in 3rd line
    Header fields in 4th line
    Dr. Key related fields in 5th line
    Cr. Key related fields in 6th line
    etc .... in flat file
    In these main fields coming in from flat file are: comp.code, doc.type, vendor no,
    Debit/Credit indicatorSHKZG, G/L a/c no, inv/post dates etc..
    My issues:
    1. I am planning to use F.M BAPI_INCOMINGINVOICE_PARK is it the correct F.M!
    But Here PO number seems to be mandatory for this F.M but it is not available as per our flat file,
    if so can anybody suggest a BAPI for Vendor Non-PO Invoice parking for MIR7 transaction!
    2. What are the parameters need to be used for from above flat file data especially for 2 line itemshttp://Dr./Cr. data other than header data. So as per Header & 2 Line items http://Dr. & Cr. Data which parameters will be updated with which data in above flat file! can anybody clarify!
    3. Also in flat file WorkflowNo is available in which parameter this fields will need to be filled & also by doing this will it trigger workflow automatically!
    Can anybody clarify about above points!
    Thanks in advance.
    Thanks,
    Deep.

    Hello Deep,
    I know it might be quite late for you for this answer, nevertheless I will write that, because there are lots of question like yours. bapi_incominginvoice_park is also a suitable bapi for you. All you need to do is call it this way:
    data: headerdata like bapi_incinv_create_header value is initial,
            table_item type table of bapi_incinv_create_item,
            gl_account like bapi_incinv_create_gl_account,
            table_gl type table of bapi_incinv_create_gl_account.
    * fill headerdata and table_gl, leaving table_item empty
    CALL FUNCTION 'BAPI_INCOMINGINVOICE_PARK'
        EXPORTING
          HEADERDATA                = HEADERDATA
    *   ADDRESSDATA               =
        IMPORTING
          INVOICEDOCNUMBER          = lv_docnr
          FISCALYEAR                = lv_year
        TABLES
          ITEMDATA                  = table_item
    *      ACCOUNTINGDATA            = table_acc
          GLACCOUNTDATA             = table_gl
    *   MATERIALDATA              =
    *      TAXDATA                   = table_tax
    *   WITHTAXDATA               =
    *   VENDORITEMSPLITDATA       =
          RETURN                    = lt_return.
    This works perfectly for me, creating a mir7 document without refering to a PO. The trick here is to fulfill the glaccountingdata importing table while leaving itemdata empty.

  • Cancel Vendor Credit Memo - Reg.

    Dear Experts,
    We have posted vendor credit memo through MIRO. The details are as,
    T-Code : MIRO
    Transaction : Credit Memo
    Reference : PO
    Qty : 0.232 MT
    Amount : INR 50000/-
    Tax amount : 0/-(ZERO)
    Document Date : 16.11.09
    Posting Date : 17.02.2010
    Now, we are trying to cancel this vendor credit memo in MR8M with following details,
    Case : 1
    Invoice Document No.:XXX
    Fiscal Year : 2009
    Reversal Reason : 01(Reversal in current period)
    Posting Date : 17.02.10
    *Error displayed : Allowed Posting Periods:  01 2010/12 2009/ 12 2009 for company code 100 and date 17.02.2010*
    Case : 2
    Invoice Document No.:XXX
    Fiscal Year : 2009
    Reversal Reason : 01(Reversal in current period)
    Posting Date : 31.03.2010
    Error displayed : Reversal Reason 01 only permits posting date 17.02.2010
    Case : 3
    Invoice Document No.:XXX
    Fiscal Year : 2009
    Reversal Reason : 02(Reversal in closed period)
    Posting Date : 31.03.2010
    Error displayed : M8 534 Balance not Zero: 4,487.00 - debits : 54,487.00 Credits : 50,000.00
    Case : 4
    Invoice Document No.:XXX
    Fiscal Year : 2009
    Reversal Reason : 02(Reversal in closed period)
    Posting Date : 17.02.2010
    *Error displayed : Allowed Posting Periods:  01 2010/12 2009/ 12 2009 for company code 100 and date 17.02.2010
    Kindly suggest me where am going wrong and how to cancel this vendor credit memo. Thanks in advance.
    Regards,
    Kumar

    In MIRO, just do invoice for reversing the credit memo and make sure correct periods are used.

  • Assignment field being automatically populated in Vendor Credit Memo

    Dears,
    While posting Vendor Credit Memo with Reference Invoice (field Inv.Ref under Payment tab) the Assignment field (field Assign. under Details tab) is being automatically populated with assignment value from the referenced invoice.
    Is there a way to disable automatic Assignment field population?
    Thanks in advance,
    Robert

    Dears,
    No sorting keys exist for GL Master Vendor reconciliation account and still assignment is being copied (Data was copied
    Message no. F5343)
    Substitution is not an option as it's being done when posting, and not at the moment of invoice creation.
    Thank you for any ideas.
    Best regards,
    Robert

Maybe you are looking for