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

Similar Messages

  • Regarding Uploading of internal Table - Its Urgent.

    Hi All,
                 I want to upload the data from an Excel File into Interna Table.
                 GUI_UPLOAD is used for Flat File but for Excel Which FM should I use?
                 Can Any One give me the sample code for this ?
                 Points will be rewarded.   
                 Thanks in Advance.
    Regards
    Jitendra Gujarathi

    hi
    REPORT zupload_excel_to_it NO STANDARD PAGE HEADING.
    TYPES:   BEGIN OF t_datatab ,
             col1(25)  TYPE c,
             col2(30)  TYPE c,
             col3(30)  TYPE c,
             col4(30)  TYPE c,
             col5(30)  TYPE c,
             col6(30)  TYPE c,
             col7(30) TYPE c,
             col8(30)  TYPE c,
             col9(30)  TYPE c,
             col10(30)  TYPE c,
             col11(30)    TYPE c,
           END OF t_datatab.
    DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
          wa_datatab TYPE t_datatab.
    DATA : gd_scol   TYPE i VALUE '1',
           gd_srow   TYPE i VALUE '1',
           gd_ecol   TYPE i VALUE '256',
           gd_erow   TYPE i VALUE '65536'.
    DATA: it_tab TYPE filetable,
          gd_subrc TYPE i.
    *Selection screen definition
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_file LIKE rlgrap-filename
                   DEFAULT 'c:\test.xls' OBLIGATORY.   " File Name
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      REFRESH: it_tab.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title     = 'Select File'
          default_filename = '*.xls'
          multiselection   = ' '
        CHANGING
          file_table       = it_tab
          rc               = gd_subrc.
      LOOP AT it_tab INTO p_file.
       so_fpath-sign = 'I'.
       so_fpath-option = 'EQ'.
       append so_fpath.
      ENDLOOP.
    START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM upload_excel_file TABLES   it_datatab
                                 USING   p_file
                                         gd_scol
                                         gd_srow
                                         gd_ecol
                                         gd_erow.
    END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3,
                wa_datatab-col4,
                wa_datatab-col5,
                wa_datatab-col6,
                wa_datatab-col7,
                wa_datatab-col8,
                wa_datatab-col9,
                wa_datatab-col10,
                wa_datatab-col11.
      ENDLOOP.
    *&      Form  UPLOAD_EXCEL_FILE
          upload excel spreadsheet into internal table
         -->P_TABLE    Table to return excel data into
         -->P_FILE     file name and path
         -->P_SCOL     start column
         -->P_SROW     start row
         -->P_ECOL     end column
         -->P_EROW     end row
    FORM upload_excel_file TABLES   p_table
                           USING    p_file
                                    p_scol
                                    p_srow
                                    p_ecol
                                    p_erow.
      DATA : lt_intern TYPE  kcde_cells OCCURS 0 WITH HEADER LINE.
    Has the following format:
                Row number   | Colum Number   |   Value
         i.e.     1                 1             Name1
                  2                 1             Joe
      DATA : ld_index TYPE i.
      FIELD-SYMBOLS : .
    Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
        EXPORTING
          filename                = p_file
          i_begin_col             = p_scol
          i_begin_row             = p_srow
          i_end_col               = p_ecol
          i_end_row               = p_erow
        TABLES
          intern                  = lt_intern
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'Error Uploading file'.
        EXIT.
      ENDIF.
      IF lt_intern[] IS INITIAL.
        FORMAT COLOR COL_BACKGROUND INTENSIFIED.
        WRITE:/ 'No Data Uploaded'.
        EXIT.
      ELSE.
        SORT lt_intern BY row col.
        LOOP AT lt_intern.
          MOVE lt_intern-col TO ld_index.
          ASSIGN COMPONENT ld_index OF STRUCTURE p_table TO <fs>.
          MOVE lt_intern-value TO .
          AT END OF row.
            APPEND p_table.
            CLEAR p_table.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "UPLOAD_EXCEL_FILE
    plz reward points!
    rgds

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

  • About Cluster tables

    Hi SAP gurus,
    Can I get any documentation regarding how these cluster tables are filled when payroll is executed
    means how RT WBBP all these will get filled
    Thanks in advance
    Regards,
    Satya

    Hi Pavan,
    Work Center/Basic Pay Table (WPBP):
    Table WPBP is filled by the infotypes Actions (0000), Organizational Assignment (0001), Planned Working Time (0007), Basic Pay (0008), and Cost Distribution (0027). It contains important organizational and payment-relevant data, and different partial period parameters.
    These organizational elements are used in the wage and salary payments process (dependent on Customizing) to determine the house bank and the house bank account.
    Furthermore, the system uses the Work Center/Basic Pay table (WPBP) to determine the paying company code. Specification of the paying company code is optional in Customizing. If you have not specified a paying company code in Customizing, the system uses the company code that is stored in the Work Center/Basic Pay table (WPBP) in the employee's payroll results. If the Work Center/Basic Pay (WPBP) table for the employee contains several partial periods as the result of a WPBP Split, in the payroll period to be processed, the system uses the company code in the last partial period, in which the employee was active, to determine the paying company code.The information used to form the partial period parameter comes from the personal work schedule for an employee and from the constant values stored in table T511K.
    RT Table:
    Table RT contains the result wage types of the current period for which payroll is run. Data is transferred from table IT to table RT using the operation ADDWTE.
    This operation is speicifed in the Personnel calculation Rules of the country specific Payroll schema.
    Regards,
    Suresh Datti

  • Performance Tuning for A016 (cluster table) Query

    Dear SDNers,
    Issue:
    The report runs  successfully sometimes and sometimes the report gets timed out.
    My findings
    Query which is taking a  long time to execute is the query on A016(cluster Table) to fetch the condition details
    SELECT kschl
             evrtn
             evrtp
             knumh
             FROM a016 INTO TABLE t_a016
             FOR ALL ENTRIES IN t_ekpo
             WHERE
             kappl EQ c_m (Application)
             AND kschl IN s_kschl
             AND evrtn = t_ekpo-ebeln
             AND evrtp = t_ekpo-ebelp.
    where t_ekpo contains entries (4354)from ekko and ekpo based on the selection screen entries.
    I see that a016 is a cluster table that is being used here and t_a016 contains (390*) records after the above fetch.
    Dear readers,Please help me as to what has to be taken care of inorder to fine tune this select query?
    what are the things that i need to make corrections in.
    How can i make this fetch effective and faster?
    Please help me with your inputs.
    Regards,
    SuryaD.
    Edited by: SuryaD on Oct 26, 2009 6:29 PM

    Hi,
    1) Try to hit the table A016 with only unique entries of t_ekpo for EBELN and EBELP...
    Use some temp table lt_ekpo = t_ekpo
    i.e. sort lt_ekpo by ebeln ebelp
    delete adjacent duplicates from lt_ekpo comparing ebeln ebelp.
    Now write you select query as below...So that the table might be hit with less number of entries...
    SELECT kschl
    evrtn
    evrtp
    knumh
    FROM a016 INTO TABLE t_a016
    FOR ALL ENTRIES IN lt_ekpo
    WHERE
    kappl EQ c_m (Application)
    AND kschl IN s_kschl
    AND evrtn = lt_ekpo-ebeln
    AND evrtp = lt_ekpo-ebelp.
    Please note that there will be no change in the output data if you hit with duplicate entries/unique as FOR ALL ENTRIES will fetch only unique entries matching the where condition.
    2) Order of where conditon fields should be same as the order in table for better performance...
    3) If you find any index on the table, try to include the fields in where condition(if possible) for better performance
    Hope this helps
    Regards
    Shiva

  • Regarding cluster tables

    hi all,
    is there any function module or some thing to find out the matter related to cluster table reorg
    thanks,
    jack

    Hi.....
    What do you mran by matter related to cluster table ?
    In the table DD02L you will find the list of all tables...
    Check this link also :
    abap functions
    Regards,
    Debjani........

  • To read data from cluster table  urgent

    i need to get personnel number(PERNR) from BSEG table which is a CLUSTER TABLE
    what else i have to add in here to get personnel number(PERNR)
    this code is giving no data only lots of ZEROS
    FORM getexpcode1 TABLES   in_tab21 STRUCTURE itcsy
                             out_tab21 STRUCTURE itcsy.
      DATA : w_belnr LIKE bseg-belnr,
                 w_bukrs LIKE bseg-bukrs,
                 w_gjahr LIKE bseg-gjahr,
                  w_pernr like bseg-pernr,
                 w_invnos(255).
    Read company code
      READ TABLE in_tab21 INDEX 1.
      IF sy-subrc = 0.
        w_bukrs = in_tab21-value.
      ENDIF.
    Read document number
      READ TABLE in_tab21 INDEX 2.
      IF sy-subrc = 0.
        w_belnr = in_tab21-value.
      ENDIF.
    Read Fiscal Year
      READ TABLE in_tab21 INDEX 3.
      IF sy-subrc = 0.
        w_gjahr = in_tab21-value.
      ENDIF.
      SELECT   pernr FROM bseg
        INTO  w_pernr
       WHERE  bukrs = w_bukrs
         AND  belnr = w_belnr
         AND  gjahr = w_gjahr.
      ENDSELECT.
      READ TABLE in_tab21 INDEX 1.
      out_tab21-value = w_pernr.
      MODIFY out_tab21 INDEX 1 TRANSPORTING value.
    ENDFORM.                    "GETEXPCODE1

    hi,
    try:
    SELECT pernr FROM bseg
    INTO w_pernr
    WHERE bukrs = w_bukrs
    AND belnr = w_belnr
    AND gjahr = w_gjahr
    AND PERNR <> SPACE.
    ENDSELECT.
    A.
    Message was edited by:
            Andreas Mann

  • Urgent query regarding performance

    hi
    i have one query regarding performance.iam using interactive reporting and workspace.
    i have all the linsence server,shared services,and Bi services and ui services and oracle9i which has metadata installed in one system(one server).data base which stores relationaldata(DB2) on another system.(i.e 2 systems in total).
    in order to increase performance i made some adjustments
    i installed hyperion BI server services, UI services,license server and shared services server such that all web applications (that used web sphere 5.1) such as shared services and UI services in server1(or computer1).and remaining linsence and bi server services in computer2 and i installed database(db2) on another computer3.(i.e 3 systems in total)
    my query : oracle 9i which has metadata where to install that in ( computer 1 or in computer 2 )
    i want to get best performance.where to install that oracle 9i which has metadata stored in it.
    for any queries please reply mail
    [email protected]
    9930120470

    You should know that executing a query is always slower the first time. Then Oracle can optimise your query and store it temporary for further executions. But passing from 3 minutes to 3 seconds, maybe your original query is really, really slow. Most of the times I only win few milliseconds. If Oracle is able to optimize it to 3 seconds. You must clearly rewrite your query.
    Things you should know to enhance your execution time : try to reduce the number of nested loops, nested loops give your an exponential execution time which is really slow :
    for rec1 in (select a from b) loop
      for  rec2 in (select c from d) loop
      end loop;
    end loop;Anything like that is bad.
    Try to avoid Cartesian products by writing the best where clause possible.
    select a.a,
             b.b
    from  a,
            b
    where b.b > 1This is bad and slow.

  • Regarding cluster table

    hi experts,
    I have an requirement about PR. I've to fetch all txgrp, buzei, kschl and hwste from bset table according to belnr and gjahr.
    but at the of fetching, only one txgrp, buzei, kschl and hwste are fetched. BSET table is a cluster table.
    Pls tell me how can I solve this problem.
    thanks in advance.
    Goutam

    Hi sachin,
    PR means perchase register.
    and I've fetch from bset table. I've no option.
    now what I've to do.
    thanks,
    Goutam.

  • Regarding Performance Issue

    Hi Friends,
       i have a FI report, Main Cash Vocher Printing, the report is very slow so to check its performance i have done the SQL Trace in ST05.
    in SQL trace i have found all the DB tables used and time taken to execute the select statement.... in that list i also found and Cluster Table RFBLG , but i did not used these cluster table in the program.
    and i also found more than 500 entries of Obj.NameRFBLG in that  ...
    Though its duration is small , ,, can we control that so that my report performance van be increased
    its Urgent...
    Useful reply will be awarded maximum
    Regards
    Kumat M

    Hi Kumat,
    RFBLG is the Cluster table of the logical table BSEG. That means the table BSEG stores its rows in the database table RFBLG. If the access to RFBLG is fast enough, you could ignore those entries and concentrate on red lines in the trace.
    Regards
    Ralph Ganszky

  • Lock object for KONV table/Cluster table ??

    Hi All,
    Is it possible to set Lock/Enqueue cluster tables or in my case table:KONV (KNUMV field) ?.
    OSS provided some programs without locks so was hoping if I could add before performing data manipulation.
    Regards,
    Neeth

    Hi Nameeth,
    you can use generic lock object E_TABLE with function modules ENQUEUE_E_TABLE, DEQUEUE_E_TABLE for locking and unlocking with parameters table name and key field.
    Regards,
    Satya

  • Performance problem with table COSS...

    Hi
    Anyone encountered performance problem with these table : COSS, COSB, COEP
    Best Regards

    >
    gsana sana wrote:
    > Hi Guru's
    >
    > this is the select Query which is taking much time in Production. so please help me to improve the preformance with BSEG.
    >
    > this is my select query:
    >
    > select  bukrs
    >               belnr
    >               gjahr
    >               bschl
    >               koart
    >               umskz
    >               shkzg
    >               dmbtr
    >               ktosl
    >               zuonr
    >               sgtxt
    >               kunnr
    >         from  bseg
    >         into  table gt_bseg1
    >          for  all entries in gt_bkpf
    >        where  bukrs eq p_bukrs
    >          and  belnr eq gt_bkpf-belnr
    >          and  gjahr eq p_gjahr
    >          and  buzei in gr_buzei
    >          and  bschl eq  '40'
    >          and  ktosl  ne  'BSP'.
    >
    > UR's
    > GSANA
    Hi,
    This is what I know and please if any expert think its incorrect, please do correct me.
    BSEG is a cluster table with BUKRS, BELNR, GJAHR and BUZEI as the key whereas other key will be stored in database as raw data thus SAP apps will need to convert that raw data first if we are using other keys in where condition. Hence, I suggest to use up to buzei in the where condition and filter other condition in internal table level like using Delete statement. Hope its help.
    Regards,
    Abraham

  • Inforation on Pool tables and cluster tables required.

    I want to know about the pool tables and cluster tables like how to create them and how to look the tables associated with the given tables. Like for the table BSEG we have other tables linked BSID etc. I'm new to this concept please guide me.

    <b>Pooled Table:</b>
    A pooled table in R/3 has a many-to-one relationship with a table in the database (see Figures 3.1 and 3.2). For one table in the database, there are many tables in the R/3 Data Dictionary. The table in the database has a different name than the tables in the DDIC, it has a different number of fields, and the fields have different names as well. Pooled tables are an SAP proprietary construct.
    When you look at a pooled table in R/3, you see a description of a table. However, in the database, it is stored along with other pooled tables in a single table called a table pool. A table pool is a database table with a special structure that enables the data of many R/3 tables to be stored within it. It can only hold pooled tables.
    R/3 uses table pools to hold a large number (tens to thousands) of very small tables (about 10 to 100 rows each). Table pools reduce the amount of database resources needed when many small tables have to be open at the same time. SAP uses them for system data. You might create a table pool if you need to create hundreds of small tables that each hold only a few rows of data. To implement these small tables as pooled tables, you first create the definition of a table pool in R/3 to hold them all. When activated, an associated single table (the table pool) will be created in the database. You can then define pooled tables within R/3 and assign them all to your table pool.
    Pooled tables are primarily used by SAP to hold customizing data.
    <b>Cluster Table:</b>
    A cluster table is similar to a pooled table. It has a many-to-one relationship with a table in the database. Many cluster tables are stored in a single table in the database called a table cluster.
    A table cluster is similar to a table pool. It holds many tables within it. The tables it holds are all cluster tables.
    Like pooled tables, cluster tables are another proprietary SAP construct. They are used to hold data from a few (approximately 2 to 10) very large tables. They would be used when these tables have a part of their primary keys in common, and if the data in these tables are all accessed simultaneously.
    Table clusters contain fewer tables than table pools and, unlike table pools, the primary key of each table within the table cluster begins with the same field or fields. Rows from the cluster tables are combined into a single row in the table cluster. The rows are combined based on the part of the primary key they have in common. Thus, when a row is read from any one of the tables in the cluster, all related rows in all cluster tables are also retrieved, but only a single I/O is needed.
    A cluster is advantageous in the case where data is accessed from multiple tables simultaneously and those tables have at least one of their primary key fields in common. Cluster tables reduce the number of database reads and thereby improve performance.
    Restrictions on Pooled and Cluster Tables
    1. 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:
    2. Secondary indexes cannot be created.
    3. You cannot use the ABAP/4 constructs select distinct or group by.
    4.You cannot use native SQL.
    5.You cannot specify field names after the order by clause. order by primary key is the only permitted variation.
    For creation of pooled /cluster table, have  a look at below link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    For creation of table pool /cluster, have  a look at below link.
    http://help.sap.com/saphelp_erp2004/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm
    Have a look at below link.
    http://www.sap-img.com/abap/the-different-types-of-sap-tables.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • HR Cluster Tables

    Hi
    I need the HR cluster table names. Can you please provide?
    Regards
    Praveen

    hi praveen,
                    go through this
    Cluster Table
    u2022 Cluster tables combine the data from several tables with identical (or almost identical) keys
      into one physical record on the database.
    . Data is written to a database in compressed form.
    u2022 Retrieval of data is very fast if the primary key is known.
    u2022 Cluster tables are defined in the data dictionary as transparent tables.
    u2022 External programs can NOT interpret the data in a cluster table.
    u2022 Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE
      FROM DATABASE are used to process data in the cluster tables.
    PCL1 - Database for HR work area;
    PCL2 - Accounting Results (time, travel expense and payroll);
    PCL3 - Applicant tracking data;
    PCL4 - Documents, Payroll year-end Tax data
    Database Tables PCLn
    u2022 PCLn database tables are divided into subareas known as data clusters.
    u2022 Data Clusters are identified by a two-character code. e.g RU for US payroll result, B2 for
      time evaluation result...
    u2022 Each HR subarea has its own cluster.
    u2022 Each subarea has its own key.
    Database Table PCL1
    u2022 The database table PCL1 contains the following data areas:
      B1 time events/PDC
      G1 group incentive wages
      L1 individual incentive wages
      PC personal calendar
      TE travel expenses/payroll results
      TS travel expenses/master data
      TX infotype texts
      ZI PDC interface -> cost account
    Database Table PCL2
    u2022 The database table PCL2 contains the following data areas:
      B2 time accounting results
      CD cluster directory of the CD manager
      PS generated schemas
      PT texts for generated schemas
      RX payroll accounting results/international
      Rn payroll accounting results/country-specific ( n = HR country indicator )
      ZL personal work schedule
    Database Table PCL3
    u2022 The database table PCL3 contains the following data areas:
      AP action log / time schedule
      TY texts for applicant data infotypes
    Data Management of PCLn
    u2022 The ABAP commands IMPORT and EXPORT are used for management of read/write to
      database tables PCLn.
    u2022 A unique key has to be used when reading data from or writing data to the PCLn.
      Field Name KEY Length Text
      MANDT X 3 Client
      RELID X 2 Relation ID (RU,B2..)
      SRTFD X 40 Work Area Key
      SRTF2 X 4 Sort key for dup. key
    Cluster Definition
    u2022 The data definition of a work area for PCLn is specified in separate programs which comply  
       with fixed naming conventions.
    u2022 They are defined as INCLUDE programs (RPCnxxy0). The following naming convention applies:
       n = 1 or 2 (PCL1 or PCL2)
       xx = Relation ID (e.g. RX)
       y = 0 for international clusters or country indicator (T500L) for different country cluster
    Exporting Data (I)
    u2022 The EXPORT command causes one or more 'xy' KEY data objects to be written to cluster xy.
    u2022 The cluster definition is integrated with the INCLUDE statement.
    REPORT ZHREXPRT.
    TABLES: PCLn.
    INCLUDE: RPCnxxy0. "Cluster definition
    * Fill cluster KEY
    xy-key-field = <value>.
    * Fill data object
    * Export record
    EXPORT TABLE1 TO DATABASE PCLn(xy) ID xy-KEY.
       IF SY-SUBRC EQ 0.
           WRITE: / 'Update successful'.
       ENDIF.
    Exporting Data (II)
    . Export data using macro RP-EXP-Cn-xy.
    u2022 When data records are exported using macro, they are not written to the database but to a  
      main memory buffer.
    u2022 To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.
    REPORT ZHREXPRT.
    *Buffer definition
    INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    RP-EXP-Cn-xy.
    IF SY-SUBRC EQ 0.
        PERFORM PREPARE_UPDATE USING 'V'..
    ENDIF.
    Importing Data (I)
    u2022 The IMPORT command causes data objects with the specified key values to be read from
       PCLn.
    u2022 If the import is successful, SY-SUBRC is 0; if not, it is 4.
    REPORT RPIMPORT.
    TABLES: PCLn.
    INCLUDE RPCnxxy0. "Cluster definition
    * Fill cluster Key
    * Import record
    IMPORT TABLE1 FROM DATABASE PCLn(xy) ID xy-KEY.
       IF SY-SUBRC EQ 0.
          * Display data object
       ENDIF.
    Importing data (II)
    u2022 Import data using macro RP-IMP-Cn-xy.
    u2022 Check return code SY-SUBRC. If 0, it is successful. If 4, error.
    u2022 Need include buffer management routines RPPPXM00
    REPORT RPIMPORT.
    *Buffer definition
    INCLUDE RPPPXD00.
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    *import data to buffer
    RP-IMP-Cn-xy.
    *Buffer management routines
    INCLUDE RPPPXM00.
    Cluster Authorization
    u2022 Simple EXPORT/IMPORT statement does not check for cluster authorization.
    u2022 Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
      authorization.
    Payroll Results (I)
    u2022 Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
      n - country identifier.
    u2022 Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
      report RPCEDTn0 lists the results on a payroll form.
    Payroll Results (II)
    u2022 The cluster definition of payroll results is stored in two INLCUDE reports:
      include: rpc2rx09. "Definition Cluster Ru (I)
      include: rpc2ruu0. "Definition Cluster Ru (II)
    The first INCLUDE defines the country-independent part; The second INCLUDE defines the country-specific part (US).
    u2022 The cluster key is stored in the field string RX-KEY.
    Payroll Results (III)
    u2022 All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This
      allows you to use the same structures in different definitions and nonetheless maintain data
      consistency.
    u2022 The structures for cluster definition comply with the name convention PCnnn. Unfortunately, 
       'nnn' can be any set of alphanumeric characters.
    *Key definition
    DATA: BEGIN OF RX-KEY.
         INCLUDE STRUCTURE PC200.
    DATA: END OF RX-KEY.
    *Payroll directory
    DATA: BEGIN OF RGDIR OCCURS 100.
         INCLUDE STRUCTURE PC261.
    DATA: END OF RGDIR.
    Payroll Cluster Directory
    u2022 To read payroll results, you need two keys: pernr and seqno
    . You can get SEQNO by importing the cluster directory (CD) first.
    REPORT ZHRIMPRT.
    TABLES: PERNR, PCL1, PCL2.
    INLCUDE: rpc2cd09. "definition cluster CD
    PARAMETERS: PERSON LIKE PERNR-PERNR.
    RP-INIT-BUFFER.
    *Import cluster Directory
       CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
       CHECK SY-SUBRC = 0.
    LOOP AT RGDIR.
       RX-KEY-PERNR = PERSON.
       UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
       *Import data from PCL2
       RP-IMP-C2-RU.
       INLCUDE: RPPPXM00. "PCL1/PCL2 BUFFER HANDLING
    Function Module (I)
      CD_EVALUATION_PERIODS
    u2022 After importing the payroll directory, which record to read is up to the programmer.
    u2022 Each payroll result has a status.
      'P' - previous result
      'A' - current (actual) result
      'O' - old result
    u2022 Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period
       when that payroll is initially run. It also will select all the relevant periods to be evaluated.
    Function Module (II)
    CD_EVALUATION_PERIODS
    call function 'CD_EVALUATION_PERIODS'
         exporting
              bonus_date = ref_periods-bondt
              inper_modif = pn-permo
              inper = ref_periods-inper
              pay_type = ref_periods-payty
              pay_ident = ref_periods-payid
         tables
              rgdir = rgdir
              evpdir = evp
              iabkrs = pnpabkrs
         exceptions
              no_record_found = 1.
    Authorization Check
       Authorization for Persons
    u2022  In the authorization check for persons, the system determines whether the user has the 
       authorizations required for the organizational features of the employees selected with
       GET PERNR.
    u2022  Employees for which the user has no authorization are skipped and appear in a list at the end
       of the report.
    u2022  Authorization object: 'HR: Master data'
    Authorization for Data
    u2022 In the authorization check for data, the system determines whether the user is authorized to
      read the infotypes specified in the report.
    u2022 If the authorization for a particular infotype is missing, the evaluation is terminated and an error
      message is displayed.
    Deactivating the Authorization Check
    u2022 In certain reports, it may be useful to deactivate the authorization check in order to improve
      performance. (e.g. when running payroll)
    u2022 You can store this information in the object 'HR: Reporting'.

  • DB Size for a custom cluster table?

    Hi friends,
    I have a requirement where in i need to store huge attachments into SAP DB.
    For that i created a Custom cluster table just like INDX table and storing the binary read attachments(PDF/JPEG) into it.
    Can some one help me how much size from DB side this table would take.
    Suppose i am reading a PDF file of size 3.5 MB and storign this into my custom cluster table, which would span into 1200 records, what is the DB size taken by this ?
    Appreciate any help on this.
    SAP Version - 4.7EE
    DB - DB2
    OS - AIX
    Regards,
    Simha
    Edited by: Simha on Aug 5, 2008 7:27 AM

    Hi Simha,
    simple question complex answer ....
    The answer mainly depends on the length of the RAW column in the INDX type table. In my answer I assume that your database is running with the default of 16K tablespace page size.
    (1) if the length of the RAW column is below 4K on a unicode system or below 12K in a non unicode system,
         the ABAP RAW column is mapped to a VARCHAR FOR BIT DATA column on database level.
         VARCHAR FOR BIT DATA colunms are buffered in the database buffer pool and can benefit from DB2 row compression.
         DB2 row compression may not help for PDF or JPEG data since this data is already compressed
         but buffering will provide better performance.
         Since VARCHAR FOR BIT DATA columns will be stored in the DB2 data pages, the overall space requirement will be
         minimal if the space in the 16K pages can be used optimal. E.g. if the size of our RAW column is 8,5 K and most rows
         contain values with maximun length in this column only one row can be stored per data page.
    (2) if (1) does not apply, the ABAP RAW column is mapped to a LONG VARCHAR FOR BIT DATA
         column on database level.
         LONG data is stored in seperate LONG pages on database level. The LONG data is stored in blocks of
         512 bytes time 2^N ( 512, 1024, 2048, 4K , 8K, 16K ). The overall space requirement will be
         minimal if the space in the LONG blocks can be used optimal.
    Given the explanation above I would guess that in worst case you may need a factor of 2 more space in the database than your document size. Each additional row will require some bytes overhead in the DB2 data pages and will create additional index entries. So you may want a large maximum size of your RAW column but this will give you LONG data types.
    If read performance is not critical I would suggest to choose 16K as your size of the RAW column. This should completely fill the LONG blocks.
    If read performance is more critical you should choose a small size for the RAW column ( e.g. 2K ) to benefit from data buffering and to avoid sparsely filled data pages.
    Regards
                   Frank

Maybe you are looking for