URGENT:HOW TO COMBINE CLUSTER AND TRANSPARENT TABLE..WITHOUT USING FOR ALL

how can we join bkpf and bseg without using FOR ALL ENTRIES.HOW DO I COMBINE THE 2 TABLES SO THAT I GET BETTER 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 Friend,
  I see your code.. there is no other way than using for all entries for your situation.. how ever i saw ur code and a small recommandation in the change of code.
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.
if not p_hkont is initial.
SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
i_bseg1 FOR ALL ENTRIES IN i_bkpf
WHERE bukrs = i_bseg-bukrs AND "COMPANY CODE
belnr = i_bseg-belnr AND "A/CING DOC NO
gjahr = i_bseg-gjahr. "FISCAL YEAR
ENDIF.
i_bseg[] = i_bseg[]1.
delete i_bseg where hkont ne p_hkont.
else.
  Your existing logic...
endif.
In this way you can avoide writing two selects on bseg..
Thanks
Mahesh

Similar Messages

  • Cluster and transparent table

    Hi
    Can some one explain me what is meant by cluster and transparent table
    Points will be rewarded.
    Regards
    Raghu Ram.

    hi Raghu,
    just make a search about this in the ABAP Forum, there are tons of threads about the topic, here is just the most recent example:
    transparent vs pooled vs cluster tables
    hope this helps
    ec

  • Can anyone give ex's for poolled and cluster and transparent tables

    Hi ,
    Can u help me by providing ex's for  poolled and cluster and transparent tables

    Hi,
    Following are the examples for each type.
    Transparent table -  VBAK.
    Cluster Table -BSEG
    Pooled Table -  KAPOL
    Regards,
    Ankur Parab

  • How do i check and see what is using up all my harddrive space

    How do i check to see what is using all of my hard drive space?

    I would try OmniDiskSweeper.
    Matt

  • Join table SUM using for all entries

    Dear All,
                Will anyone pls. tell me what is the problem in this query, it is not working.
        SELECT aufnr SUM( menge )
         INTO CORRESPONDING FIELDS OF TABLE itab_aufnr
         FROM mkpf
         INNER JOIN mseg ON msegmblnr EQ mkpfmblnr AND mkpfmjahr EQ msegmjahr
         FOR ALL ENTRIES IN itab_rework
          WHERE mseg~aufnr = itab_rework-aufnr
          GROUP BY aufnr.
    Regards,
    Moderator message: please search for available information before asking, "it's not working" is not a proper error description.
    Edited by: Thomas Zloch on Dec 6, 2010 9:41 AM

    When I have used it in loop it is taking so much time to execute.
    That depends upon the amount of data you are processing and the set of codes written inside the loop. For sum you have to use collect statement or a SUM statement inside a control break statement.

  • Internal table oerations using for all entries

    Hi folks
    I want to display an output of
    SO number, SO Date( from VBAK) ,
    SO Item, SO item category (from VBAP) ,
    MAterial no., MAt type (from MARA)
    Using 3 internal tables for each table fields and applying FOR ALL ENTRIES and populating a final output table say I_output.
    Can u please give me a SAMPLE CODE on this.
    I wont forget to reward points
    Regards,RAM

    hi
    pls see the following code...
    DATA: BEGIN OF it_vbak OCCURS 0,
          vbeln TYPE vbeln,
          erdat TYPE sy-datum,
          END OF it_vbak,
          BEGIN OF it_vbap OCCURS 0,
          vbeln TYPE vbeln,
          posnr TYPE posnr,
          matnr TYPE matnr,
          pstyv TYPE pstyv,
          END OF it_vbap,
          BEGIN OF it_mara OCCURS 0,
          matnr TYPE matnr,
          mtart TYPE mtart,
          END OF it_mara,
          BEGIN OF it_final OCCURS 0,
          vbeln TYPE vbeln,
          erdat TYPE sy-datum,
          posnr TYPE posnr,
          matnr TYPE matnr,
          pstyv TYPE pstyv,
          mtart TYPE mtart,
          END OF it_final.
    SELECT vbeln erdat INTO TABLE it_vbak FROM vbak.
    IF NOT it_vbak[] IS INITIAL.
      SELECT vbeln posnr matnr pstyv INTO TABLE it_vbap FROM vbap
      FOR ALL ENTRIES IN it_vbak WHERE vbeln = it_vbak-vbeln.
      IF NOT it_vbap[] IS INITIAL.
        SELECT matnr mtart INTO TABLE it_mara FROM mara
        FOR ALL ENTRIES IN it_vbap WHERE matnr = it_vbap-matnr.
      ENDIF.
    ENDIF.
    LOOP AT it_vbak.
      MOVE-CORRESPONDING it_vbak TO it_final.
      LOOP AT it_vbap WHERE vbeln = it_vbak-vbeln.
        READ TABLE it_mara WITH KEY matnr = it_vbap-matnr.
        MOVE-CORRESPONDING it_vbap TO it_final.
        MOVE-CORRESPONDING it_mara TO it_final.
        APPEND it_final.
      ENDLOOP.
    ENDLOOP.
    thx
    pavan
    **pls reward for helpful answers

  • How to Insert data in 3 table without use of join 1table mapped rule define

    1.Table SOL_K
    A B C D – Columns Name
    C D A B –Coulmns Values Defined (Rule --- Defined)
    2.SECOND table SIC_K
    SIC_ K
    A B C D
    Kamal Micky NULL MANOJ
    3 Table SIC_Mapping
    Same Columns A B C D based On Table SOL_K defined rule
    I want to insert values(from table SIC K) into table SICMapping Table with the help of first table(SOL_K)(mapped rule)
    Required Result SIC_Mapping Table
    The output will be come like this.
    A B C D — Columns Name
    NULL MANOJ Kamal Micky ---- Came based on defined Mapping Rule

    This is the forum for issues with the SQL Developer tool. You will get better answers in the SQL and PL/SQL forum.

  • Joining of cluster  and pooled tables ,transparent tables

    Hi,
    I wanted to do join between  cluster  ,pooled and transparent tables  but inner join won't allow  to join between  transparent or cluster tables or pooled tables .  The requirements are that join should take place dynamically  between transparent ,cluster ,pooled tables .I have written the Function module for joining multiple tables for transparent tables but unable to implement same for the transparent and cluster or pooled tables.How to handle the joining of tables between pooled or cluster  and transparent tables kindly provide me the answer .
    Thanks,
    jahnavi.

    Hi Jahnavi,
    My suggestion would be... if you want to retrieve the data between cluster tables and transparent tables.. its better to go for views instead of cluster tables then that would be easier for you to retrieve the data
    let us take one example BSEG its a cluster table where as there is one view VBSEGK it contains almost all the important fields needed so that u can make use of those or you can look into BSIK and BSAK tables so it better to avoid the cluster tables while retriving the data from the performance point of view

  • Cluster and pooled tables

    when we will use cluster table , pooled table and transparent tables...

    FOr Tables
    http://www.erpgenie.com/abap/tables.htm
    For Tables
    <b>Pooled Tables, Table Pools, Cluster Tables, and Table Clusters</b>
    These types of tables are not transparent in the sense that they are not legible or manageable directly using the underlying database system tools. They are managed from within the R/3 environment from the ABAP dictionary and also at runtime when they are loaded into application memory.Pool and cluster tables are logical tables. Physically, these logical tables are arranged as records of transparent tables. The pool and cluster tables are grouped together in other tables, which are of the transparent type. The tables that group together pool tables are known as table pools, or just pools; similarly, table clusters, or just
    clusters, are the tables which group cluster tables.Not all operations that can be performed over transparent tables can be executed over pool or cluster tables.
    For instance, you can manage these tables using Open SQL calls from ABAP, but not Native SQL.These tables are meant to be buffered and loaded in memory, because they are commonly used for storing internal control information and other types of data with no external (business) relevance. SAP recommends that tables of pool or cluster type be used exclusively for control information such as
    program parameters, documentation, and so on. Transaction and application data should be stored in transparent tables.
    <b>Table Pools</b>
    From the point of view of the underlying DBMS as from the point of view of the ABAP dictionary, a table pool is a transparent table containing a group of pooled tables which, when created, were  assigned to this table pool.
    Field              Type                Description
    TABNAME CHAR(10)   Table                 name
    VARKEY CHAR(n)    Maximum key length n =< 110
    DATALN INT2(5) Length of the VARDATA record returned
    VARDATA RAW(m) Maximum length of the data varies according to DBMS
    <b>Table Clusters</b>
    Similarly to pooled tables, cluster tables are logical tables which, when created, are assigned to a table cluster. Therefore, a table cluster, or just cluster, groups together several tables of type clusters.Several logical rows from different cluster tables are brought together in a single physical record. The records
    from the cluster tables assigned to a cluster are thus stored in a single common table in the database.A cluster contains a transparent cluster key which must be located at the start of the key of all logical cluster tables to be included in the cluster. As well, a cluster contains a long field (VARDATA), which contains the
    data of the cluster tables for this key. If the data does not fit into a field, continuation records are created.
    Field Type Description
    CLKEY1 CHAR(*) First key fields
    CLKEY2 CHAR(*) Second key field
    CLKEYN CHAR(*) nth key field
    PAGENO INT2(5) Number of the next page
    TIMESTMP CHAR(14) Time stamp
    PAGELG INT2(5) Length of the VARDATA record returned
    VARDATA RAW(*) Maximum length of the data section; varies according to database system
    <b>Working with Tables</b>
    The dictionary includes many functions for working with tables. There are five basic operations you can perform on tables: display, create, delete, modify, copy. Please do not confuse displaying a  table with displaying the table entries (table contents). In order to display a table, it must previously exist; otherwise the system will display an  error message in the status bar. For the following example, the table TABNA is used. To display this table, from the main dictionary screen, enter the table name in the Object name
    input field with the radio button selected next to Tables. Then, click on the Display button at the bottom of the screen, or press the F7 function key,  or, alternatively,
    select Dictionary object Display from the menu.
    In this screen, you can see table information such as
    ¨ Table type, shown next to the name of the object. In the example, it is a transparent table.
    ¨ Short text description.
    ¨ Name of the user who made the last change, and the date of the change.
    ¨ Master language.
    ¨ Table status. On the screen, you can see this table is saved and active.
    ¨ Development class. For information on development classes, refer to Chap. 6.
    Delivery class, which sets the maintenance group for the table. It controls how tables will behave during client copy procedures, upgrades, and so forth.¨
    Tab. Maint. Allowed flag, which indicates whether you can generate a screen for maintaining table entries.
    ¨Then, on the lower part of the screen, you can see the table fields with all associated characteristics such as:
    ¨ Field name.
    ¨ Key indicator. When set, this field is the primary key, or part of it.
    ¨ Data element.
    ¨ Basic data type.
    ¨ Length.
    ¨ Check table.
    ¨ Short text, describing the field.
    Additional information about the table can be displayed by selecting the corresponding functions from the menu or directly from the application toolbar, such as keys, indexes, or technical settings.
    Regards,
    Balaji
    **Rewards for helpful answers

  • Cluster and a Table

    What is the difference between a Cluster and a Table?

    Hi jack,
    Have a look at below  threads
    Difference between cluster and transparent table.....
    DIFFERENCE BETWEEN TRANSPARENT AND CLUSTER TABLES
    Reward points if useful.
    Regards,
    Manoj.

  • Reg : Cluster and pool tables

    Hi All,
    I think this has been asked previously.
    Have a doubt, i think this area is kind of opaque.
    This is the scenario, we have standard business suite systems now i am going to get the data into hana using SLT how do i handle cluster and pool tables. Do i bring in the declustered data?
    I am aware that we can get the data from these tables into BW on hana, not sure if that is correct.
    What are the best practice approach for these table classes.
    How have you implemented these kind of scenarios.
    Message was edited by: Tom Flanagan

    Hello,
    SLT Supports replication of non-Unicode to Unicode systems.
    Includes cluster / pool tables, etc. (writes into transparent tables in SAP HANA system).
    Regards,
    Subbu

  • How to access RT and CRT tables

    Hi experts can any one guide me how to view RT and CRT Tables.
    How to access RT and CRT tables.
    Is there any Tcode existing to access these.
    Thanks in advance
    Regards
    vamsi.

    Hi Vamsi,
    1) You can use the function module : CU_READ_RGDIR
    In this function module you can pass PERNR and you can get SEQNR(Sequence No) or you can take the sequence no from any transparent table also.
    2)After getting the sequence NO Pass the employee NO and Sequence NO in the function module : PYXX_READ_PAYROLL_RESULT.
    From this function module you can get the RT,BTand CRT Table results.
    Thanks and Regards
    Partha

  • Doubt on cluster and pooled tables

    Dear experts
    i kno how to create a cluster and pooled table ..
    but in reality how a requirement comes to create a cluster or pooled table....
    plz kindly explain in detailed  
    thanks in advace
    somesh

    Hello,
    Hope the below link gives you an insight into how the pooled/cluster tables behave.
    http://help.sap.com/saphelp_46c/helpdata/EN/81/415d363640933fe10000009b38f839/frameset.htm
    For better understanding on how and when to create pooled/cluster table, refer to the below examples.
    All Condition tables i.e., Annn tables (pricing/discounts etc.,) belong to the table Pool KAPOL (Condition Pool) as the underlying concept is same across different condition tables, but, they have different Key (primary) fields.
    Accounting Document Segment (Line Item records) BSEG is a cluster table that belongs to the table cluster RFBLG. Also, other tables such as BSEC, BSED, BSES, BSET also come under the same table cluster as all of them possess the common Key i.e., BUKRS/BELNR/GJAHR.
    Please contact for further details. <removed_by_moderator>
    With Regards
    Vijay Gajavalli
    Edited by: Julius Bussche on Sep 4, 2008 8:40 AM

  • Reg cluster and pooled tables

    hi experts..
    can u pls give the names of some cluster and pooled tables?
    regards
    Sellavel

    Hello,
    Pooled tables can be used to store control data (e.g. screen sequences, program parameters or temporary data). Several pooled tables can be combined to form a table pool. The table pool corresponds to a physical table on the database in which all the records of the allocated pooled tables are stored.
    A001
    A004
    A005
    A006
    A007
    A009
    A010
    A012
    A015
    A016
    A017
    A018
    A019
    A021
    A022
    Cluster tables contain continuous text, for example, documentation. Several cluster tables can be combined to form a table cluster. Several logical lines of different tables are combined to form a physical record in this table type. This permits object-by-object storage or object-by-object access. In order to combine tables in clusters, at least parts of the keys must agree. Several cluster tables are stored in one corresponding table on the database.
    AUAA
    AUAB
    AUAO
    AUAS
    AUAT
    AUAV
    AUAW
    AUAY
    BSEC
    BSED
    BSEG
    BSES
    BSET
    CDPOS
    Vasanth

  • Need of Cluster and Pool Table in SAP

    Can anybody explain an importance of Cluster and Pool Table concept in SAP.

    Hi Hema,
    Given link was Helping but still I have few things as part of concept of Cluster and Pool Tables.
    (1) As cluster and Pool, both are logical table in SAP, it doesn't have physical existence in Database. Means, a single database  table (Actual physical in database server ) may contain more than one pool and cluster tables' data. Likewise it decrease no of Tables at database server whereas the amount of data may remain same. So, my question is how does it benefit in respect of Memory space at database server or any other means.?
    (2). As per one of the difference between Cluster and Pool table - Tables pools doesn't need to have foreign key relationship whereas in case of cluster table it it must to have foreign key relationship. Why is it so..?
      Hope I have brought more clarity to my doubt.
    Regards,
    Chetan.

