Regarding BKPF ,BSID and BSEG

Hello ,
I want to know that the internal content differnece between the
BKPF and BSEG and BSID Tables.
Thank you

hi,
Transanctions posted to FI(from all Modules) will store the BKPF and BSEG tables. BKPF is the header table and BSEG is the line item table.
BSID is the secondary index table for customer realated transactions. In BSID table most of the fileds avilable in BKPF and BSEG will be there.
Customer related open item transaction will update in BKPF&BSEG, BSID tables.
BSID = open items
BSAD = not open items
For kreditors it is BSIK and BSAK
For G/l a BSIS and and BSAS
When you make a posting it update's these tables.
For this reason it is important to set up your G/L accounts correct. When you found a way to change G/L account (if balans value is 0) you get wrong information in your line item overview. For the G/L accounts you can use the ABAP's RFSEPA** to change the G/L account (you have to make a little change in the program that you can run it and it only working for old G/L. Before you do this have a look to the OSS note about this, there are some riscks about this).
http://www.erpgenie.com/sap/abap/tables_fi.htm
regards
prasanth

Similar Messages

  • Fetching data slow from MSEG and BSEG table

    Dear Experts,
    Out  MSEG and BSEG are major tables which are very slow and taking 5-10 minutes in fetching just 20/30 records.
    Why this table taking more time and how I can fatch fast  data from these table.
    regards

    > Out  MSEG and BSEG are major tables which are very slow and taking 5-10 minutes in fetching just 20/30 records.
    > Why this table taking more time and how I can fatch fast  data from these table.
    Do you select on key fields or on indexed fields? How do you select?
    If not, then the database must read the full table and check which of the entries are valid for your selection.
    Do an SQL trace using ST05, run the command, stop the trace and check the explain.
    Markus

  • How to create view on bkpf and bseg?

    friends,
      can we create views on bkpf and bseg if yes wht are the steps...please note it down n send me..regards essam ([email protected])

    Hi,
    Use standard views...
    View name                      Short text
    BKPF_AEDAT                     BW FI: BKPF Extraction Using AEDAT
    BKPF_BSAD                      BW FI: BSAD Extraction Using CPUDT
    BKPF_BSAD_AEDAT                BW FI: BSAD Extraction using AEDAT
    BKPF_BSAK                      BW FI: BSAK Extraction Using CPUDT
    BKPF_BSAK_AEDAT                BW FI: BSAK Extraction using AEDAT
    BKPF_BSID                      BW FI: BSID Extraction Using CPUDT
    BKPF_BSID_AEDAT                BW FI: BSID Extraction using AEDAT
    BKPF_BSIK                      BW FI: BSIK Extraction Using CPUDT
    BKPF_BSIK_AEDAT                BW FI: BSIK Extraction using AEDAT
    CRMV_BKPF_BEBD                 FI Documents Relevant for Feedback to CRM
    V_EWU_BKPF                     Update View for Parallel Processing on BKPF
    V_VBSEGK
    V_VBSEGS
    Regards,
    Omkar.

  • How to join BKPF and BSEG

    Hi Experts,
    how to join BKPF and BSEG
    Thanks
    nagini

    Hi,
    BKPF is Transparent table but BSEG is cluster table.  We can't create views by joining cluster tables.
    hope it helps...
    regards,
    Raju

  • Gurus...Need help....extract data from BKPF header table and BSEG line item

    Gurus,
    I have to write the logic to fetch data from bkpf and bseg. Need help on how can i do that..
    I have to get bukrs  belnr gjahr ldgrp from BKPF for a given date and company code. For all these documents, then i have to get the line items from BSEG if the ldgrp is I1 or SPACE.
    If the ldgrp is not I1 or SPACE then i have to fetch the records from BSEG_ADD and then generate a ALV report with all the data including the data that was fetched from BKPF.
    So, it wil be a combined ALV report that displays header as well as LINE item data together...
    Can u please help me with the code...I am not sure how can everything go all together in one internal table....Becoz once its there in one table then only a ALV list can be generated.......
    Cheers:
    Sam

    hi Sam, this may be of some similar thing.
    Use this program, I got this prog from a source and we added a small conditional check in the program which checks document numbers in BSEG and also comapres in BKPF and sees if the output from BSEG falls under the posting data range specified in the initial selection.
    Now just so you know, this output is kinda messed up, so you will have to play with it in Excel to extract the document numbers, if that is what you want.
    ============================
    PROGRAM....... ZFI_BSEG_DOWNLOAD
    TITLE......... Download BSEG
    PROGRAM TYPE.. Download
    ======================================================================
    GENERAL DOCUMENTATION AND COMMENTS
    <...>
    ======================================================================
    ASSOCIATED PROGRAMS
    <Program>..... <Description>
    ======================================================================
    CHANGE HISTORY
    Date By Ticket Description
    REPORT zfi_bseg_download.
    TABLES: bseg, bkpf.
    TYPES: BEGIN OF ty_output,
    line(6000) TYPE c,
    END OF ty_output.
    TYPES: ty_tab_output TYPE TABLE OF ty_output,
    ty_tab_nametab TYPE TABLE OF x031l.
    CONSTANTS: c_delimiter(04) TYPE c VALUE '"%%"',
    c_records TYPE i VALUE 10000.
    SELECTION-SCREEN
    SELECT-OPTIONS: p_bukrs FOR bseg-bukrs,
    p_belnr FOR bseg-belnr,
    p_buzei FOR bseg-buzei,
    p_gjahr FOR bseg-gjahr,
    p_budat for bkpf-budat.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_append AS CHECKBOX DEFAULT 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM get_records.
    *& Form get_records
    FORM get_records.
    DATA: l_cursor TYPE cursor,
    lt_bseg TYPE TABLE OF bseg,
    ls_bseg LIKE LINE OF lt_bseg,
    lt_output TYPE ty_tab_output,
    ls_output LIKE LINE OF lt_output,
    lt_nametab TYPE ty_tab_nametab,
    ls_nametab LIKE LINE OF lt_nametab,
    l_field(30) TYPE c,
    l_output(50) TYPE c,
    l_date(10) TYPE c,
    l_len TYPE i.
    FIELD-SYMBOLS: <field>.
    IF p_append NE space.
    OPEN DATASET p_file FOR APPENDING IN TEXT MODE.
    ELSE.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
    ENDIF.
    Retrieve BSEF fieldnames and data types
    PERFORM get_fields CHANGING lt_nametab.
    OPEN CURSOR l_cursor FOR
    SELECT * FROM bseg
    WHERE bukrs IN p_bukrs
    AND belnr IN p_belnr
    AND buzei IN p_buzei
    AND gjahr IN p_gjahr.
    Write out fieldnames
    IF p_append IS INITIAL.
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE ls_output ls_nametab-fieldname
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDIF.
    Process BSEG records
    DO.
    CLEAR lt_bseg.
    FETCH NEXT CURSOR l_cursor
    INTO TABLE lt_bseg
    PACKAGE SIZE c_records.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT lt_bseg INTO ls_bseg.
    SELECT single * FROM BKPF
    WHERE BUKRS = ls_bseg-BUKRS
    AND BELNR = ls_bseg-BELNR
    AND GJAHR = ls_bseg-GJAHR
    AND BUDAT in p_budat.
    if syst-subrc 0.
    continue.
    endif.
    CLEAR ls_output.
    Process individual fields of BSEG record
    LOOP AT lt_nametab INTO ls_nametab.
    CONCATENATE 'LS_BSEG-' ls_nametab-fieldname INTO l_field.
    ASSIGN (l_field) TO <field>.
    CLEAR l_output.
    Process by field data types
    CASE ls_nametab-exid.
    WHEN 'C' OR 'N' OR 'I'.
    Character, Numeric & Integer
    l_output = <field>.
    WHEN 'D'.
    Dates
    WRITE <field> TO l_date DD/MM/YYYY.
    l_output = l_date.
    WHEN 'P'.
    Packed decimals
    WRITE <field> TO l_output.
    WHEN OTHERS.
    MESSAGE a000(zs) WITH 'Data type error - ' ls_nametab-exid.
    ENDCASE.
    SHIFT l_output LEFT DELETING LEADING space.
    CONCATENATE ls_output l_output
    INTO ls_output SEPARATED BY c_delimiter.
    ENDLOOP.
    IF ls_output+0(4) = c_delimiter.
    SHIFT ls_output LEFT BY 4 PLACES.
    ENDIF.
    l_len = strlen( ls_output ).
    TRANSFER ls_output TO p_file LENGTH l_len.
    ENDLOOP.
    IF sy-subrc = 0.
    ENDIF.
    ENDDO.
    CLOSE CURSOR l_cursor.
    CLOSE DATASET p_file.
    ENDFORM. " get_records
    *& Form get_fields
    FORM get_fields CHANGING pt_nametab TYPE ty_tab_nametab.
    CALL FUNCTION 'RFC_GET_NAMETAB'
    EXPORTING
    tabname = 'BSEG'
    TABLES
    nametab = pt_nametab
    EXCEPTIONS
    table_not_active = 1
    OTHERS = 2.
    IF sy-subrc 0.
    ENDIF.
    ENDFORM. " get_fields
    hope this helps.
    cheers,
    Hema.

  • How to use BKPF and BSEG without using  inner join

    Hi,
    can anybody plz tell me the logic about how to complete the report without inner joining bkpf and bseg.Is this report can be really be made by using only bseg,bkpf ?
    *selection-criteria .
    BKPF-USNAM
    BKPF-CPUDT
    BKPF-BUDAT
    BKPF-GJAHR
    BKPF-BUKRS
    BKPF-BELNR
    BSEG-SAKNR
    BSEG-LIFNR
    BSEG-KUNNR
    BSEG-ZUONR
    BSEG-SGTXT
    Output fields required.
    BKPF-BUKRS
    BKPF-BELNR
    BKPF-GJAHR
    BKPF-MONAT
    BKPF-BLART
    BKPF-CPUDT
    BKPF-BLDAT
    BKPF-BUDAT
    BKPF-USNAM
    BKPF-XBLNR
    BKPF-STBLG
    BKPF-BKTXT
    BKPF-WAERS
    BKPF-KURSF
    BSEG-BUZEI
    BSEG-BSCHL
    BSEG-KOART
    BSEG-UMSKZ
    BSEG-SHKZG
    BSEG-MWSKZ
    BSEG-PSWBT
    BSEG-PSWSL
    BSEG-DMBTR
    BSEG-SAKNR
    BSEG-HKONT
    BSEG-KOSTL
    BSEG-KUNNR
    BSEG-VBELN
    BSEG-LIFNR
    BSEG-ANLN1
    BSEG-ANLN2
    BSEG-AUFNR
    BSEG-MATNR
    BSEG-MENGE
    BSEG-MEINS
    BSEG-ZUONR
    BSEG-SGTXT
    Thanks,
    Rahman
    Moderator Message: Please search before posting your question. Thread locked.
    Edited by: Suhas Saha on Jan 31, 2012 3:07 PM

    Quick question - what's preventing your from using built-in functions?
    I suggest mapping your Time Dim to a standard Time Dim and work with it - you'll save a lot more time. You'd even need this table if you wanted to work around Todate/AGO.
    It is possible to model this functionality w/o functions, but it'll be time consuming task, similar to using Time Series Wizard in Siebel Analytics. You'll need to build aliases and views along with some complex joins (such as TIME.KEY=TIME.KEY-365), introduce a bunch of variables to control. Also, you might not get much flexibility in terms of years. For each year, you'd need an alias table. (TIME_DIM_PY).

  • How to join anla anlc bkpf and bseg in sap

    any can u tel me how to join the anla anlc bkpf and bseg tables in sap.if any body having asset report send me plz

    Moderator message - Welcome to SCN
    But please search for answers here before posting and do not ask the forum to do your work for you.
    Thread locked.
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • Query with tables of BKPF and BSEG and Structures COBL, RF05A

    hi experts,
              I want to create query with the tables of BKPF and BSEG and  Structures COBL, RF05A
    How can i proceed?
    Please give me complete points
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:52 PM

    check the common fields and required fields and the write SELECT query useing Inner Joins or For all entries
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 2:52 PM

  • Regarding link up b/w CHVW and BSEG

    Hi,
    i am making a report in which i have to make link up B/W CHVW AND
    BSEG and how should i do this so dat can be properly displayed.

    hi,
    yeah i know dat it is a cluster table and moreover i am using for all enteries but th thing is when i make link with CHVW there is a problem that the aufnr or vbeln which are present are not dere in bseg ,So what should i do to show in my reprt that the cost of  material had been paid to the vendor or not.
    plzzz help me out as it is really urgnent to me.

  • 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 VTBFHAPO and BSEG

    Hello,
    I have a problem because field BELNR is not filled in table VTBFHAPO. In this way, i can't link VTBFHAPO and BSEG and get the rest of the information.
    Any idea how to link both tables?
    Thanks and Regards,
    Maria

    Hello,
    Through quick viewer in SQ00 - try to add tables VTBFHAPO and BKPF. Link these two tables, remove all other links, except BUKRS and BELNR in both tables.
    BSEG is not allowed here.
    Regards,
    Ravi

  • Performance Issues on BSID and BSAD

    Hello guys,
    for a custom report I need the balance data of a couple of vendors for different keydates. Therefor I tried to use function 'BAPI_AR_ACC_GETKEYDATEBALANCE' which works fine but takes a lot of performance time when getting data for more than one vendor or more than one key date. The function mainly reads BSID and BSAD tables which is enough for my report, so I tried to get it faster with creating my own select.
    When looking at the popular SAP boards you get different opinions about the best way for the performance in SELECTS. So can you please tell me what you think would be the best way for tables BSID and BSAD?
    I got the key fields company code as parameter and customer as range. I also need only normal documents (BSTAT = ' ') and only documents until one or more keydates as range (BUDAT <= keydate).
    So what would be the best way?
    (1) Moving the whole BSID/BSAD fields into local BSID/BSAD table or just the fields that I need (see example)?
    (2) Doing one SELECT for every vendor no. in the range or getting all vendor no in one select?
    Any other performance hints? :-)
       SELECT bukrs kunnr budat shkzg dmbtr pswsl pswbt FROM bsid
         INTO CORRESPONDING FIELDS OF TABLE gt_bsid
         WHERE bukrs EQ pa_bukrs
         AND   kunnr IN gr_kunnr
         AND   budat LE pa_stich-high
         AND   bstat EQ ''.
       SELECT bukrs kunnr augdt budat shkzg dmbtr pswsl pswbt FROM bsad
         INTO CORRESPONDING FIELDS OF TABLE gt_bsad
         WHERE bukrs EQ pa_bukrs
         AND   kunnr IN gr_kunnr
         AND   budat LE pa_stich-high
         AND   augdt GT pa_stich-high
         AND   bstat EQ ''.
    Thanks a lot!
    Regards
    Michael

    Almost always prefer one SELECT to a SELECT IN LOOP.
    Another solution could be reading also some total table :
    KNC1 (no special G/L, Balance Carried Forward + total DB/CR per period, one record per Fiscal Year)
    KNC3 for special G/L (one record per fiscal year and special G/L indicator, only one total per year)
    Only restrict access to BSID/BSAD for dates that are not end of period (or don't allow those...)
    NB: From my experience, you can keep the INTO CORRESPONDING, just define a structure with only required fields, the actual generated SQL statement will only ask for those fields (read also Why "INTO CORRESPONDING" is much better than its reputation)
    Regards,
    Raymond

  • Entry in Both BSID and BSAD

    Hi. I have a problem now. An entry in Accounting both exists in tables BSID and BSAD. What do i have to do?

    Hi Andre,
    Check if the amount are also same. It may be that it is partially posted document.
    Or post this is ERP Financials forum. You will get more correct answer.
    Reward points if useful.
    Regards,
    Atish

  • How to see  fields BSEG-XREF1, BSEG-XREF2 and BSEG-XREF3 in FB60

    Hi,
    We need to  make visible  fields BSEG-XREF1, BSEG-XREF2 and BSEG-XREF3 in transaction FB60 for data entry.
    Please advise .
    Regards,
    Saeed

    Dear Saeed,
    First Make Field Status group this fields mandatory or Optional.
    Then after entering all the data in fb60 screen goto to environment and then press Complex Posting.
    Then double click on the line Expense line item and press more data.
    There you will find this fields for entry.

  • Relation between BKPF-BELNR and Clearing document number

    Hi Friends,
    I need one to one relation between Posted document number BKPF-BELNR and
    the clearing document number generated for that (AUGBL).
    I could find BSEG is having the clearing document number in its one of the line item but i don't want to strain my code querying BSEG.
    is there any other way.
    If querying BSEG is the only option, appreciate if any one help me in giving an optimal query( if you have faced the similar requirement)
    Thanks in advance
    Simha

    Hi All,
    Thanks for your help.
    My problem is resolved. I queried BSAK (for my requirement)as suggested by many of you.
    Thanks.
    Simha
    Edited by: Simha on Nov 15, 2008 5:27 AM

Maybe you are looking for