Modifying accounting document linked to material document in MB1B

Hi Everyone,
While doing transfer posting in MB1B with movement type 453 there is an accounting document generated.
The requirement is to split this accouting document to have accounting entry as :
Inventory G/L Dr (100%)
COGS G/L Cr (70 %)
Specific Reserve G/L Cr (30%)
Also need to check on the profit center determined in this accounting document to have a user defined logic for this determination.
If you have worked on or seen any such enhancement, requrest you to share how it was achieved- Customer Exits, BADIs, BTEs,or something else.
Thanks,
Hemant

Hi Sai,
This movement (453)is done to take back the customer returned parts into the inventory and hence involves accounting entry.
The scenario involves customer service. Instead of crediting the COGS G/L completely, part of it needs to be credited as service reserves. Hence lets say inventory is going up by $ 100 upon reciept of the material the balancing credit needs to be posted to two G/L accounts with a proportation let say 70 :30. With that $ 70 should go to COGS G/L and $ 30 should hit service reserves.
Secondly the profit center determination in standard SAP is based on Plant/Material combination. It is required to populate this profiit center with a custom logic.
Hope this explains  the functional requirement.
Thanks,
Hemant

Similar Messages

  • User-Exit to Modify Accounting Document of Incoming Invoice

    Hello,
    My requirement is to add two new Line Items (One Debit One Credit - with net value 0) in the Accounting Document of the Incoming Invoice.
    Is there any User-Exit available for modification of the Accounting Document?
    P.S. - The Incoming Invoice is being Posted using BAPI - BAPI_INCOMINGINVOICE_CREATE
    Thanks & Regards,
    Abhishek

    Hi Abhishek,
    Try this exits. You go through the flow and put a break point on the selected exits, and check it whether it triggering or not?
    I too not aware of this invoice flow, so I am listing all the relevant exits. I think this may help you.
    Enhancement
    LMR1M001                                User exits in Logistics Invoice Verification
    LMR1M002                                Account grouping for GR/IR account maintenance
    LMR1M003                                Number assignment in Logistics Invoice Verification
    LMR1M004                                Logistics Invoice Verification: item text for follow-on docs
    LMR1M005                                Logistics Inv. Verification: Release Parked Doc. for Posting
    LMR1M006                                Logistics Invoice Verification: Process XML Invoice
    MRMH0001                                Logistics Invoice Verification: ERS procedure
    MRMH0002                                Logistics Invoice Verification: EDI inbound
    MRMH0003                                Logistics Invoice Verification: Revaluation/RAP
    MRMN0001                                Message output and creation: Logistics Invoice Verification
    Business Add-in
    INVOICE_UPDATE                          Business Add-In: Logistics Invoice Verification
    Reward points if it helps you.
    Cheers,
    Swamy Kunche

  • Link between Material Document number & Accounting document number

    Hi All,
    For material document there is a corresponding accounting document number generated.However this is not the rule in all cases.
    Where is the link between the two(Material Document & Accounting Document) ?
    In other words i want to list those material documents only, for which accounting documents are generated.
    Regards
    Piyush Kothari

    STEP 1
    SAP query way to extract your information.
    Create an infoset SQ02 with a single table MKPF. (include key fields in the field group)
    Step 2
    From Extras
    Create an additional field called zawkey (like bkpf-belnr) which will concatenate the MM document number MKPF-MBLNR and MKPF_MJAHR. The sequencing shall be number 1.
    You may use this code below and paste also (this needs authorization as well)
    data: zzawkey like bkpf-awkey.
    clear: zawkey, zzawkey.
    concatenate mkpf-mblnr mkpf-mjahr into zzawkey.
    zawkey = zzawkey.
    Add another field called ACCDOCNO (accounting documnet number) with sequencing number 2 with following code.
    data: zaccdocno like bkpf-belnr..
    clear: zaccdocno, accdocno.
    select belnr from bkpf into zaccdocno where
      bukrs = ccode and
      GJAHR = MKPF-MJAHR and
      awkey = zawkey.
    endselect.
    accdocno = zaccdocno.
    Step 3
    Include the additional fields  into the field group.
    Step 4
    Click on the selection tab and create a parameter called ccode with a description Company Code and  against
    LIKE    BKPF-BUKRS 
    Extras  OBLIGATORY 
    Step 5
    Click on the selection tab and create a seelction criteria pdate with a description Posting Date for the field MKPF-BUDAT
    Extras  OBLIGATORY 
    Step 6
    Save, Generate and assign the infoset to a user group.
    Step 6
    Create a SQ01 query under the usergroup with all the fields in the infoset. and Execute. Enter a company code and one date of a working day where you expect material transactions.
    The result will be all the material documents and their corresponding accounting documents, if available. If you want to see only those material document that do not have corrsponding accounting documnet, then while you are in the selection screen say accounting document number is not equal to blank.

  • Link to find Accounting document number from Material document number / PO

    Hi
    We are working on a custom report, in which we need to print purchasing details (from EKPO, EKKO & EKBE) as well as accounting details (from BSEG & BKPF). We need to hit BKPF/BSEG with the accounting document number, since it is the only key field (though PO number is there in BKPF, we can not use this because it is not a key field)
    My question from which table we get the accounting document number ? We need to provide a link between purchasing & accounting through accounting document number, but how to find the accounting document number. ?
    Thanks
    Venkat.

    Venkat,
      I guess you are trying to fetch Accouting Documents for goods receipt against PO.
      To do this, you need to look at the PO History table (EKBE) and find out the Corresponding material document (VGABE = 1 for good receipt).
      Get the value of BELNR and GJAHR.
      Concatenate BELNR and GJAHR into your refernce key (like BKPF-AWKEY).
      Then use this key to read table BKPF with the following key
       AWTYP = 'MKPF' for Material document
       AWKEY = reference key generated above.
       AWSYS = the value of the logical system (if used) or blanks
    This will get you quicker access as compared to what you've described below. In this case, the system uses a standard SAP Index "Index by application type and key" to fetch the relevant records.
    Hope this helps.

  • Link between Accounting Document and Sales Order

    Dear SD Gurus,
    How to find the Sales Order number and Sales Order Item from the accounting document- like document types DZ, DG, ID etc.
    Kindly specify the table links and fields to fetch the above details
    Regards
    Vimal

    Link Between SAP SD, MM & FI
    The link between SD and MM :-
    1. When you create sales order in SD, all the details of the items are copied from Material master of MM.
    2. MRP and availibility check related data is also taken from MM although you control this data in SD also.
    3. While you create inbound/outbound delivery with reference to a sales order,the shipping point determination takes place with the help of the loading group, plant data, shipping conditions etc. This also refers to Material Master.
    4. The material which you are entering in a sales order must be extended to the sales area of your sales order/customer otherwise you cannot transact with this material.
    There are many such links between SD and MM.
    Now the link between SD and FI :-
    1. Whenever you create a delivery with reference to a sales order, goods movement takes place in the bacgground. eg. In case of standard sales order, you create an outbound goods delivery to the customer.
    Here movement 601 takes place. This movement is configured in MM. Also, this movement hits some G/L account in FI. Every such movement of good s hits some G/L account.
    2. The accounts posting in FI is done with reference to the billing documents (invoice, debit note, credit note etc) created in SD. Thus this is a link between SD and FI
    3. Tax determination: In case of a tax determination also, there is a direct link between SD and MM
    SD Integration points with other modules
    SD module is highly integrated with the other modules in SAP.
    Sales Order –
    Integration Points                      Module
    •Availability Check             -       MM
    •Credit Check                   -       FI
    •Costing                        -       CO/ MM
    •Tax Determination              -       FI
    •Transfer of Requirements       -       PP/ MM
    Delivery & Goods Issue –
    Integration Points                      Module
    •Availability Check             -       MM
    •Credit Check                   -       FI
    •Reduces stock                  -       MM
    •Reduces Inventory $            -       FI/ CO
    •Requirement Eliminated         -       PP/ MM
    Billing -
    Integration Points                      Module
    •Debit A/R                      -       FI/ CO
    •Credit Revenue                 -       FI/ CO
    •Updates G/ L                   -       FI/ CO
      (Tax, discounts, surcharges, etc.)
    •Milestone Billing              -       PS
    Return Delivery & Credit Memo -
    Integration Points                      Module
    •Increases Inventory            -       MM
    •Updates G/ L                   -       FI
    •Credit Memo                    -       FI
    •Adjustment to A/R              -       FI
    •Reduces Revenue                -       FI
    SD Transaction Code Flow: 
    Inquiry / Document type IN
    Tcode for creation VA11,VA12,VA13. tables VBAK,VBAP
    Quotation / QT
    Tcode for creation VA21,VA22,VA23. tables VBAK,VBAP
    Purchase Order PO
    Tcode for creation ME21,ME22,ME23. tables EKKO,EKPO.
    Sales Order OR
    Tcode for creation VA01,VA02,VA03. tables VBAK,VBAP
    Delivery LF
    Tcode for creation VL01,VL02,VL03. tables LIKP,LIPS
    Billing F2
    Tcode for creation VF01,VF02,VF03. tables VBRK,VBRP
    <b>The SD & FI link is established through mapping of appropriate G/L accounts through T.Code: VKOA</b>
    Regards,
    Rajesh Banka
    Reward suitable points.
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left. You also get a point yourself for rewarding (one per thread).

  • Could I link CKMLCP document to accounting document in CKM3 by double click

    Hello,
    We had activated Material Ledger in SAP R/3 4.6c. After I posted Material ledger settlement document in t-code: CKMLCP. I could see a ML document in CKM3 of production consumption activity. I had issued this material to production order in the closing period. So, I got a ML document to transfer 1 level price difference to next level material. When I double click on this ML document, I want to link to accounting document. How could I make it?
    For some ML doc. (Goods issue doc.), when I double click on the ML doc., I can see Accounting document and Source document icon on the screen. I want the same function of CKMLCP doc..
    Thanks in advance!

    If the document flow updation is maintained then you can link documents however its not you wont..
    check the custiomizations for this
    regards

  • Link between Invoice document items and Accounting document items

    Hello, Colleagues.
    Can you help me, please. I don't solved next problem. I should associate Invoice document (Create with MIRO) items from tab "PO reference" with items from tab "G/L account" or with tax items Follow-on accounting document. Invoice document can contain items with amount equals 0 and this items don't add to the tab "G/L account" and to the items accounting document. So Invoice document can contain items with material code greate than one.
    Or link between RSEG <-> BSEG or link between RSEG <-> RBCO.
    Thank you.

    Hi ,
    U can refer the  VBRP - vbeln to BSEG-REBZG and get REBZZ (Invoice line item).
    thanks
    Shambhu

  • How to find Invoice number linked to FI accounting document number ??

    Hello All,
    I have been looking around for all possible combinations to find the link between FI accounting document number (BSEG-BELNR) and Intercompany Invoice number (for which billing corr. to STOs' or POs' is done).
    The requirement is that during ERS posting, we have accounting document numbers (BSEG-BELNR) and associated STOs' for this (BSEG-EBELN), but we are unable to map the Intercompany Billing Invoice number(s) (where the billing corr. to STOs' obtained from BSEG-EBELN) to this accounting document number (BSEG-BELNR).
    Any pointers or detailed view solution would be of great help.
    Thanks,
    Ansh

    Hello DPM,
    Thank you for the descriptive help. But my requirement is to look for Intercomapny Billing number (VBRK-VBELN) linked to an accounting document number (BSEG-BELNR) and not Invoice Receipt Number.
    The steps that I am following are:
    From BSEG, found EBELN (Stock Transfer Order) and XREF3 (Reference Key, combination of fiscal yr., some ref. number, maybe GR no. and ref item no.), based on BELNR (Accounting document number).
    From EKBE, found XBLNR (Reference Delivery Number or Direct Intercompany Billing Number on which GR is done) based on
    EKBE - EBELN = BSEG - EBELN
    EKBE - BELNR = BSEG - XREF3 (only ref and item no., considering it to be a GR no.)
    EKBE - VGABE = '1' and EKBE - BEWTP = 'E'.
    From VBRP, found VBELN (Intercompany Billing No., which is a desired number) based on
    VBRP - AUBEL = EKBE -EBELN (Stock Transfer Order)
    VBRP - VGBEL = EKBE - XBLNR (Delivery number)
    Here, I am not sure about 2 things:
    Whether the reference no in BSEG-XREF3 will always be Goods Receipt number for Stock Transfer Order or not. If not, then what it can be and how I will have to proceed further then.
    Secondly, If in case for an accounting document number, I have 2 Stock Transfer orders (BSEG - EBELN) and same reference number (BSEG-XREF3), then from History table (EKBE) I get only single delivery based on which GR was doen for both STOs', then I shall be getting single Intercompany Billing Invoice from VBRP or different ?
    Kindly provide your inputs.
    Thanks,
    Ansh

  • How to fetch accounting document number from known material document number

    Hi,
    Using MIGO transaction, by giving mblnr(material document number) as input, I get accounting document number by clicking FI document.I have to add this accounting document number in my report for corresponding known mblnr(material document number) values.
    My question is how to fetch the accounting document number present in MIGO to add in my report program.
    I used the xblnr(Reference Document Number) which is present both in mkpf and bkpf tables to fetch values.
    I extracted xblnr values with known mblnr values from mkpf (Header: Material Document table).
    and then extracted belnr(accounting document number) from bkpf (Accounting Document Header table) by using xblnr values.
    But the query is running for a long time.
    Is there any other method  to extract the values in a simpler way.
    Kindly advise.
    Thanks and Regards,
    Sanjeev

    I had the values of xblnr and some other fields such as mblnr, budat etc in wi_item table.
    I created a new internal table i_xblnr and got down those values.
    And then created a new internal table i_belnr and tried to get values of belnr in it.
    The code I wrote is given below:
    IF not wi_item[] is initial.
    loop at wi_item.
       at new xblnr.
        ws_xblnr-xblnr = wi_item-xblnr.
         append ws_xblnr to i_xblnr.
       endat.
    endloop.
      select belnr xblnr from bkpf into table i_belnr for all entries in i_xblnr where xblnr = i_xblnr-xblnr.
    ENDIF.
    Kindly look after it.Thank you.
    Regards,
    Sanjeev

  • Link between SD invoice item and corresponding accounting document item

    Hi,
    I have a problem regarding the link between the items of an SD invoice ( or
    credit note ) and those of the corresponding accounting document. There's a
    custom report which extracts information about each credit/debit note
    produced within a certain period. This program has recently failed due to a
    particular case: a credit note was generated starting by two note requests;
    in other terms, cardinality: 1:N exists between the credit note and the
    request document. Currently, the program generates duplicated records in
    this case, because of the following schema:
    -> main loop on VBAK data ( request document header data )
       -> inner loop on BSEG data ( accounting document items );
    our current access criteria in reading tb_bseg is only:
    ... where tb_bseg-belnr = tb_vbrk-vbeln.
    Providing that tb_vbrk-vbeln doesn't differ and that both tb_vbak and tb_bseg
    contain two records ( the two requests the first and the two accounting
    document items the second ), the program fails as follows:
    ° first request  -> two lines
    ° second request -> two lines.
    Is there any way to link each invoice item with the corresponding credit
    note item?
    Thanks in advance to all of you.
    Adrian.

    Hi,
    I have a problem regarding the link between the items of an SD invoice ( or
    credit note ) and those of the corresponding accounting document. There's a
    custom report which extracts information about each credit/debit note
    produced within a certain period. This program has recently failed due to a
    particular case: a credit note was generated starting by two note requests;
    in other terms, cardinality: 1:N exists between the credit note and the
    request document. Currently, the program generates duplicated records in
    this case, because of the following schema:
    -> main loop on VBAK data ( request document header data )
       -> inner loop on BSEG data ( accounting document items );
    our current access criteria in reading tb_bseg is only:
    ... where tb_bseg-belnr = tb_vbrk-vbeln.
    Providing that tb_vbrk-vbeln doesn't differ and that both tb_vbak and tb_bseg
    contain two records ( the two requests the first and the two accounting
    document items the second ), the program fails as follows:
    ° first request  -> two lines
    ° second request -> two lines.
    Is there any way to link each invoice item with the corresponding credit
    note item?
    Thanks in advance to all of you.
    Adrian.

  • Addition of G/L items in Accounting Document during creationof Material Doc

    Hi All
    I am looking for User exit or BADI that allows me to add additional G/L line items (offsets) in Accounting Document during creation of Material Document. I wish to do this when I save Material document in MIGO, MB01 or MIRO.
    Has anyone done this before? Is there any user exit, badi or function module to do this. Please share insight on this situation.
    Thanks in advance
    Sunny

    Hi,
      check out BADI MB_DOCUMENT_BADI this would trigger before and during update task while posting Material documents i think you can ful fill your requirement with this.
    Regards,
    Himanshu

  • Material document 4900000006 does not include an accounting document

    Hi guys
    I created normal sales order, delivery and and released it thr VF01.
    Then I created the RE document without order reference and PGR. But while checking the accounting documents in VL02N it gives the error as follows
    Material document 4900000006 does not include an accounting document
    Diagnosis
    The system cannot find an accounting document for the material document 4900000006.
    Possible reasons for this are:
    The goods movement has no relevance to accounting. Therefore, the system did not generate an accounting document for the material document.
    The material document is a document that was posted before Release 2.1. Such documents must be converted so that the system can find the relevant accounting document.
    The procedure for the subsequent calculation of value is not active in your system. For further information, refer to the documentation on the program for valuating goods movements: RM07MWBU.
    Procedure
    Choose Continue and then choose another function.
    Find out when the material document was created. If the document was created prior to the Release changeover, ask your system administrator to carry out the conversion of the documents. The individual steps required for document conversion are described in the Release Notes for Release 2.1B
    Please give me the solution
    Thanks in advance
    Rahul

    Hi Rahul,
    Can you tell me how did you resolve this error indetail or step by step?  I have a same error in test client.  I am doing returns with stock catergory of E while PGI and then it throws error message.
    Material document 4900000006 does not include an accounting document
    Diagnosis
    The system cannot find an accounting document for the material document 4900000006.
    Possible reasons for this are:
    The goods movement has no relevance to accounting. Therefore, the system did not generate an accounting document for the material document.
    The material document is a document that was posted before Release 2.1. Such documents must be converted so that the system can find the relevant accounting document.
    The procedure for the subsequent calculation of value is not active in your system. For further information, refer to the documentation on the program for valuating goods movements: RM07MWBU.
    Procedure
    Choose Continue and then choose another function.
    Find out when the material document was created. If the document was created prior to the Release changeover, ask your system administrator to carry out the conversion of the documents. The individual steps required for document conversion are described in the Release Notes for Release 2.1B
    regards
    rc gopi

  • BAPI_ACC_DOCUMENT_POST to modify an accounting document

    hi,
    somebody knows how to use the FM BAPI_ACC_DOCUMENT_POST to modify an accounting document?
    I use:
    lw_cab-username   = sy-uname.
    lw_cab-doc_type   = 'KR'.
    lw_cab-comp_code  = '0001'.
    lw_cab-bus_act = 'RFBU'.
    lw_cab-obj_type = 'BKPFF'.
    lw_cab-obj_key = '190000032000012007'.
    lw_cab-obj_sys = 'HRDCLNT100'.
    * I only want to modify this field.
    lw_cab-ref_doc_no = 'NEW'.
    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
        EXPORTING
          documentheader = lw_cab
        IMPORTING
          obj_key        = l_obj
        TABLES
          currencyamount = li_currencyamount
          return         = li_return.
    but it doesn't work.
    I also need to reverse an accounting document with BAPI_ACC_DOCUMENT_REV_POST.
    Somebody knows an example that works?
    Thanks,
    Ángel.

    Hi,
                 see note 487722.
    The posting key is automatically assigned by the BAPI, u can't transfer it.
    The BAPI decides which posting key ahs to be used in order on the kind of item and operation key.
    So you can try to drive the posting key assigning a certain operation key in the item.
    Try to check the fm FI_GET_POSTING_KEY.
    I believe you can decide which operation key to be used only in the G/L items (BAPIACGL09-ACCT_KEY), for the customer the BAPI uses the keys 01 and 11.
    U can see how the BAPI decides which posting keys has to be used in the form fill_acct_key in the include LACC9F20.
    Check the therads.
    BAPI_ACC_DOCUMENT_POST issue with posting key
    BAPI for transaction FB01 with account posting key
    <b>Reward points</b>
    Regarsd

  • Posting an accounting document with material using BAPI (ver 4.6c)

    Hello!
    Can anyone help me out with this one please?
    I need to post an accounting document using BAPI.  Since the customer's SAP is 4.6c, the BAPI I found closest is BAPI_ACC_GL_POSTING_POST.
    The posting has 2 specific requirements:
    1.  For the Vendor item, the tax needs to be calculated; and
    2.  For the G/L items, the corresponding material/quantity needs to be entered
    So, my questions are:
    1.  How do you enable the "Calculate Tax" option, which is the Calculate Tax checkbox in F-02?
    2.  How do you enter the material and quantity for the G/L items?
    Thanks a lot!

    Hi,
    Before posting your document please check first whether this is reversal or not.
    please use BAPI_ACC_DOCUMENT_REV_CHECK to check reversal document
    Have a Nice Day,
    Regards,
    Sujeet

  • Sync of Material document and accounting document during MIGO

    Hi Friends,
    Can we synchronize the Document numbers between Material document (WE) for GR (101) and Accounting documents created for the MIGO transaction????
    We have 50 is assigned to WE. But, we have a gap in numbers of Material document number and Accounting document numbers??? though the document type WE is common for both.
    I have seen that "Buffer" is the culprit. But, not sure how to fix that.
    Appreciate your help in this regard.
    Dev.

    When the document type is same (WE) for both, how come the accounting doc has continuous numbers and Material doc has breaks ( from buffer)????
    document type WE is same for GR for material document and accounting docu but number range are stored diffrentely.
    OMBT is where u store the number range for material document
    and this number range is assigned to group of materia doc we wf wo ww
    OMBA is where u create diffrent number range for accounting document hear U assign WE to ur transaction code and in turn WE is assigned a number range what is created in OMBA, this number range is nothing to do with number range u have created in OMBT.
    when ever u post the docunemt in system
    SAp hav efixed the document type for GR that is WE
    it goes in OMBA in the group of Material documents for goods receipts
    check what is the year and number range assigned and current number so it assignes this number first
    than it go to OMBA  cheks what is the Tcode u are using and what is document type u have assigned to that tcode and it can be any WE or what ever u have assigned to that tcode
    taking that doc type it goes and see what Number range is assigned say 50 and then checks company code and year for this 50 and get the number for accounting doc
    so i think its is clear that material and account are 2 diffrent ranges
    skiping of numbers might be due to buffer
    also go throught following post it will be helpfull
    GR NO SEQUENCE - MISMATCH
    hope this helps