Maybe you are looking for

  • Magic Bullet Looks Error in After Effects CC 2014 (Latest)

    My PC specs: Windows 7 Home Premium Processor: Intel(R) Core(TM) i3-2350M CPU @ 2.30Hz  2.30Hz RAM: 4.00GB System Type: 64-Bit This is for Adobe(R) After Effects(R) CC - 2014.1.1 Release (Version 13.1.1.13 I didn't get this issue when i was using Ado

  • B1DE / CFL / Event Handling  ..

    Had problems with CFL's in an application i'm developing so i've created a real simple demo of my problem in the hope someone can help me .. In the sample i have a simple screen designed with the painter with a static text field, an edit box and a bu

  • Profit Centre posting via MR21

    I'm posting a material price change via transaction MR21.  I've changed the GL account to a P&L account and so aswell as an FI posting I'd also like a PA posting, a profit centre posting and a CO posting.  These are all happeningok except for the fac

  • Hey iFelix!

    iFelix, your little help pages for XP users and airport access are great. However, I'm still having difficulty getting my wifes laptop (DELL POS) to retrieve an IP address, it appears many others do as well. . . I have tried everything on your help p

  • What does the class CL_EXITHANDLER do ? What the significance of this class

    what does the class CL_EXITHANDLER do ? What the significance of this class,