Join cluster table

Hi
I would like to make a joint with a table cluster (bseg) but the system put an error compilation. what a solution? Thank you for answer. 
Even the creation of a view does not make with the tables cluster.

Hi,
  You cannot write join for cluster tables like BSEG..Instead you can use FOR ALL ENTRIES options..
EX..
DATA: T_BKPF TYPE STANDARD TABLE OF BKPF,
      T_BSEG TYPE STANDARD TABLE OF BSEG.
SELECT * FROM BKPF
       INTO TABLE T_BKPF
       WHERE....
IF NOT T_BKPF IS INITIAL.
  SELECT * FROM BSEG
         INTO TABLE T_BSEG
         FOR ALL ENTRIES IN T_BKPF
         WHERE BUKRS = T_BKPF-BUKRS
         AND   BELNR = T_BKPF-BELNR
         AND   GJAHR = T_BKPF-GJAHR..
ENDIF.
Thanks,
Naren

Similar Messages

  • Re: join cluster table into transperant table in ABAP Queries

    Hi gurus
    How to join cluster tables into transperant tables in ABAP Queries,
    I want to join KNA1, KNB2, BSEG(cluster table)
    pls explain me
    amk

    Hi
    You can use join for KNA1 and KNB1 which will much faster
    then use for all entries of this itab to get the BSEG to improve the performance
    here you need to do some trial and error method by joining  removing the tables and also for all entries
    regards
    Shiva

  • How to join cluster table?

    How to join the cluster table with the transparent table?In specific ,can you pls tell me how can i join bkpf and bseg?

    Hi Aravind,
    Check this code,
    tables : bkpf,
             bseg.
       INTERNAL TABLE AND WORK AREA FOR THE FIELDS IN BKPF TABLE         *
    data : begin of itab_bkpf occurs 0,
           bukrs like bkpf-bukrs,            "Company Code.
           gjahr like bkpf-gjahr,            "Fiscal Year.
           budat like bkpf-budat,            "Posting Date in the Document.
           belnr like bkpf-belnr,            "Accounting document number.
           blart like bkpf-blart,            "Document Type.
           end of itab_bkpf.
    data : wa_bkpf like line of itab_bkpf.
       INTERNAL TABLE AND WORK AREA FOR THE FIEDLS IN BSEG TABLE         *
    data : begin of itab_bseg_debit occurs 0,
           bukrs like bseg-bukrs,            "Company Code.
           gjahr like bseg-gjahr,            "Fiscal Year.
           belnr like bseg-belnr,            "Accounting Document Number.
           buzei like bseg-buzei,            "Line Item.
           hkont like bseg-hkont,            "General Leadger Account.
           shkzg like bseg-shkzg,            "Credit/Debit Indicator.
           wrbtr like bseg-wrbtr,            "Amount in Document Currency.
           pswsl like bseg-pswsl,            "Update Currency for Gen.Ledger
           dmbtr like bseg-dmbtr,            "Amount in local currency.
           sgtxt like bseg-sgtxt,            "Item Text.
           zuonr like bseg-zuonr,            "Assignment Number.
           end of itab_bseg_debit.
    data : itab_bseg_credit like standard table of itab_bseg_debit with
           header line.
                      FINAL OUTPUT INTERNAL TABLE                        *
    data : begin of itab_output occurs 0,
           belnr(08)            ,
           bukrs(04)            ,
           budat like bkpf-budat,
           buzei(03)            ,
           hkont(07)            ,
           blart(02)            ,
           shkzg(01)            ,
           wrbtr(08)            ,
           pswsl(05)            ,
           dmbtr(10)            ,
           sgtxt(19)            ,
           zuonr(10)            ,
    end of itab_output.
    constants : c_debit  type c value 'S',
                c_credit type c value 'H'.
                               SELECT-OPTIONS                            *
    selection-screen begin of block input with frame title text-t01.
    select-options : s_bukrs for bkpf-bukrs.
    parameters     : p_year like bkpf-gjahr visible length 2.
    select-options : s_budat  for bkpf-budat,
                     s_dbacct for bseg-hkont,
                     s_cracct for bseg-hkont,
                     s_amt    for bseg-dmbtr.
    selection-screen end of block input.
         SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION        *
    select bukrs gjahr budat belnr blart
           from  bkpf into table itab_bkpf
           where bukrs in s_bukrs and
                 gjahr eq p_year  and
                 budat in s_budat.
        SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT        *
                      NUMBER SELECTED FROM BKPF                          *
    if not itab_bkpf[] is initial.
      select bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             from bseg into table itab_bseg_debit
             for all entries in itab_bkpf
             where bukrs eq itab_bkpf-bukrs and
                   belnr eq itab_bkpf-belnr and
                   gjahr eq itab_bkpf-gjahr and
                   hkont in s_dbacct        and
                   shkzg eq c_debit         and
                   dmbtr in s_amt.
        SELECTING CREDIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT       *
                      NUMBER SELECTED FROM BKPF                          *
      select bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             from bseg into table itab_bseg_credit
             for all entries in itab_bkpf
             where bukrs eq itab_bkpf-bukrs and
                   belnr eq itab_bkpf-belnr and
                   gjahr eq itab_bkpf-gjahr and
                   hkont in s_cracct        and
                   shkzg eq c_credit        and
                   dmbtr in s_amt.
    endif.
    sort itab_bkpf        by bukrs gjahr belnr.
    sort itab_bseg_credit by bukrs gjahr belnr.
                         LOOPING THE DEBIT ENTRIES                       *
    loop at itab_bseg_debit.
    READING THE CREDIT ENTRIES WHICH MATCHES WITH HE CURRENT DOC. NUMBER *
      read table itab_bseg_credit with key
                 bukrs = itab_bseg_debit-bukrs
                 gjahr = itab_bseg_debit-gjahr
                 belnr = itab_bseg_debit-belnr binary search.
      if sy-subrc eq 0.
    *READING THE POSTING DATE AND DOCUMENT TYPE FOR THE CURRENT DOUCMENT   *
           AND APPENDING THE DEBIT AND CREDIT ENTRIES                    *
        read table itab_bkpf into wa_bkpf with key
                   bukrs = itab_bseg_debit-bukrs
                   gjahr = itab_bseg_debit-gjahr
                   belnr = itab_bseg_debit-belnr binary search.
        itab_output-belnr = itab_bseg_debit-belnr.
        itab_output-bukrs = itab_bseg_debit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_debit-buzei.
        itab_output-hkont = itab_bseg_debit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_debit-shkzg.
        itab_output-wrbtr = itab_bseg_debit-wrbtr.
        itab_output-pswsl = itab_bseg_debit-pswsl.
        itab_output-dmbtr = itab_bseg_debit-dmbtr.
        itab_output-sgtxt = itab_bseg_debit-sgtxt.
        itab_output-zuonr = itab_bseg_debit-zuonr.
        append itab_output.
        itab_output-belnr = itab_bseg_credit-belnr.
        itab_output-bukrs = itab_bseg_credit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_credit-buzei.
        itab_output-hkont = itab_bseg_credit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_credit-shkzg.
        itab_output-wrbtr = itab_bseg_credit-wrbtr.
        itab_output-pswsl = itab_bseg_credit-pswsl.
        itab_output-dmbtr = itab_bseg_credit-dmbtr.
        itab_output-sgtxt = itab_bseg_credit-sgtxt.
        itab_output-zuonr = itab_bseg_credit-zuonr.
        append itab_output.
      endif.
    endloop.
    sort itab_output by belnr budat shkzg.
                     LOOPING OUTPUT INTERNAL TABLE                       *
    *FORMAT INTENSIFIED INPUT.
    *FORMAT INVERSE ON.
    loop at itab_output.
      format hotspot on.
      format color 5 inverse.
      write :/  sy-vline,
               000 itab_output-belnr, 12  sy-vline,
               013 itab_output-bukrs, 17  sy-vline,
               019 itab_output-budat,     sy-vline,
               034 itab_output-buzei, 40  sy-vline,
               042 itab_output-hkont,     sy-vline,
               054 itab_output-blart, 60  sy-vline,
               065 itab_output-shkzg, 70  sy-vline,
               072 itab_output-wrbtr,     sy-vline,
               085 itab_output-pswsl,     sy-vline,
               093 itab_output-dmbtr,     sy-vline,
               106 itab_output-sgtxt,     sy-vline,
                   itab_output-zuonr,     sy-vline.
      format hotspot off.
    endloop.
    uline 0(139).
    <b>Regards,
    Jackie.</b>

  • How do we join cluster table bseg?

    Friends ,
    i just wanna know as 2 how can we combine bseg and bkpf tables.
    since bkpf is a transparent table and bseg is a cluster table.
    regards
    Essam
    [email protected]

    Hi Essam,
        REPORT  ztestport_01.
    TABLES : bkpf,
             bseg.
       INTERNAL TABLE AND WORK AREA FOR THE FIELDS IN BKPF TABLE         *
    DATA : BEGIN OF itab_bkpf OCCURS 0,
           bukrs LIKE bkpf-bukrs,            "Company Code.
           gjahr LIKE bkpf-gjahr,            "Fiscal Year.
           budat LIKE bkpf-budat,            "Posting Date in the Document.
           belnr LIKE bkpf-belnr,            "Accounting document number.
           blart LIKE bkpf-blart,            "Document Type.
           END OF itab_bkpf.
    DATA : wa_bkpf LIKE LINE OF itab_bkpf.
       INTERNAL TABLE AND WORK AREA FOR THE FIEDLS IN BSEG TABLE         *
    DATA : BEGIN OF itab_bseg_debit OCCURS 0,
           bukrs LIKE bseg-bukrs,            "Company Code.
           gjahr LIKE bseg-gjahr,            "Fiscal Year.
           belnr LIKE bseg-belnr,            "Accounting Document Number.
           buzei LIKE bseg-buzei,            "Line Item.
           hkont LIKE bseg-hkont,            "General Leadger Account.
           shkzg LIKE bseg-shkzg,            "Credit/Debit Indicator.
           wrbtr LIKE bseg-wrbtr,            "Amount in Document Currency.
           pswsl LIKE bseg-pswsl,            "Update Currency for Gen.Ledger
           dmbtr LIKE bseg-dmbtr,            "Amount in local currency.
           sgtxt LIKE bseg-sgtxt,            "Item Text.
           zuonr LIKE bseg-zuonr,            "Assignment Number.
           END OF itab_bseg_debit.
    DATA : itab_bseg_credit LIKE STANDARD TABLE OF itab_bseg_debit WITH
           HEADER LINE.
                      FINAL OUTPUT INTERNAL TABLE                        *
    DATA : BEGIN OF itab_output OCCURS 0,
           belnr(08)            ,
           bukrs(04)            ,
           budat LIKE bkpf-budat,
           buzei(03)            ,
           hkont(07)            ,
           blart(02)            ,
           shkzg(01)            ,
           wrbtr(08)            ,
           pswsl(05)            ,
           dmbtr(10)            ,
           sgtxt(19)            ,
           zuonr(10)            ,
    END OF itab_output.
    CONSTANTS : c_debit  TYPE c VALUE 'S',
                c_credit TYPE c VALUE 'H'.
                               SELECT-OPTIONS                            *
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-t01.
    SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs.
    PARAMETERS     : p_year LIKE bkpf-gjahr visible length 2.
    SELECT-OPTIONS : s_budat  FOR bkpf-budat,
                     s_dbacct FOR bseg-hkont,
                     s_cracct FOR bseg-hkont,
                     s_amt    FOR bseg-dmbtr.
    SELECTION-SCREEN END OF BLOCK input.
         SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION        *
    SELECT bukrs gjahr budat belnr blart
           FROM  bkpf INTO TABLE itab_bkpf
           WHERE bukrs IN s_bukrs AND
                 gjahr EQ p_year  AND
                 budat IN s_budat.
        SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT        *
                      NUMBER SELECTED FROM BKPF                          *
    IF NOT itab_bkpf[] IS INITIAL.
      SELECT bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             FROM bseg INTO TABLE itab_bseg_debit
             FOR ALL ENTRIES IN itab_bkpf
             WHERE bukrs EQ itab_bkpf-bukrs AND
                   belnr EQ itab_bkpf-belnr AND
                   gjahr EQ itab_bkpf-gjahr AND
                   hkont IN s_dbacct        AND
                   shkzg EQ c_debit         AND
                   dmbtr IN s_amt.
        SELECTING CREDIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT       *
                      NUMBER SELECTED FROM BKPF                          *
      SELECT bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             FROM bseg INTO TABLE itab_bseg_credit
             FOR ALL ENTRIES IN itab_bkpf
             WHERE bukrs EQ itab_bkpf-bukrs AND
                   belnr EQ itab_bkpf-belnr AND
                   gjahr EQ itab_bkpf-gjahr AND
                   hkont IN s_cracct        AND
                   shkzg EQ c_credit        AND
                   dmbtr IN s_amt.
    ENDIF.
    SORT itab_bkpf        BY bukrs gjahr belnr.
    SORT itab_bseg_credit BY bukrs gjahr belnr.
                         LOOPING THE DEBIT ENTRIES                       *
    LOOP AT itab_bseg_debit.
    READING THE CREDIT ENTRIES WHICH MATCHES WITH HE CURRENT DOC. NUMBER *
      READ TABLE itab_bseg_credit WITH KEY
                 bukrs = itab_bseg_debit-bukrs
                 gjahr = itab_bseg_debit-gjahr
                 belnr = itab_bseg_debit-belnr BINARY SEARCH.
      IF sy-subrc EQ 0.
    *READING THE POSTING DATE AND DOCUMENT TYPE FOR THE CURRENT DOUCMENT   *
           AND APPENDING THE DEBIT AND CREDIT ENTRIES                    *
        READ TABLE itab_bkpf INTO wa_bkpf WITH KEY
                   bukrs = itab_bseg_debit-bukrs
                   gjahr = itab_bseg_debit-gjahr
                   belnr = itab_bseg_debit-belnr BINARY SEARCH.
        itab_output-belnr = itab_bseg_debit-belnr.
        itab_output-bukrs = itab_bseg_debit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_debit-buzei.
        itab_output-hkont = itab_bseg_debit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_debit-shkzg.
        itab_output-wrbtr = itab_bseg_debit-wrbtr.
        itab_output-pswsl = itab_bseg_debit-pswsl.
        itab_output-dmbtr = itab_bseg_debit-dmbtr.
        itab_output-sgtxt = itab_bseg_debit-sgtxt.
        itab_output-zuonr = itab_bseg_debit-zuonr.
        APPEND itab_output.
        itab_output-belnr = itab_bseg_credit-belnr.
        itab_output-bukrs = itab_bseg_credit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_credit-buzei.
        itab_output-hkont = itab_bseg_credit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_credit-shkzg.
        itab_output-wrbtr = itab_bseg_credit-wrbtr.
        itab_output-pswsl = itab_bseg_credit-pswsl.
        itab_output-dmbtr = itab_bseg_credit-dmbtr.
        itab_output-sgtxt = itab_bseg_credit-sgtxt.
        itab_output-zuonr = itab_bseg_credit-zuonr.
        APPEND itab_output.
      ENDIF.
    ENDLOOP.
    SORT itab_output BY belnr budat shkzg.
    then loop your final itab_output
    and give write command to print
    your fields.
    <b>Regards,
    Jackie.</b>
    Message was edited by:
            Jackie

  • Joining of cluster tables

    Hello Mr .kishan ,navneet ,sachin and aakash ,
    I asked a doubt and you guyz are making mountain out a molehill.No one is Mr .Know here in this comm, the community should cater to the needs of all the proficiency levels .
    You should also try to think about the freshers or novices who are starting their careers in SAP ABAP.
    My primary concern was ,why we cant join cluster tables ?? all the MR KNOWS have given answers like ,we cant join ,we cant join .I wanted technical reason for it ,
    Using for all entries is a solution they gave ,that i know .You think i havent searched the forum before asking the query .
    Show me the correct technical valid reason for my query in the previous posted threads ,then i will accept my fault.
    You should answer in a polite manner not bullying or degrading the SDN users that you report me to someone or delete my profile .Very disappointing experience .
    Thank you .

    I did not see you first question, so I can't comment on that. I assume it was quite easy to mix up your question with the many redundant ones that clog up this forum without providing added value. Also, there is no basic right that your requestions be answered, everybody is volunteering here, so you should act a bit more humble as the one seeking for advice.
    To help the good cause:
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f083446011d189700000e8322d00/content.htm
    > You need the structural information stored in the ABAP Dictionary to read the data from a pooled table or cluster table correctly. These tables can therefore only be processed using Open SQL with the cluster interface, and not with Native SQL directly in the database.
    I assume this applies to joins as well which are done at database level, the table structure needs be known and is not in case of cluster tables.
    Thomas

  • Reg: how to join more than one cluster table into one

    Hi gurus
    How to join more than one cluster table into one
    amk

    Hi,
    You cannot join cluster tables
    Best way is to select from the header table and then select from the item table table using for all entries of header table.
    regards,
    Advait

  • Cluster tables in SAP

    Hi all,
    what are the cluster tables in SAP.
    and shall we use inner join statment on cluster tables.
    regards,
    Suresh

    HI,
    <b>CLUSTER Tables :-</b>Table clusters (clusters) are special table types in the ABAP Dictionary
    The data from several tables is stored together in a table pool or table cluster. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables.
    Table pool or table cluster should be used exclusively for storing internal control information (screen sequences, program parameters, temporary data, continuous texts such as documentation). Data of commercial relevance is usually stored in transparent tables.
    Can check this link for more clarity
    http://help.sap.com/saphelp_47x200/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    <b>We can't use inner join on clustor table.
    To Join cluster table with other table its better use
    several select statements.</b>
    This one sample code to join cluster table with other transperant table.
    In this bseg is a cluster table.
    Check it out.
    TABLES : bkpf,
             bseg.
       INTERNAL TABLE AND WORK AREA FOR THE FIELDS IN BKPF TABLE         *
    DATA : BEGIN OF itab_bkpf OCCURS 0,
           bukrs LIKE bkpf-bukrs,            "Company Code.
           gjahr LIKE bkpf-gjahr,            "Fiscal Year.
           budat LIKE bkpf-budat,            "Posting Date in the Document.
           belnr LIKE bkpf-belnr,            "Accounting document number.
           blart LIKE bkpf-blart,            "Document Type.
           END OF itab_bkpf.
    DATA : wa_bkpf LIKE LINE OF itab_bkpf.
       INTERNAL TABLE AND WORK AREA FOR THE FIEDLS IN BSEG TABLE         *
    DATA : BEGIN OF itab_bseg_debit OCCURS 0,
           bukrs LIKE bseg-bukrs,            "Company Code.
           gjahr LIKE bseg-gjahr,            "Fiscal Year.
           belnr LIKE bseg-belnr,            "Accounting Document Number.
           buzei LIKE bseg-buzei,            "Line Item.
           hkont LIKE bseg-hkont,            "General Leadger Account.
           shkzg LIKE bseg-shkzg,            "Credit/Debit Indicator.
           wrbtr LIKE bseg-wrbtr,            "Amount in Document Currency.
           pswsl LIKE bseg-pswsl,            "Update Currency for Gen.Ledger
           dmbtr LIKE bseg-dmbtr,            "Amount in local currency.
           sgtxt LIKE bseg-sgtxt,            "Item Text.
           zuonr LIKE bseg-zuonr,            "Assignment Number.
           END OF itab_bseg_debit.
    DATA : itab_bseg_credit LIKE STANDARD TABLE OF itab_bseg_debit WITH
           HEADER LINE.
                      FINAL OUTPUT INTERNAL TABLE                        *
    DATA : BEGIN OF itab_output OCCURS 0,
           belnr(08),
           bukrs(04),
           budat LIKE bkpf-budat,
           buzei(03),
           hkont(07),
           blart(02),
           shkzg(01),
           wrbtr(08),
           pswsl(05),
           dmbtr(10),
           sgtxt(19),
           zuonr(10),
    END OF itab_output.
    CONSTANTS : c_debit TYPE c VALUE 'S',
                c_credit TYPE c VALUE 'H'.
                               SELECT-OPTIONS                            *
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-t01.
    SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs.
    PARAMETERS     : p_year LIKE bkpf-gjahr.
    SELECT-OPTIONS : s_budat  FOR bkpf-budat,
                     s_dbacct FOR bseg-hkont,
                     s_cracct FOR bseg-hkont,
                     s_amt    FOR bseg-dmbtr.
    SELECTION-SCREEN END OF BLOCK input.
         SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION        *
    SELECT bukrs gjahr budat belnr blart
           FROM bkpf INTO TABLE itab_bkpf
           WHERE bukrs IN s_bukrs AND
                 gjahr EQ p_year  AND
                 budat IN s_budat.
        SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT        *
                      NUMBER SELECTED FROM BKPF                          *
    IF NOT itab_bkpf[] IS INITIAL.
      SELECT bukrs gjahr belnr buzei
             hkont shkzg wrbtr pswsl
             dmbtr sgtxt zuonr
             FROM bseg INTO TABLE itab_bseg_debit
             FOR ALL ENTRIES IN itab_bkpf
             WHERE bukrs EQ itab_bkpf-bukrs AND
                   belnr EQ itab_bkpf-belnr AND
                   gjahr EQ itab_bkpf-gjahr AND
                   hkont IN s_dbacct        AND
                   shkzg EQ c_debit         AND
                   dmbtr IN s_amt.
        SELECTING CREDIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT       *
                      NUMBER SELECTED FROM BKPF                          *
      SELECT  bukrs gjahr belnr buzei
              hkont shkzg wrbtr pswsl
              dmbtr sgtxt zuonr
              FROM bseg INTO TABLE itab_bseg_credit
              FOR ALL ENTRIES IN itab_bkpf
              WHERE bukrs EQ itab_bkpf-bukrs AND
                    belnr EQ itab_bkpf-belnr AND
                    gjahr EQ itab_bkpf-gjahr AND
                    hkont IN s_cracct        AND
                    shkzg EQ c_credit        AND
                    dmbtr IN s_amt.
    ENDIF.
    SORT itab_bkpf        BY bukrs gjahr belnr.
    SORT itab_bseg_credit BY bukrs gjahr belnr.
                         LOOPING THE DEBIT ENTRIES
    LOOP AT itab_bseg_debit.
    READING THE CREDIT ENTRIES WHICH MATCHES WITH HE CURRENT DOC. NUMBER
      READ TABLE itab_bseg_credit WITH KEY
                 bukrs = itab_bseg_debit-bukrs
                 gjahr = itab_bseg_debit-gjahr
                 belnr = itab_bseg_debit-belnr BINARY SEARCH.
      IF sy-subrc EQ 0.
    *READING THE POSTING DATE AND DOCUMENT TYPE FOR THE CURRENT DOUCMENT
           AND APPENDING THE DEBIT AND CREDIT ENTRIES
        READ TABLE itab_bkpf INTO wa_bkpf WITH KEY
                   bukrs = itab_bseg_debit-bukrs
                   gjahr = itab_bseg_debit-gjahr
                   belnr = itab_bseg_debit-belnr BINARY SEARCH.
        itab_output-belnr = itab_bseg_debit-belnr.
        itab_output-bukrs = itab_bseg_debit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_debit-buzei.
        itab_output-hkont = itab_bseg_debit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_debit-shkzg.
        itab_output-wrbtr = itab_bseg_debit-wrbtr.
        itab_output-pswsl = itab_bseg_debit-pswsl.
        itab_output-dmbtr = itab_bseg_debit-dmbtr.
        itab_output-sgtxt = itab_bseg_debit-sgtxt.
        itab_output-zuonr = itab_bseg_debit-zuonr.
        APPEND itab_output.
        itab_output-belnr = itab_bseg_credit-belnr.
        itab_output-bukrs = itab_bseg_credit-bukrs.
        itab_output-budat = wa_bkpf-budat.
        itab_output-buzei = itab_bseg_credit-buzei.
        itab_output-hkont = itab_bseg_credit-hkont.
        itab_output-blart = wa_bkpf-blart.
        itab_output-shkzg = itab_bseg_credit-shkzg.
        itab_output-wrbtr = itab_bseg_credit-wrbtr.
        itab_output-pswsl = itab_bseg_credit-pswsl.
        itab_output-dmbtr = itab_bseg_credit-dmbtr.
        itab_output-sgtxt = itab_bseg_credit-sgtxt.
        itab_output-zuonr = itab_bseg_credit-zuonr.
        APPEND itab_output.
      ENDIF.
    ENDLOOP.
    Reward if it helps you.
    Thanks.

  • Why Inner join or Outer join is not used for Pool or Cluster tables  ?

    Hi SAP-ABAP Experts .
    With Due Regards .
    May u explain me why Inner join or Outer join is not useful for Pool or Cluster tables  ?
    because peoples advised not use Joins for Pool and Cluster tables , What harm will take place , If we do this ?
    Best Regards to all : Rajneesh

    Both Pooled and Cluster Tables are stored as tables within the database. Only the structures of the two table types which represent a single logical view of the data are defined within the ABAP/4 Data Dictionary. The data is actually stored in bulk storage in a different structure. These tables are commonly loaded into memory (i.e., 'buffered') due to the fact they are typically used for storing internal control information and other types of data with little or no external (business) relevance.
    Pooled and cluster tables are usually used only by SAP and not used by customers, probably because of the proprietary format of these tables within the database and because of technical restrictions placed upon their use within ABAP/4 programs. On a pooled or cluster table:
    Secondary indexes cannot be created.
    You cannot use the ABAP/4 constructs select distinct or group by.
    You cannot use native SQL.
    You cannot specify field names after the order by clause. order by primary key is the only permitted variation.
    I hope it helps.
    Best Regards,
    Vibha
    Please mark all the helpful answers

  • How to 'inner join' internal table or cluster table ??

    Hi,
    when i inner join table BSEG it said is a cluster table can't be inner joined .
    i wonder how i can "inner join" bseg with a internal table such as
    data: begin of i_bseg_trans,
            bukrs like bseg-bukrs,
            gjahr like bseg-gjahr,
            belnr like bseg-belnr,
            total_runtimes like i_runtimes-total,
            already_runtimes like i_runtimes-already,
            left_runtimes like i_runtimes-left,
          end of i_bseg_trans.
    and similar things trouble me  when considering several internal tables .
    thanks for any help!!

    Hi,
    but if there's more than 2 tables,  for example
    data: begin of it_bseg occurs 0,
            bukrs like bseg-bukrs,
            else_1 type i,
         end of it_bseg.
    data: begin of t occurs 0,
            bukrs like bseg-bukrs,
          end of t.
    data: begin of r occurs 0,
            bukrs like bseg-bukrs,
            else type c,
          end of r.
    select bukrs from bkdf into table t.
    select bukrs from bkdf into corresponding fields of table it_bseg.
    select bseg~bukrs      "else_1
    from bseg      "it_bseg
      into table r
      for all entries in t
      where bseg~bukrs = t-bukrs.
          " and it_bseg-bukrs = t-bukrs.
    in the select clause i mean whether there's a method similar to the way just drop the " in my code.
    now my solution is to use another loop on it_bseg, but i think when table amount is large this is really a boring solution.

  • I want to join the table vbrk,vbrp,konv but konv is cluster table .

    Hi
       konv is the cluster table . so   I  want to join the table vbrk,vbrp,konv and fields are vbeln, knumv is possible .
    if it isn't possible. what is the another method output is doc. no.(vbrp-vbeln) condition doc. no.(vbrk-knumv) , condition(konv-kschl), tax rate(konv-mwsk1), quantitty(vbrp-fkimg) .reply pls... as soon as possible..

    hi
    good
    1) Open
        Select
               Mard~matnr
               Makt~maktx
          From Makt
          Inner Join Mard
          on    Maktmatnr = Mardmatnr
          Where Makt~Spras = SY-LANGU
    2) Native Oracle
          SELECT Mard.matnr,
                 Makt.maktx
          From Makt, Mard
          Where Makt.mandt = Mard.mandt
            And Makt.matnr = Mard.matnr
            And Makt.mandt = :SY-MANDT
            And Makt.spras = :SY-LANGU
    3) KONV is Cluster - BAD LUCK!
        Select VBRK~VBELN
               VBRP~POSNR
               KONV~KSCHL
               KONV~KWERT    
          From ( VBRK Inner Join VBRP
                 On VBRKVBELN = VBRPVBELN )
               Inner Join KONV
                 On  VBRKKNUMV = KONVKNUMV
                 And VBRPPOSNR = KONVKPOSN
    4) KONV is Cluster - BAD LUCK!
        Select KONV~KNUMV
               KONV~KPOSN
               KONV~KSCHL
               KONV~KWERT    
          From KONV
          Where KONV~KNUMV in (
               Select VBRK~KNUMV
                 From VBRK Inner Join VBRP
                 On VBRKVBELN = VBRPVBELN
                Where VBRKKNUMV = KONVKNUMV
                  And VBRPPOSNR = KONVKPOSN
    5) Open
             Select VBRP~MATNR
                    Sum( VBRP~NETWR )
              From VBRP
              Group By VBRP~MATNR 
    6) Native Oracle        
             Select VBRP.MATNR ,
                    Sum( VBRP.NETWR )
              From VBRP
              Where mandt = :sy-mandt
              Group By VBRP.MATNR         
    7) Native Oracle
             Select VBRP.MATNR ,
                    Count( VBRP.NETWR ),
                    Sum( VBRP.NETWR )
              From VBRP
              Where mandt = :sy-mandt
              Group By VBRP.MATNR    
    8) Open
             Select VBRP~MATNR
                    makt~maktx
                    Sum( VBRP~NETWR )
              From VBRP inner Join MAKT
                On VBRPMATNR = MAKTMATNR
              Where MAKT~SPRAS = SY-LANGU
              Group By VBRPMATNR maktmaktx      
    9) Native Oracle         
             Select VBRP.MANDT,
                    VBRP.MATNR,
                    MAKT.MAKTX,
                    Sum( VBRP.NETWR )
              From VBRP , MAKT
             Where  VBRP.MANDT = MAKT.MANDT
               And  VBRP.MATNR = MAKT.MATNR
               And  MAKT.SPRAS = :SY-LANGU
              Group By VBRP.MANDT, VBRP.MATNR, MAKT.MAKTX   
    10) Open          
         SELECT EKET~EBELN 
                EKET~EINDT 
                EKET~WAMNG 
                EKET~WEMNG 
          From  ( ekko INNER JOIN ekpo
                  ON  ekkomandt = ekpomandt
                  AND ekkoebeln = ekpoebeln
                INNER JOIN eket
                ON  ekpomandt = eketmandt
                AND ekpoebeln = eketebeln
                AND ekpoebelp = eketebelp
                AND EKET~WAMNG > 0
                AND EKETWAMNG <> EKETWEMNG
         Where EKPO~MATNR = 'NB220'
           And EKPO~WERKS  In ('P001', 'P004', 'L004')
           And EKKO~BSTYP = 'F'
           And EKKO~BSART = 'UB'
           And EKPO~ELIKZ <> 'X'
           And EKKO~LOEKZ <> 'X'     
    11) Native Oracle      
         SELECT EKET.EBELN, 
                EKET.EINDT, 
                EKET.WAMNG, 
                EKET.WEMNG 
          FROM  ( ekko INNER JOIN ekpo
                  ON  ekko.mandt = ekpo.mandt
                  AND ekko.ebeln = ekpo.ebeln
                INNER JOIN eket
                ON  ekpo.mandt = eket.mandt
                AND ekpo.ebeln = eket.ebeln
                AND ekpo.ebelp = eket.ebelp
                AND EKET.WAMNG > 0
                AND EKET.WAMNG <> EKET.WEMNG
         Where EKPO.MATNR = 'NB220'
           And EKPO.WERKS  In ('P001', 'P004', 'L004')
           And EKKO.BSTYP = 'F'
           And EKKO.BSART = 'UB'
           And EKPO.ELIKZ <> 'X'
           And EKKO.LOEKZ <> 'X'
    thanks
    mrutyun^

  • Regarding performance on cluster tables.vvv.urgent!

    friends,
      i know that cluster tables cannot be joined with transparent tables....
       however i need performance improvement for the following code....
       if possible is there a way to join bkpf or bseg to improve performance....can we create view foe bkpf and bseg if yes then how.....
      please modify the below code for improvement in performance.
      START-OF-SELECTION.
      SELECT bukrs belnr gjahr budat FROM bkpf INTO TABLE i_bkpf
      WHERE bukrs = p_bukrs AND "COMPANY CODE
              gjahr = p_gjahr AND "FISCAL YEAR
              budat IN s_budat. "POSTING DATE IN DOC
      IF sy-subrc = 0.
      SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
            i_bseg FOR ALL ENTRIES IN  i_bkpf
            WHERE bukrs = i_bkpf-bukrs AND "COMPANY CODE
                  belnr = i_bkpf-belnr AND "A/CING DOC NO
                  gjahr = i_bkpf-gjahr AND "FISCAL YEAR
                  hkont = p_hkont. "General Ledger Account"
        IF sy-subrc = 0.
         SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
                i_bseg1 FOR ALL ENTRIES IN  i_bseg
                WHERE bukrs = i_bseg-bukrs AND  "COMPANY CODE
                      belnr = i_bseg-belnr AND  "A/CING DOC NO
                      gjahr = i_bseg-gjahr.   "FISCAL YEAR
        ENDIF.
      ENDIF.
      IF NOT i_bseg1[] IS INITIAL.
        LOOP AT i_bseg1.
          IF i_bseg1-hkont = p_hkont AND i_bseg1-shkzg = 'S'.
            v_sumgl = v_sumgl + i_bseg1-dmbtr.
          ELSEIF i_bseg1-hkont = p_hkont AND i_bseg1-shkzg = 'H'.
            v_sumgl = v_sumgl - i_bseg1-dmbtr.
          ELSEIF i_bseg1-hkont NE p_hkont .
            IF i_bseg1-shkzg = 'H'.
              i_bseg1-dmbtr = - i_bseg1-dmbtr.
            ENDIF.
            i_alv-hkont = i_bseg1-hkont.
            i_alv-dmbtr = i_bseg1-dmbtr.
            APPEND i_alv.
            v_sumoffset = v_sumoffset + i_bseg1-dmbtr.
          ENDIF.
        ENDLOOP.
    regards
    Essam.([email protected])

    Hi there ...
    I have read the note - thats where I found the link to the trace note 286496.1 - on now to setup a trace
    But I still need an explanation for the methods (1,2,4 etc)
    regards
    Mette

  • Doubt in Cluster table

    Hi Experts,
    Can You plz tell How to import/read data from cluster table? Plz give me the syntaxes also..
    Thanx in advance.

    use  read statement i don't think in cluster table there is any restruction for read  and select u can  use  open sql but  not  join in cluster table .
    Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. <b>You can access cluster tables only via Open SQL, and only without using joins.</b>

  • Pool table & Cluster table

    Dear all,
    could you please help me out from the below.
    How to create pooled tables & cluster tables.
    When i am trying to create a table, by default it is showing table category as Transparent table.
    Regards
    Venkat

    hi,
    A pool table has many to one relation with the table in the database. For one table in the database there are many tables in the dictionary. Tha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. A pooled table is stored in the pool at the database level. A table pool is a databse table with a special struct that enables the data of many R3 tables to be stored in it. It can hold only pooled tables
    Cluster table are logical tables that must be assigned to a table cluster when they are defined.
    Cluster table can be used to store control data they can also used to store temporary data or text such as documentation
    Pool table
    A database table defined in the ABAP Dictionary whose database instance is assigned to more than one table defined in the ABAP Dictionary. Multiple pool tables are assigned to a table pool in the database. The key fields of a pool table have to be character-type fields. The table pool's primary key consists of two fields: TABNAME for the name of a pool table, and VARKEY for the interdependent contents of the key fields in the corresponding pool table. The non-key fields of the pool table are stored in compressed format in their own column, called VARDATA, of the table pool. The only way to access pool tables is by using Open SQL. Joins are not allowed.
    Table Pool
    Database table in the database that contains the data of several pool tables.
    Cluster Table
    Database table defined in the ABAP Dictionary, whose version on the database is not only assigned to one table defined in the ABAP Dictionary. Several cluster tables are assigned to a table cluster in the database. The intersection of the key fields of the cluster tables forms the primary key of the table cluster. The other columns of the cluster tables are stored in compressed form in a single column VARDATA of the table cluster. You can access cluster tables only via Open SQL, and only without using joins.
    Table Cluster
    Database table in the database that contains the data of several cluster tables.
    Note: Never mix up with a database table that has the necessary structure for storing data clusters in database tables and in the shared memory. Those are called INDX-type, with reference to the database table INDX supplied by SAP. Data clusters are groupings of data objects for transient and persistent storage in a selectable storage medium. A data cluster can be processed using the statements IMPORT, EXPORT, and DELETE FROM
    Some pooled tables:
    T000 Clients
    T000C Table for Installing FI-SL Customizing
    T000CM Client-specific FI-AR-CR settings
    T000F Cross-Client FI Settings
    T000G Cross-Client FI-SL Postings
    T000GL Flexible general ledger: Customizing check
    T000K Group
    T000MD MRP at MRP Area Level
    T001 Company Codes
    T001_ARCH Archive contents short description
    T001_CONV Company codes affected by currency convers
    T001A Additional Local Currencies Control for Co
    T001B Permitted Posting Periods
    T001C Valid Posting Periods for Global Companies
    T001CM Permitted Credit Control Areas per Company
    T001D Validation of Accounting Documents
    T001E Company Code-Dependent Address Data
    T001F Company code-dependent form selection
    T001G Company Code-Dependent Standard Texts
    T001I Company Code - Parameter Types
    T001J Company Code - Parameter Type Names
    T001K Valuation area
    T001L Storage Locations
    T001M Data on Z5A Foreign Trade Regulations Repo
    T001N Company Code - EC Tax Numbers / Notificati
    A physical table definition is created in the database for the table definition stored
    in the ABAP Dictionary for transparent tables when the table is activated.
    The table definition is translated from the ABAP Dictionary to a definition of the particular database.
    On the other hand, <b>pooled tables and cluster tables are not created in the database.</b>The data of these tables is stored in the corresponding table pool or table cluster.
    It is not necessary to create indexes and technical settings for pooled and cluster tables.
    regards,
    pritha

  • Retrieve data from cluster tables

    hi
    can any one explain me how to retrieve data from cluster tables
    Regards
    sachin

    you can write a select
    select * from KONV
           into table it_konv
    where <condition>
    you cant join.. cluster tables..

  • SQVI - join with table T030

    Hello!
    I am trying to create a query for material accounts with the Quick Viewer (transaction SQVI).
    I´ve already added tables MARA, MBEW and T001K, but when i try to add table T030 an error message comes up:
    "Table T030 cannot be used in a join" (Message #AQ 501)
    Does Anyone know why the Quick Viewer doesn't let me add this table to the join of tables?
    Thank you everybody in advance!
    cecil

    Dear Maria,
    Not every table can be join using SQVI, eg:T030,A017,etc.
    You can read the notes for this :
    1. You cannot read the selected table with SELECT statements (because,
    for example, it is a structure without a database table). Therefore,  
    this table cannot be read within a table join either.                                                                               
    2. The chosen table is a pool or cluster table. These tables may not be
    used in a table join.             
    Regards,

Maybe you are looking for

  • How to create multi-paging for my output html pages?

    my query produces an output that can't be displayed in one single page; Is there a way to store my data and display what I need? (As you can understand, I'm new to java...so don't be too bad...) thank you all.

  • Credit/debit memo request

    hi, 1) credit memo request - After create invoice in vf01, then if credit memo needed, must create credit memo request in va01 then only can create credit memo in fb75? 2) debit memo request - After create invoice in vf01, then if debit memo needed,

  • RMAN-05556: not all datafiles have backups that can be recovered to SCN

    Oracle 11.2.0.2 SE-One Oracle Linux 5.6 x86-64 Weekly refresh of a test db from prod, using rman DUPLICATE DATABASE, failed with “RMAN-05556: not all datafiles have backups that can be recovered to SCN” Background Summary: Weekly inc 0 backup of prod

  • Xfinity online not going to full screen

    Hey idk if xfinity people look at this at all, but with my google chrome browser it won't allow me to hit the button to go to fulls screen. It has set dimensions for the video and cuts off all the options that typically run across the bottom of the s

  • Delete data from tables in one step

    HI , There is a way to delete in one step data from 3 tables with specific key  something like similar to join but with delete operation . Thanks joy