Maybe you are looking for

  • How do I retrieve a corrupted psd file that opens up as a black layer?

    The preview of the picture still appears when I select it in Photoshop, and even appears for a few seconds in Adobe Bridge before going back to black. But nothing I tried, from restore plug ins to online retrieve systems (that tried to bring back ind

  • How to fix bootcamp error: No bootable device --- insert boot disk and press any key

    Hi everybody, It seems that I triggered a bootcamp "bug" that involve the malfunction of the partition hierarchy after the creation of a new partition. After some work I managed to get back again bootcamp in bootable partitions choice window, but if

  • AMD Opteron on Oracle 9i.

    Hi, I would like to know if AMD Opteron platfrom is now supported on Oracle 9i using SUSE or Redhat Linux distribution. If not, do we know when will be it available or any plans for this platform? Any info would much be appreciated. marlonie

  • Windows 2008 R2 with Connection Broker

    Hi Ive been trying to add windows 2008 r2 farm to vdi. Ive done the steps to install the certificate etc on RDS hosts. I can add either one of the hosts as a desktop provider. But when i want to add 2 or more hosts to one desktop provider VDI complai

  • IDOC for distributing Batch/Lot data

    Dear Experts, Which IDOC should be used to distribute the batch/lot (tables MCHA, MCHB, MCH1 / transaction MSC1N, MSC2N) create and changes? Thank you very much.