Related Accounting Document Number for an SO

Hi,
How will I determine the Accounting Document number related to a Sales Order?
I know the flow is in VBFA but, I can't seem to see the Accounting Document number in there be cleared/completed or not cleared.
Is there a function module, bapi that I could use?
Thanks,
KLL

Hi,
  If you to check whether the accounting document is cleared of not ..Check the field BSEG-AUGBL not initial..
  If the field BSEG-AUGBL is initial.
     accounting document not cleared.
  elseif the field BSEG-AUGBL not initial.
     accounting doucment is cleared.
  endif.
Thanks,
Naren

Similar Messages

  • Relation accounting document number and clearing document number

    Hi everyone,
    What is the relation between accounting document number and clearing document number.

    For every accounting document when it is posted it should be available in BKPF Doc header table.. Once that document is closed or cleared..there is any entry made to BSAK for Vendors (Cleared Items) or BSAD for Customers (Cleared Items).
    Eg: When a invoice is generated for a PO it gets created and is still not cleared or is not closed , it makes an entry in BSIK. Once it is closed it is available in BSAK.
    Same is the case with Sales order..

  • Accounting document number for MIRO

    Hi All,
    Please help me out, is there any way to find out the accounting document of MIRO documents, apart from BKPF table.
    Actually i am checking for developing a query for finding the MIRO which are created without PO details, that is the MIRO dont have any Purchase order details or reference. These MIRO document will be captured in table RBKP but not in RSEG. How can we get only those document which is not created with reference to PO in a query.
    Please help me out on this.
    Waiting for a best solution on this.
    Thanks,
    Nitin Kumar

    HI Ravi,
    Thanks for the response,
    The issue here is all the MIRO invoice done with PO reference or No PO reference will be having the same document type RE, how can we differentiate them.
    Thanks,
    Nitin Kumar

  • How to get an accounting document number from an Invoice number

    Dear All,
    I have a requirement where I need to know which accounting document is created against a  particular invoice. As we know that in the document flow of invoice we can see the Accounting document also. But to develop the report I need to pick the accounting document by the invoice document. Please suggest me a table where this value is getting stored. I already tried VBFA and VBKD but nowhere I am getting such information from which I can pick a accounting document number for a particular invoice.
    Please give me your suggestions.
    Regards,
    Sanju

    Dear,
    For Billing document create no. range by Tcode-VN01 and assign it to in Tcode-VOFA
    For Accounting document create no. range by Tcode-FBN1 and activate the External Field and assing it to in Tcode- OBA7
    but Assign the same no. range to both Document types for exp 1000000 to 1999999.
    Regards
    AJIT K SINGH
    HAPPY TO HELP U

  • Table relations between vbrk and bkpf for  Accounting Document Number

    hello,
    i am using 4 tables to get data into my programs.
    vbrk,vbrp konv and bkpf.
    i want to get belnr from bkpf.i found relation between vbrk and belnr.but in vbrk table belnr's value is initial.
    can anybody tell me that how should i relate vbrk and bkpf or how to get Accounting Document Number(belnr) from bkpf for Billing Document(vbeln).
    regards,
    soniya s.

    hi,
    chekc this. its working for me.
    data : WA_AWKEY LIKE BKPF-AWKEY.
    data :  WA_BELNR LIKE BKPF-BELNR.
    data : LENGTH TYPE I.
    *BREAK MTABAP.
    LENGTH = STRLEN( IT_VBRK-VBELN ).
    if  LENGTH = '10' .
    MOVE it_vbrk-VBELN TO WA_AWKEY.
    SELECT SINGLE BELNR FROM BKPF INTO WA_BELNR
      WHERE AWKEY = WA_AWKEY
      AND AWTYP = 'VBRK'
      and blart = 'RV'.
    it_final-acc_doc = WA_BELNR.
      CLEAR WA_BELNR .
      CLEAR WA_AWKEY .
    else.
    CONCATENATE '0' it_vbrk-vbeln INTO wa_awkey.
    SELECT SINGLE BELNR FROM BKPF INTO WA_BELNR
      WHERE AWKEY = WA_AWKEY
      AND AWTYP = 'VBRK'
      and blart = 'RV'.
    it_final-acc_doc = WA_BELNR .
      CLEAR WA_BELNR .
      CLEAR WA_AWKEY.
    endif.

  • Table for Dispute case ID and accounting document number

    Hi,
    For a given dispute case ID (EXT_KEY) I am unable to find the corresponding accounting document number ( BELNR ) for this dispute case. I am able to see the accounting document for the dispute case on the transaction UDM_DISPUTE but then I am not finding the same in any tables. Can anyone let me know in which table can I find the relationship to determine this. Thanks in advance.
    Rgds,
    Sowmya

    Hi Sowmya,
    check the table UDMCASEATTR00.it contains all the details about disputemanagement
    please reward poitns if helpful

  • How to catch accounting Document Number in SE37 for  BAPI_ACC_DOCUMENT_POST

    HI Frds,
    My ReQ is i have to post Customer Invoice from Legacy to ECC through PI interface. So i am using one BAPI , ' BAPI_ACC_DOCUMENT_POST''. I had customized this BAPI by adding 2 fields (1.zstatus, 2.zsaprefno) as i have to send the status(1. Success/Fail, 2.Account Document Number) back to Legacy.
    For PI i have to give the BAPI structure. So when i am executing in SE37 zstatus field is catching the value as 'Success'. But the ZSAPREFNO is not catching the account document number. Bez we have to execute BAPI_TRANSACTION_COMMIT after this BAPI(in test sequence from Menu bar). So directly updating in Database tables.
    when i was excuting in SE38 the Accounting Document Number is returned in RETURN parameter of MESSAGE_V2 as we are checking the return parameter after BAPI_TRANSACTION_COMMIT.
    when i am trying in SE37 its not catching the value in MESSAGE_V2(catching as $).  After COMMITing we have no option to check the RETURN parameter.
    So, any idea how to get the Account Document Number  in SE37.......Or any other way to do..........
    Edited by: priya tavanam on Sep 3, 2010 7:02 AM

    Hi,
    if standard BAPI did not return the Acc. document number before BAPI_COMMIT then create wrapper FM
    1) call actual BAPI and BAPI_COMMIT with in that.
    2) retrun the account document back.
    otherwise you can try sync proxy as well.
    Regds,
    Suresh

  • Incremental records for accounting document number

    I am facing a problem where I need to get incremental upload. I have to get the Accounting document number posted for an asset. I was thinking of using ANLP-BELNR, forming the AWKEY from it, and then getting the BKPF-BELNR. This way I thought I would get incremental records, as BKPF has CPUDT and CPUTM. But my confusion is:
    1) is that date and time the time when the document was posted?
    2) this date and time differs from the date(CPUDT) and time(CPUTM) in ANEK table? Does that make any difference?
    3) Also I checked CDPOS, and for OBJECTCLAS = BELEG, adn TABNAME = BKPF, there is no entry with Changeid = 'I'. That means the new documnets posted are not being captured in CDPOS?
    Please tell me a way how can I get the incremental data?
    Thanks a lot,
    Nalini

    Here you go....
    RF_BELEG
    Regards,

  • For BSID- Accounting Document Number corresponding PO Number is required

    Hi Gurus,
                 I have got a requirement to develop a report similiar to 'FBL5N' . I am getting the details of open and cleared items of a customer from BSID and BSAD tables respectively. My requirement is also to fetch the corresponding PO number of the LINE items displayed in the report.
                Can any one suggest how can I fetch PO number with Accounting document number(BSID-BELNR)  or (BSAD-BELNR).
               Your efforts in this matter are deeply appreciated and <<removed_by_moderator>>.
    Thanking You,
    ZIa.
    Edited by: Vijay Babu Dudla on Jan 28, 2009 11:07 PM

    If you have fields BSID-VBEL2 and BSID-VPOS2 are populated with the sales order, than access VBKD with the Sales Order to get the Customer PO (VBKD-BSTKD)
    Or
    First, You need to get the Billing document. Access BKPF with the BSID-BELNR to get the AWKEY where AWTYP = 'VBRK'
    Now, you can go to SD document flow with the billing document to find out the Sales Document. Access VBKD with the Sales document to get the Customer PO
    Regards,
    Naimesh Patel

  • Excise No. using  Accounting Document Number and the P.O. number

    Hi All ! In my GL report, I'm displaying the Accounting Document Number and the P.O. number.
    Now, the requirement is to display the excise no..
    Tried different tables in SE11 using J_1EXC for excise detials, but to no avail.
    And last which vendor to pick, Because vendors in P.O and BSEG differs.
    If I use the BSEG-BELNR I get a different vendor & If I use the P.O. no. in EKKO then also I get a different vendor.
    Please suggest.

    Hi,
    Actually the vendor in the accounting document and PO should match. If not look in table EKBE, It will have the accounting document or at least the invoice receipt against which accounting document would have been created. Check if the vendor number matches with the invoice receipt.
    Regarding the excise number I'm not sure what you mean, If you mean excise invoice number, you can look at the J_1IEXCDTL
    J_1IEXCHDR tables. You could check with FC on what basis the document is getting created to make out the relation ship. If it is vendor excise no etc. you can hit F1 help to find out the table etc.
    Hope it helps.
    Sujay

  • Retrieving Accounting Document number based on PO numbers

    Hey All,
            I have a list of PO numbers(EBELN) for which I am trying to get all Accounting information from BSIS. But before going to BSIS I am trying to determine the Accounting document number(BELNR) from some other table so that my select on BSIS will be efficient.
    What I have tried uptill now is to go to EKBE with the PO numbers and get the Material document numbers. For some cases the material document number is the accounting document number and for others I have to go to BKPF with this material document number to get the accounting document number.
    Is there any other easier and efficeint way of doing this?
    Any input is highly appreciated.
    Thanks

    I am retrieving Large amounts of data, around 1.5 million from BSIS.
    The code related to our discussion looks like this:
    "First I get all related PO's for the last three years and determine the no of packets.
    DO v_no_of_packets TIMES.
          IF v_end_indx GT v_total.
            v_end_indx = v_total.
          ENDIF.
          REFRESH i_ebeln_range[].
          APPEND LINES OF t_ebeln_range FROM v_start_indx TO v_end_indx TO i_ebeln_range.
          v_start_indx = v_end_indx + 1.
          v_end_indx   = v_end_indx + p_pkjsiz.
    IF NOT i_ebeln[] IS INITIAL.
      CLEAR l_bkpf.
      REFRESH l_bkpf[].
      SELECT ebeln ebelp zekkn vgabe gjahr belnr buzei FROM EKBE INTO TABLE t_belnr
                         WHERE ebeln IN i_ebeln_range
                          AND vgabe IN ('1' ,'2').
      IF sy-subrc EQ 0.
        LOOP AT t_belnr.
        l_awkey+0(10) = t_belnr-belnr.
        l_awkey+10(10) = t_belnr-gjahr.
        IF t_belnr-vgabe = '1'.
          l_awtyp = 'MKPF'.
        ELSE.
          l_awtyp = 'RMRP'.
        ENDIF.
        SELECT SINGLE bukrs belnr gjahr blart budat
          FROM bkpf INTO l_bkpf
            WHERE awtyp = l_awtyp
            AND   awkey = l_awkey.
          IF sy-subrc EQ 0.
             APPEND l_bkpf.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDIF.
    "Then
      SELECT zuonr hkont gjahr belnr buzei budat blart wrbtr shkzg xblnr
    waers bukrs
       INTO TABLE i_bsis
       FROM bsis
       FOR ALL ENTRIES IN l_bkpf
        WHERE bukrs = l_bkpf-bukrs
                          AND  hkont IN r_hkont   "Contains all Accounts
                          AND  budat = l_bkpf-budat
                          AND  augdt = 0
                          AND  augbl = space
                          AND  gjahr = l_bkpf-gjahr
                          AND  belnr = l_bkpf-belnr
                          AND  blart = l_bkpf-blart
                          AND  gsber = c_zrl1.
      SELECT zuonr hkont gjahr belnr buzei budat blart wrbtr shkzg xblnr
    waers bukrs
       APPENDING TABLE i_bsis
       FROM bsas
        FOR ALL ENTRIES IN l_bkpf
        WHERE bukrs = l_bkpf-bukrs
                          AND  hkont IN r_hkont
                          AND  budat = l_bkpf-budat
                          AND  augdt = 0
                          AND  augbl = space
                          AND  gjahr = l_bkpf-gjahr
                          AND  belnr = l_bkpf-belnr
                          AND  blart = l_bkpf-blart
                          AND  gsber = c_zrl1.
    "Then process this data

  • Report with Invoice and Accounting Document Number

    Dear Experts,
    Here i have a requirement.
    I wanna a report which gives a Invoice (MIRO) and its accounting documents (Follow on document) in one page. Because If I view a MIRO document, for checking the accounting document, I need to click on Follow on doc, then I'll get.
    But If wanna see for 1000 MIRO documents with accounting document number, then I don't want to click 1000 times to see the account doc for respective Invoice number.
    The approximate format is,
    Column 1                              Column 2     Column 3        .......................              Column n
    MIRO  (Invoice number)                             Accountting Doc Number
    5100000099                                              5100000011
    Which tcode will give the both in one screen?
    Thanks in advance
    Regards,
    navahsek

    Hi,
    Enter Sork Key 002 for Vendor Master Record.
    and also you can check the Report in ECC 6.0
    MIR5 - Display List of Invoice Documents
    There you select Export Mode --> Display Accounting Document Number.
    You can get Report FI and MM Document Numbers.
    Hope It will Clear.
    Regards,
    Kishore

  • Accounting doc number for a material doc

    Hi Experts,
    Pls help me to know the accouting document number for a material document.
    Is there any functional module for the above or any table fields.
    currently we are developing zprogram.
    Appreciate for advices.

    Hi
    u want Accounting document against Material document
    means
    u done GR through Migo
    and ur documennt type is We _ goods receipt - this is ur material document no
    u done invoice dopcument againmst Gr - RE Dcoument type - accounting Document No
    see when u going to Po , purchase order history
    then bothe Gr and IR document u seen
    for example :_ gR - 500000123
    and             IR 5105601234
    but when u double clcik on IR Dcoument , screen will be open
    here u also se another accounting no document see 510004563 then clcik on this field and f1 then u see table and field
    i can tell u u doing GR 5000000123
    at the time of ir two document no genrated
    one for document for Mm Point of view and one for Fianance point of view
    means 5105601234 is MM Accounting dcouemnt
               510004563 is finance accounting document
    i hope u clear that
    if any query revert back
    Regards
    Roobal

  • 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

  • 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.

