BSEG to VBRP AND VBRK

Hello,
I need to link sales orders in VBRP and VBRK to their respective GL line entries in BSEG.  Dos anyone have a SQL query that accomplishes this?  I'm not sure what the relationships are between BSEG and these sales tables.
Any help would be greatly appreciated!
Thanks,

Hello,
Thanks for the answer, however it's not quite what I was looking for.
To make it easy, here's what I need:
SELECT *
FROM VBRP a
INNER JOIN BSEG b ON (a.VBELN = b.VBELN AND a.? = b.?)
I need a query that gets me from the VBRP table to the BSEG table.  I know I can link on the invoice number (VBELN), but I'm not sure how to complete the link since the link is from one detail table to another detail table.  Does VBRP.VBPOS equate to something in the BSEG table?
Basically I'm trying to get a listing of each invoice (with SQL) and figure out what the GL segments were for that invoice.
Hope this clears things up.
Cheers

Similar Messages

  • VBAP and VBRP and VBRK COPA

    All,
    When does the table VBAK gets updated.  I have a several  billing documents with no material group 4 assignment in VBAK.  This is all part of researching about COPA repot
    1) When I looked at one billing document in VBRP and VBRK tables, there is material group assignment group4/A30
    2) In VBAP table, for the same billing document, the material group4  field has no value in it.  It's causing the values not picking up in COPA
    3) When I looked at the COPA value field and characteristic config, the characteristic material group4 is pointing out from VBAP table.
    What is causing this table not getting updated?  how can we point out the material to VBAP table.  
    4) I also have to exclude the material gr from a COPA report.  How can I do this?

    Thank you so much for your response.  I have assigned full points for you.
    --Yes there is no material group4 assignment in sales document. When I hit FI on material group4 field in sales document and view the technical data, the field data tab has MVKE,/MVGR4  and field description has MVKE-MVGR4.  Does it mean, even if it has the value in the field, it pass the values to those tables showing in the technical information tabs?  Why it's not VBAP table?
    --How come the billing document has the material group 4 assignment when the sales document doesn't have.  
    --When I looked at the material data in MM03, that doesn't have material group4 assignment either.  
    -- I thought material that they are using on sales document triggers to sales and billing documents.  
    Could you please explain this to me.  I appreciate your time.
    Thanks,
    Sri

  • How can I link table KONV with table VBRP and VBRK using KSCHL field?

    Hi experts,
    How can I link table KONV with table VBRP/VBRK using KSCHL field so that items are fully filtered?
    Thanks,

    Hi,
    If you do not want to specify it as hard code, then define a variable for it if you want to pass the value for it from the selection screen so that it will be dynamic. Code will be as follows.
    select-options: x_KSCHL for T685l-KSCHL.
    select kwert
               kbetr
               knumv
               kposn
               kschl
          from konv
          into CORRESPONDING FIELDS OF TABLE it_konv
          FOR ALL ENTRIES IN it_all
          where knumv = it_all-knumv
          and   kposn = it_all-b_posnr
          and   kschl in x_KSCHL. "Dynamic Selection as per the selection screen input
      endif.
    Hope this helps.
    Regards,
    Chandravadan

  • Relation field between table VBRK/VBRP and BSEG

    Can any body guide on the common fields between VBRK/ VBRP and BSEG, except field "assignment".

    Hi,
    If you know the accounting document number, Goto SE16. enter BSEG table and enter.
    Enter the accounting document number in selection screen. E.g 90000498.
    You will get multiple lines. E.g normal billing document(Not credit memo /debit memo)
    Customer information will be available in posting key 01 line (Header). And Item information will be avilable in Posting key 50 line.
    List of fields available in Header.
    Billing document number
    Customer
    Payment terms
    Amount.
    Company code
    Controlling area
    Reconciliation account number
    Assignment
    Item level information in Posting key 50.
    Material
    Plant
    Amount
    Tax amount
    Tax code
    As per my knowledge for reporting purpose we don't use BSEG  bcoz of performance issue.
    BKPF -  Accounting document Header
    BSID
    BSIS
    Regards,
    Chandra

  • Link between KONA and VBRK/VBRP and KONP and VBRK/VBRP

    Hi
    please suggest me the link between KONA and VBRK/VBRP and
    KONP and VBRK/VBRP
    I want to give link of rebate agreement and invoice no/Inv Qty
    My requirement is I want a report where i can see Under one Rebate agreement ,how many Commercial Invoice use
    e.g. Rebate Agreement no -125 ( for 10 Rs / unit)
    I have created 10 Invoice for 10 qty each so accrual Amount is 10* 10= 100
    I want such report where for agreement No 125- 10 Invoice No should be reflected.
    I don't want to go into VBO2 and go to verification level that concept i know
    i want one report where i will see all
    Regards
    Hemant

    Hi
    In my case i want commercial invoice no (billing type F2) but if i try to find link between KONA and VBRK for field KNUMA i can only see credit Memo No(Billing type-B3-rebate billing type) ,
    I want to display commericial invoice and not rebate credit memo
    Pls advice
    Regards
    Hemant Gaikwad

  • Link betwwen KONA and VBRK/VBRP

    Hi
    please suggest me the link between KONA and VBRK/VBRP and
    KONP and VBRK/VBRP
    I want to give link of rebate agreement and invoice no/Inv Qty
    My requirement is I want a report where i can see Under one Rebate agreement ,how many Commercial  Invoice use
    e.g.  Rebate Agreement no -125 ( for 10 Rs / unit)
    I have created 10 Invoice for 10 qty each so accrual Amount is 10* 10= 100
    I want such report where for agreement No 125- 10 Invoice No should be reflected.
    I don't want to go into VBO2 and go to verification level that concept i know
    i want one report where i will see all
    Regards
    Hemant

    You can go via KONH - KONV to VBRP but you will have big performance issues especially with the KONV table when you enter the condition record number from KONH only.
    Much easier go to KONH enter your Agreement number. Get the KNUMH from your rebate agreement and enter it in Table S136. This will give you all the invoices associated with your rebate.
    Good Luck.

  • Link between VBRP and KONV

    hello,
        any idea for the link between VBRP and KONV tables ?
    I am fetching vbeln from vbak and based on that i am getting matnr and quantity details from vbrp now i want to get condition type and tax code details from konv.how to link it?
    regards
    Soniya.

    KONV (condition table) is linked to VBRK (Billing: Header data) by the following
    VBRK-KNUMV = KONV-KNUMV
    and VBRK (Billing: Header data) is linked to VBRP (Billing: Item data) by the following
    VBRK-VBELN = VBRP-VBELN
    I believe you can can fetch data from VBRP using for all entries.
    Then fetch the data from KNOV table using the above given link and then modify the required internal table to retrieve the required result.
    Hope it helps

  • Link between vbap and vbrk

    hi folks
    whatt's the link between vbap and vbrk table.
    gaurav

    Hi Gaurav
    VBAP is Sales document item detail table and VBRK is Billing header data table.
    VBRK is linked to VBRP by VBELN (i.e. VBAP-VBELN = VBRK-VBELN).
    VBRP is linked to LIPS(SD document: Delivery: Item data)by
    VBRP-VGBEL = LIPS-VBELN.
    VBRP-VGPOS = LIPS-POSNR.
    And LIPS is linked to VBAP by
    LIPS-VGBEL = VBAP-VBELN.
    LIPS-VGPOS =VBAP-POSNR.
    the flow of the SD tables is like after creation of the sales document the header details of the document is filled in VBAK.THe item details of the sales document is stored in VBAP.After creation of the delivery the delivery documnet number is updated in the LIPS table and than if the INVOICE for the particular delivery is done than the BILLING document is generated the details of which can be looked in VBRK.

  • Link between VBAK and VBRK

    Hi
    How to link VBAK(sales order)and VBRK(billing document)?
    what are the fields to link and how to link. because vbak-vbeln is sales order number and vbrk-vbeln is billing document number.
    need help...
    Thanks
    smita

    hi,
    Following tables are included in link (In chronological order):
    VBAK - sales documetn header,
    VBAP - Sales document item
    LIPS - Sales doc. Delivery items
    VBRP - billing item data
    VBRK - Billing header
    generally sales doc and billing docs are related by delivery docs.
    u can join these tables using joins in select statement.
    join structure will loolk like.:
    select .....
    from vbak as a
    inner join vbap as b on avbeln = bvbeln
    inner join lips as c on cvgbel = bvbeln and cvgpos = bposnr
    inner join vbrp as d on dvgbel = cvbeln and dvgpos = cposnr
    inner join VBRK as e on evbeln = dvbeln
    Also, pl refer following file, very helpful, forever.
    http://www.sap-img.com/sap-download/sap-tables.zip
    Jogdand M B
    PS: Reward if helpful...

  • Question about tables LIKP and VBRK

    I am looking for a join, view, etc... between the tables LIKP (Sales header data) and VBRK (delivery header data).  What we want is information from LIKP and one piece of information from VBRK for the corresponding shipment.  From what I can tell, the only way to join these two tables is by going through tables LIPS (Sales items) and VBRP (delivery items).  Does anybody know of an easier and quicker way?  We will only look at this once or twice a year so creating a program for it is the last resort.
    Regards,
    Davis

    Hi
    Please check the function 'RV_ORDER_FLOW_INFORMATION'
      CLEAR : gt_vbco6, gt_vbfatab[], gt_vbfatab.
      gt_vbco6-mandt = sy-mandt.
      gt_vbco6-vbeln = p_vbeln.
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
        EXPORTING
          comwa    = gt_vbco6
          n_stufen = '50'
          v_stufen = '50'
        TABLES
          vbfa_tab = gt_vbfatab.
    LOOP AT gt_vbfatab WHERE vbtyp_n EQ 'J'
                         AND   vbtyp_v EQ 'M'.
    ENDLOOP.
    Hope this helps
    Caglar

  • LIKP and VBRK query

    Hi SAP gurus,
      I'm now writing a query using table LIKP and VBRK to display outbound delivery number and its associated S/O number returning by field VBRK-ZUONR (assignment), because somehow i found this field contains the relevant S/O number i am after.
      It is a pretty simple left outer join between LIKP and VBRK, however results are listed but returned with an empty list "Assignment" left to outbound delivery numbers. i picked up one O/B to check to make sure the assignment number and it is definitely available.
      Could anyone please advise a way of solving this problem, or otherwise if anyone knows how to write the query to display outbound delivery together with its associated S/O will be very much appreciated. (Note: table VBFA is not considered as one of the ways as i have to present a query)
      Many thanks
      Simon

    Dear Simon
    You can track the preceding data from delivery document which is stored in table LIPS and the field name is [VGBEL]
    thanks
    G. Lakshmipathi

  • Join two  tables BKPF and VBRK

    I need a report that will join two  tables BKPF and VBRK in QuickViewer. The only field with the right character length is XBLNR but when creating the join no records are dispalyed beacuse the values of this field in both tables are not the same.
    There are also other fields available in BKPF but the char length is not the appropriate.
    Does anyone have any idea how I can link these two tables?
    Thank you

    Neither  of these combinations  is possible with QuickViewer because the fields need to have the same length of characters in order to create the join.
    VBRK - VBLEN char(10) and BKPF - AWKEY char(20)
    VBRK -ZUONR char(18)     BKPF- BELNR char (10)
    Any other idea?
    Thank you, JP

  • Link field between kna1 and vbrk

    Hi All,
    how to link KNA1 and VBRK ?
    i need to get customer number KUNNR using Billing document number VBELN.
    reply asap.
    Regards,
    Booma Ganesan.

    Hi,
    VBRK-KUNWE will have the KUNNR value. Otherwise take the VGBEL and VGPOS value from VBRK and use that in LIKP as VBELN = VGBEL, select the KUNNR number. Use that in KNA1.
    Reward if useful..
    Thanks,
    Muthu.

  • Net Weight (NTGEW) does not populate in table VBRP and LIPS for Purch Order

    The net weight field (NTGEW) does not populate in tables VBRP and LIPS when created from a Purchase Order.  The field Net Weight (NTGEW) does populate when created from a sales order.  Do you know if there is a way to make the field populate when created from a Purchase order?
    Thanks,
    Ta

    Hi,
    Ta
    In Material master Basic Data tab 1, you have to maintain Gross wgt and net weight. then when you creating purchase order, The Item level, Additional data tab you will able see Gross and net wgt.
    I hope solved your problem.
    Regards....
    Sanjeev

  • How to Join VBRK, VBRP and BSEG

    Dear Guys
    I have Billing No from VBRP/VBRK and want to join these tables with BSEG to pick Accounting Doc No.
    How to Join these tables.
    Thanks

    Hi,
    What you can do is to use FM AC_DOCUMENT_RECORD. Please check my example below:
    MOVE: 'VBRK'          TO lv_awtyp,
                  wa_vbrk-vbeln TO lv_awref,
                  '2007'      TO lv_aworg.
            CALL FUNCTION 'AC_DOCUMENT_RECORD'
              EXPORTING
                i_awtyp            = lv_awtyp
                i_awref            = lv_awref
                i_aworg            = lv_aworg
    *           I_AWSYS            = ' '
    *           I_AWTYP_INCL       = ' '
    *           I_AWTYP_EXCL       = ' '
    *           I_BUKRS            = ' '
    *           I_VALUTYP          = '0'
                x_dialog           = ''
              TABLES
                t_documents        = lt_documents
              EXCEPTIONS
                no_reference       = 1
                no_document        = 2
                OTHERS             = 3
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
    Hope it helps...
    P.S. Please award points if it helps...

Maybe you are looking for