Maybe you are looking for

  • Why is Adobe Muse not spell checking?

    So I am building a site on Adobe Muse CC and I noticed the program is not spell checking as I write.  I purposely misspelled words to see if the spell checker would put the red squiggly line underneath misspelled words but it doesn't.  I have searche

  • I just cant reload the Mac OS

    I just reformatted the hard drive to FAT 32 re-installed it. Put in the mac os disc and the mac goes to a black screen and does nothing after a few minutes. Please help me!

  • Call SE38 from ALV list

    hi Experts.. I need your Help.. I am creating one list in which I am displaying list of FORM Userexit Defination according to the program.. Example : program name : MV50AFZ1                 Form Defination : FORM USEREXIT_MOVE_FIELD_TO_LIKP. If I cli

  • How do I stop Firefox blocking my bank log in sites, when I click allow the bank resets to default which then Firefox blocks again.

    Every time I try logging into my bank accounts ie Nat West, Lloyds or Barclays I get the Firefox pop up bar saying "Firefox prevented this page from automatically redirecting to another page" and when I click on allow the bank log in page goes back t

  • IPhone or iPad for ebooks

    Just curious if I'm the only one who prefers the iPhone rather than the iPad for reading ebooks. I prefer the one handed operation and I guess I got used to it over the past year before the iPad was available.