Different Performance for a view/table

Hi,
I have a view called "Myview" which has a poor performance on one database (DBTEST) but with good performance on another database (DBDEV)
I checked the indexes on both and all of them were in place on both databases.
DBTEST and DBDEV both installed on the same Unix machine (They share the same resources).
Since both databases are configured similarly I'm wondering why querying Myview view takes two times more to return records?
How can I identify where the problem is? The "consistent gets" and "physical reads" parameters are about 2 times more in DBTEST when I query the view. I believe this is why I have poor performance in DBTEST.
Could someone give me an advice on what db parameters I should verify to identify the problem?
DBTEST> select status from Myview where id =100;
elapse time: 40 seconds
DBDEV> select status from Myview where id =100;
elapse time: 22 seconds
DBTEST> select count(*) from Myview;
5123 rows selected
DBDEV> select count(*) from Myview;
4022 rows selected
Thanks,
Amir

There are 13 tables plus one view underlying the Myview
The tables which are not listed, are lookup tables and contain equal number of rows on both DBs:
DBDEV
TableName No of Rows
user_role                          3023
project                          2059
project_year 647
doc_tab 3091
user                                              3155
org                         2639
region                              125
application 3353
DBDEV
TableName No of Rows
user_role                          6362
project                          5058
project_year                         1516
doc_tab 8659
user                                              6936
org                         6320
region                              176
application 7325
Since Myview is using UNION clause I picked part of the execution plan:
DBDEV:
11 rows selected.
Elapsed: 00:00:16.01
Execution Plan
SELECT STATEMENT Optimizer=CHOOSE (Cost=525 Card=3 Bytes=111)
VIEW OF 'Myview' (Cost=525 Card=3 Bytes=111)
SORT (UNIQUE) (Cost=560 Card=3 Bytes=1103)
UNION-ALL
HASH JOIN (ANTI) (Cost=138 Card=1 Bytes=369)
HASH JOIN (Cost=135 Card=1 Bytes=356)
NESTED LOOPS (Cost=132 Card=1 Bytes=348)
NESTED LOOPS (OUTER) (Cost=131 Card=1 Bytes=330)
NESTED LOOPS (OUTER) (Cost=130 Card=1 ytes=308)
NESTED LOOPS (OUTER) (Cost=129 Card=1 Bytes=295)
FILTER
NESTED LOOPS (OUTER)
HASH JOIN (Cost=128 Card=1 Bytes=175)
VIEW OF 'Myview_PROJ_ALL_YEAR'
(Cost=123 Card=15 Bytes=2295)
MERGE JOIN (Cost=123 Card=15 Bytes=1935)
SORT (JOIN) (Cost=119 Card=529 Bytes=61893)
HASH JOIN (Cost=107 Card=529 Bytes=61893)
VIEW OF 'Myview_PROJECT' (Cost=100 Card=529 Bytes=44436)
SORT (UNIQUE) (Cost=100 Card=529 Bytes=40998)
UNION-ALL
HASH JOIN (Cost=9 Card=51 Bytes=2703)
TABLE ACCESS (FULL) OF 'GRANT_PROGRAM' (Cost=2 Card=15 Bytes=135)
TABLE ACCESS (FULL) OF 'PROJECT' (Cost=6 Card=51 Bytes=2244)
HASH JOIN (Cost=48 Card=129 Bytes=11610)
HASH JOIN (Cost=41 Card=127 Bytes=9779)
HASH JOIN (Cost=29 Card=94 Bytes=5922)
HASH JOIN (Cost=9 Card=51 Bytes=2703)
TABLE ACCESS (FULL) OF 'GRANT_PROGRAM' (Cost=2 Card=15 Bytes=135)
TABLE ACCESS (FULL) OF 'PROJECT' (Cost=6 Card=51 Bytes=2244)
TABLE ACCESS (FULL) OF 'APPLICATION' (Cost=19 Card=3353 Bytes=33530)
INDEX (FAST FULL SCAN) OF 'UK_user_INVOLVE' (UNIQUE) (Cost=11 Card=4527 Bytes=63378)
TABLE ACCESS (FULL) OF 'user_role' (Cost=6 Card=3023 Bytes=39299)
HASH JOIN (Cost=12 Card=298 Bytes=22350)
HASH JOIN (Cost=9 Card=51 Bytes=2907)
TABLE ACCESS (FULL) OF 'GRANT_PROGRAM' (Cost=2 Card=15 Bytes=135)
TABLE ACCESS (FULL) OF 'PROJECT' (Cost=6 Card=51 Bytes=2448)
TABLE ACCESS (FULL) OF 'region' (Cost=2 Card=69 Bytes=1242)
HASH JOIN (Cost=19 Card=51 Bytes=4335)
HASH JOIN (Cost=12 Card=51 Bytes=3366)
HASH JOIN (Cost=9 Card=51 Bytes=2907)
DBINT:
9 rows selected.
Elapsed: 00:00:34.03
Execution Plan
SELECT STATEMENT Optimizer=CHOOSE (Cost=941 Card=3 Bytes=111)
VIEW OF 'Myview' (Cost=941 Card=3 Bytes=111)
SORT (UNIQUE) (Cost=976 Card=3 Bytes=1106)
UNION-ALL
HASH JOIN (ANTI) (Cost=253 Card=1 Bytes=370)
NESTED LOOPS (OUTER) (Cost=250 Card=1 Bytes=357)
NESTED LOOPS (OUTER) (Cost=250 Card=1 Bytes=341)
NESTED LOOPS (OUTER) (Cost=249 Card=1 Bytes=318)
HASH JOIN (Cost=248 Card=1 Bytes=304)
NESTED LOOPS (Cost=245 Card=1 Bytes=296)
HASH JOIN (Cost=243 Card=2 Bytes=556)
FILTER
HASH JOIN (OUTER)
VIEW OF 'Myview_PROJ_ALL_YEAR' (Cost=229 Card=35 Bytes=5355)
MERGE JOIN (Cost=229 Card=35 Bytes=4550)
SORT (JOIN) (Cost=226 Card=1262 Bytes=148916)
HASH JOIN (Cost=198 Card=1262 Bytes=148916)
VIEW OF 'Myview_PROJECT' (Cost=183 Card=1262 Bytes=106008)
SORT (UNIQUE) (Cost=183 (Card=1262 Bytes=100528)
UNION-ALL
HASH JOIN (Cost=15 Card=126 Bytes=6678)
TABLE ACCESS (FULL) OF 'GRANT_PROGRAM' (Cost=2 Card=28 Bytes=252)
TABLE ACCESS (FULL) OF 'PROJECT' (Cost=12 Card=126 Bytes=5544)
HASH JOIN (Cost=98 Card=454 Bytes=41314)
HASH JOIN (Cost=88 Card=448 Bytes=34496)
HASH JOIN (Cost=48 Card=206 Bytes=12978)
HASH JOIN (Cost=15 Card=126 Bytes=6678)
TABLE ACCESS (FULL) OF 'GRANT_PROGRAM' (Cost=2 Card=28 Bytes=252)
TABLE ACCESS (FULL) OF 'PROJECT' (Cost=12 Card=126 Bytes=5544)
TABLE ACCESS (FULL) OF 'APPLICATION' (Cost=32 Card=7325 Bytes=73250)
INDEX (FAST FULL SCAN) OF 'UK_user_INVOLVE' (UNIQUE) (Cost=39 Card=15889
Bytes=222446)
TABLE ACCESS (FULL) OF 'user_role' (Cost=9 Card=6362 Bytes=89068)
HASH JOIN (Cost=18 Card=556 Bytes=41700)
TABLE ACCESS (FULL) OF 'region' (Cost=2 Card=88 Bytes=1584)
HASH JOIN (Cost=15 Card=126 Bytes=7182)
TABLE ACCESS (FULL) OF 'GRANT_PROGRAM' (Cost=2 Card=28 Bytes=252)
TABLE ACCESS (FULL) OF 'PROJECT' (Cost=12 Card=126 Bytes=6048)
HASH JOIN (Cost=28 Card=126 Bytes=10836)
HASH JOIN (Cost=18 Card=126 Bytes=8316)
You see alapse time for querying DBTEST is sometimes 2 times more than DBDEV. BTW, I checked all indexes for both database are in place.
Based on the information provided can you tell me what the problem is?
Thanks,

Similar Messages

  • Error in creating Transport Request for a view table

    Hello all,
    I have an ECC IDES 6.0 system named EC1 and another one which is ECC EhP4 IDES named EA1 which I have just installed.
    One of my requesters has a view table named ZVAITM_TBLE in EC1 and she wants it to be transported to EA1.
    So I created a workbench transport in SE10 and included the following:
    PgmID = R3TR
    Obj = VDAT
    Object name = ZVAITM_TBLE
    But when I press enter, I encountered the following error:
    No object definition exists for Customizing object ZVAITM_TBLE
    Message no. TK427
    Diagnosis
    The Customizing object R3TR VDAT ZVAITM_TBLE is not defined in the tables of the Change and Transport System.
    This means that you cannot use the Transport Organizer to edit it.
    System Response
    The function terminates.
    Procedure
    First check whether the name of the object is correct. Then you (or the system administrator) should check the object definition, to ensure that the object was created correctly (transaction SOBJ).
    If the object does not exist, then create it or delete it from the request/task.
    I am new to transports so I have no idea how to proceed.
    Please advise.
    Thanks a lot!
    Cha Cha

    Hello Cha,
    Kindly open this custom table using SM30 and try creating a transport request from there.
    Regards
    Vivek

  • How to enter values for newly inserted field for maintenace view table

    Hi ,
    I have inserted new field for custom table which consits of maintance view..
    I want to put some values in to this newly inserted field..
    When i try to insert values bu useing se16,iam unable to view this newely inserted field..
    Can you please let me know how can i insert values to this newely created field
    Thanx,
    Parnith

    Hi Parnith,
    It is easy to use a table maintainance to enter values to a database table....
    if you have a table maintainace generator and you are not able to see the newly added field here is the reason
    Everytime you add a new field , the table maintainance needs to be regenerated..The reason is that the screen you are using in the table maintainance is created within a program with respect to the fucntion group and not directly linked to the table..whenever you change the table,the function group is not affected and changes are not reflected in the table maintainance , so you have to regenerate by utilities-> table maintainance generator in sell for that table..once you do it , the function group assigned to the table automatically creates a new one with the latest fields added
    Reward if helpful
    Regards
    Byju

  • Different query for same view showing on different page as list view web part

    Hi all,
    If you have three pages and want to add Documents library as list view web part to these three pages with different query (Programmatically), Do you need to create three different views for Documents library or it is possible to have different query when
    I add the list view web part to the page?
    thanks and appreciate all kind of advice.

    When you add a List View Web Part to a page, SharePoint actually copies the selected view query into the Web Part itself. For example:
    You create a custom view on a list called "Mede71's View" and you configure it only show the Title column
    You add a List View Web Part to a page and update the settings to use the "Mede71's View"
    You go back to your list and change "Mede71's View" and add the "Modified Date" column
    Your List View Web Part will not reflect this change because in step 2 the Query from the view was copied into the List View Web Part
    When you programmatically add the List View Web Part, you can either assign it to an existing view or supply the query directly. If you want to instruct users to be able to add their own web parts pointing to those views in the future, I would recommend
    creating the views first.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • Different behavior for Power View between Excel and Power Bi Site

    Hello,
    this problem is driving me crazy...
    I have a PowerPivot Data Model and created a PowerView that includes three charts for the 
    Year, Quarter, Brand and a matrix that allow me to drill down the different projects. Each Project in the matrix can be clicked to view the project details.
    The strange thing is that in Excel on my Desktop and in the Power Bi App for Surace RT when i press the Project in the drill down the previous filters remains set, while if i do the same in Power Bi Sites the filters are lost. I tried with Chrome and IE
    but behavior the same. Am i missing something?
    Thank you so much

    Dear Will,
    thank you so much for your reply.
    I'm attaching come screenshots from Power bi site i remove the clases and the data, but you should have an idea of the scenario. Actually I'm not setting the Year and Quarter filter as view filters in the Power View.
    I'm just using Cross filtering and i realize that the behavior is different between Excel Desktop and Power Bi Surface RT app and the bi sites (with all browsers).
    First image with 2014 set (just clicked on 2014) the data on the Matrix have been deleted.
    After i select the drill down:
    Thank you so much for your help, I really appreciate it!
    --silvano

  • HOW TO USE A SINGLE PERFORM FOR VARIOUS TABLES ?

    perform test TABLES t_header.
    select
           KONH~KNUMH
           konh~datab
           konh~datbi
           konp~kbetr
           konp~konwa
           konp~kpein
           konp~kmein
           KONP~KRECH
           FROM konh INNER JOIN konp
                  ON konpknumh = konhknumh
           into table iTABXXX
            "ANY TEMPERARY INTERNAL TABLE.
           for all entries in t_header
           where
                 konh~kschl = t_header-kschl
             AND konh~knumh = t_header-knumh.
    endform.
    how can I use above perform for various internal tables of DIFFERENT LINE TYPES but having the fields KSCHL & KNUMH.

    u can use single perform....
    just see this example......hope this is what u r expecting....
    tables : pa0001.
    parameters : p_pernr like pa0001-pernr.
    data : itab1 like pa0001 occurs 0 with header line.
    data : itab2 like pa0002 occurs 0 with header line.
    perform get_data tables itab1 itab2.
    if not itab1[] is initial.
    loop at itab1.
    write :/ itab1-pernr.
    endloop.
    endif.
    if not itab2[] is initial.
    loop at itab2.
    write :/ itab2-pernr.
    endloop.
    endif.
    *&      Form  get_data
          text
         -->P_ITAB1  text
         -->P_ITAB2  text
    form get_data  tables   itab1 structure pa0001
                            itab2 structure pa0002.
    select * from pa0001 into table itab1 where pernr = p_pernr and begda le sy-datum and endda ge sy-datum.
    select * from pa0002 into table itab2 where pernr = p_pernr and begda le sy-datum and endda ge sy-datum.
    endform.                    " get_data
    Regards
    vasu

  • View Table to update Physical Inventory Number Range.

    Hi,
    I am looking for the 'View Table' Name to update Physical Inventory Number Range in OMMB transaction.
    I will have to do it using SM30 as OMMB is display only.
    Thanks

    Hi,
    OMBT still cant help me because I dont have write access on this client.
    Are you aware on how to get the View Table to Maintain Number Ranges for Physical Inventory?
    Thanks,
    Rohit.

  • Data entry for Z... table

    I created a table with 3 fields and want to maintain its data. I know that use SE54 and then SM30 to do that, but I got this error when I tried to maintain data in SM30.
    View/table ZREGION can only be displayed and maintained with restrictions
    Message no. SV792
    Diagnosis
    You tried to call a maintenance dialog for the view/table ZREGION, for which the table maintenance is only allowed with restrictions. You can only edit the data in the environment of another program or a view cluster.
    Could anybody give me a step by step solution for a user table? Any replies are greatly appreciated!

    Hi,
    I think while generating the table maint, you have chosen the option.
    Just relook at the Table maint, and change this property.
    That should fix the problem.
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • Performance for table BKFP

    Hi,
    I would like to enquire is there anyway that i can improve the performance for table BKPF from the ABAP code point of view.
    Because we have customise one program to generate report for the asset master listing.
    one of the select statement are show as below:
          SELECT SINGLE * FROM BKPF WHERE BUKRS = ANEP-BUKRS
                                      AND GJAHR = ANEP-GJAHR
                                      AND AWKEY = AWKEYUS.
    I would like to know how it different from the select statemene below:
    SELECT SINGLE * FROM BKPF INTO CORRESPONDING FIELDS OF T_BKPF
          WHERE
          BUKRS = ANEP-BUKRS
      AND GJAHR = ANEP-GJAHR
      AND AWKEY = AWKEY.
    Which of the select statements above can enhance report,because currently we have face quite bad issue on this report.
    Can i post the ABAP code on this forum.
    Hope someone can help me on this. thank you.

    Hi,
    As much as possible use the primary keys of BKPF which is BUKRS, BELNR and GJAHR. Also, select only the records which are needed so to increase performance. Please look at the code below:
    DATA: lv_age_of_rec TYPE p.
      FIELD-SYMBOLS: <fs_final> LIKE LINE OF it_final.
      LOOP AT it_final ASSIGNING <fs_final>.
      get records from BKPF
        SELECT SINGLE bukrs belnr gjahr budat bldat xblnr bktxt FROM bkpf
        INTO (bkpf-bukrs, bkpf-belnr, bkpf-gjahr, <fs_final>-budat,
              <fs_final>-bldat, <fs_final>-xblnr, <fs_final>-bktxt)
        WHERE bukrs = <fs_final>-bukrs
          AND belnr = <fs_final>-belnr
          AND gjahr = <fs_final>-gjahr.
      if <fs_final>-shkzg = 'H', multiply dmbtr(amount in local currency)
      by negative 1
        IF <fs_final>-shkzg = 'H'.
          <fs_final>-dmbtr = <fs_final>-dmbtr * -1.
        ENDIF.
      combine company code(bukrs), accounting document number(belnr),
      fiscal year(gjahr) and line item(buzei) to get long text.
        CONCATENATE: <fs_final>-bukrs <fs_final>-belnr
                     <fs_final>-gjahr <fs_final>-buzei
                     INTO it_thead-tdname.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            client                        = sy-mandt
            id                            = '0001'
            language                      = sy-langu
            name                          = it_thead-tdname
            object                        = 'DOC_ITEM'
          ARCHIVE_HANDLE                = 0
          LOCAL_CAT                     = ' '
        IMPORTING
          HEADER                        =
          TABLES
            lines                         = it_lines
         EXCEPTIONS
           id                            = 1
           language                      = 2
           name                          = 3
           not_found                     = 4
           object                        = 5
           reference_check               = 6
           wrong_access_to_archive       = 7
           OTHERS                        = 8.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
      if successful, split long text into start and end date
        IF sy-subrc = 0.
          READ TABLE it_lines TRANSPORTING tdline.
          IF sy-subrc = 0.
            SPLIT it_lines-tdline AT '-' INTO
                  <fs_final>-s_dat <fs_final>-e_dat.
          ENDIF.
        ENDIF.
      get vendor name from LFA1
        SELECT SINGLE name1 FROM lfa1
        INTO <fs_final>-name1
        WHERE lifnr = <fs_final>-lifnr.
        lv_age_of_rec = p_budat - <fs_final>-budat.
      condition for age of deposits
        IF lv_age_of_rec <= 30.
          <fs_final>-amount1 = <fs_final>-dmbtr.
        ELSEIF lv_age_of_rec > 30 AND lv_age_of_rec <= 60.
          <fs_final>-amount2 = <fs_final>-dmbtr.
        ELSEIF lv_age_of_rec > 60 AND lv_age_of_rec <= 90.
          <fs_final>-amount3 = <fs_final>-dmbtr.
        ELSEIF lv_age_of_rec > 90 AND lv_age_of_rec <= 120.
          <fs_final>-amount4 = <fs_final>-dmbtr.
        ELSEIF lv_age_of_rec > 120 AND lv_age_of_rec <= 180.
          <fs_final>-amount5 = <fs_final>-dmbtr.
        ELSEIF lv_age_of_rec > 180.
          <fs_final>-amount6 = <fs_final>-dmbtr.
        ENDIF.
        CLEAR: bkpf, it_lines-tdline, lv_age_of_rec.
      ENDLOOP.
    Hope this helps...
    P.S. Please award points for useful answers.

  • View for mseg database table

    I want to extract data from MSEG. Its becoming performance issue. Can anybody advice me regarding any view which i can use in place of MSEG

    a view won't increase performance, have you tried to force the index or create an index for the fields you use for the mseg table
    perhaps if you need specific data you can also check BSAK BSIK  BSAD BSID  tables which are related to BSEG .
    kind regards
    arthur de smidt
    Edited by: A. de Smidt on Jul 30, 2008 1:03 PM

  • View for CDPOS & CDHDR tables

    Hi all,
    I am developing a report for which I am fetching fields from CDPOS & CDHDR tables (both r cluster tables). when i run st05, it fetches values from a cluster table CDCLS which takes most of the database time.
    Is there any view for CDPOS & CDHDR tables?
    How to find the views for cluster tables?
    Thanx in advance.
    Vijay.

    hi,
    check this code,
    here i used function module to get details of cdhdr,cdpos.
    TABLES : MARC.
    DATA :BEGIN OF GI_MARC OCCURS 0,
          MATNR LIKE MARC-MATNR,
          WERKS LIKE MARC-WERKS,
          DISPO LIKE MARC-DISPO,
          END OF GI_MARC.
    DATA : CHAR TYPE I,
           COUNT TYPE I,
           VAR TYPE I.
    DATA : BEGIN OF GI_FINAL OCCURS 2000,
           MATNR LIKE MARC-MATNR,
           DISPO LIKE MARC-DISPO,
           USERNAME LIKE CDHDR-USERNAME,
           UDATE LIKE CDHDR-UDATE,
           UTIME LIKE CDHDR-UTIME,
           TCODE LIKE CDHDR-TCODE,
           TABNAME LIKE CDPOS-TABNAME,
           TABKEY  LIKE CDPOS-TABKEY,
           FNAME  LIKE CDPOS-FNAME,
           VALUE_NEW  LIKE CDPOS-VALUE_NEW,
           VALUE_OLD   LIKE CDPOS-VALUE_OLD,
           CHANGENR LIKE CDHDR-CHANGENR,
           END OF GI_FINAL.
    DATA : MATNR LIKE MARC-MATNR,
           DISPO LIKE MARC-DISPO,
           USERNAME1 LIKE CDHDR-USERNAME,
           UDATE1 LIKE CDHDR-UDATE,
           UTIME LIKE CDHDR-UTIME,
           TCODE LIKE CDHDR-TCODE,
           CHANGENR LIKE CDHDR-CHANGENR.
    DATA : GI_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE.
    DATA : GI_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    DATA : OBJECTCLAS LIKE CDHDR-OBJECTCLAS VALUE 'MATERIAL',
           OBJECTID LIKE CDHDR-OBJECTID,
           USERNAME LIKE CDHDR-USERNAME VALUE 'RSS-SPE',
           UDATE LIKE CDHDR-UDATE VALUE '20070101',
           CHANGE_IND LIKE CDHDR-CHANGE_IND VALUE 'U'.
    type-pools: slis.
    data: gt_slis_fcat type slis_t_fieldcat_alv.
    data: gt_fieldcat type slis_t_fieldcat_alv.
    *data: gt_fieldcatall type slis_t_fieldcat_alv.
    data: g_repid like sy-repid.
    data: gs_layout type slis_layout_alv.
    gs_layout-zebra             = 'X'.
    gs_layout-colwidth_optimize = 'X'.
    SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-110.
    SELECT-OPTIONS :  P_DISPO FOR MARC-DISPO.
    SELECT-OPTIONS : RECORDS FOR CHAR.
    SELECTION-SCREEN : END OF BLOCK B1.
    START-OF-SELECTION.
    perform process_data.
    perform f_fieldcat_init using gt_fieldcat[].
    perform alv_display tables gi_final using gt_fieldcat[].
    form process_data.
      SELECT MATNR WERKS DISPO FROM MARC INTO TABLE GI_MARC
                                WHERE DISPO IN P_DISPO
                                AND WERKS = '1011'." Becoz we hav to chk the
    the changes made in the material while extendin tht matrl frm 1011 to
    *other plant.
      IF NOT GI_MARC[] IS INITIAL.
        IF NOT RECORDS-LOW IS INITIAL .
          IF NOT RECORDS-HIGH IS INITIAL.
            DESCRIBE TABLE GI_MARC LINES COUNT.
            IF RECORDS-HIGH < COUNT.
              DELETE GI_MARC FROM RECORDS-HIGH TO COUNT.
            ENDIF.
            IF RECORDS-LOW <> 1.
              IF RECORDS-LOW <> 0.
                DELETE GI_MARC FROM 1 TO RECORDS-LOW.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      LOOP AT GI_MARC.
        CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
          EXPORTING
            INPUT              = GI_MARC-MATNR
         IMPORTING
           OUTPUT             = GI_MARC-MATNR
    EXCEPTIONS
      LENGTH_ERROR       = 1
      OTHERS             = 2
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        OBJECTID = GI_MARC-MATNR .
        CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
          EXPORTING
      ARCHIVE_HANDLE                   = 0
           DATE_OF_CHANGE                   = UDATE
            OBJECTCLASS                      = OBJECTCLAS
            OBJECTID                         = OBJECTID
      TIME_OF_CHANGE                   = '000000'
           USERNAME                         = USERNAME
      LOCAL_TIME                       = ' '
      DATE_UNTIL                       = '99991231'
      TIME_UNTIL                       = '235959'
          TABLES
            I_CDHDR                          = GI_CDHDR
         EXCEPTIONS
           NO_POSITION_FOUND                = 1
           WRONG_ACCESS_TO_ARCHIVE          = 2
           TIME_ZONE_CONVERSION_ERROR       = 3
           OTHERS                           = 4
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
             EXPORTING
                  TEXT = 'Processing'.
        IF NOT GI_CDHDR[] IS INITIAL.
          LOOP AT GI_CDHDR.
          MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
          MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
          MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
          MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
          MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
          MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
            VAR = 1.
            CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
              EXPORTING
                INPUT              = GI_FINAL-MATNR
                IMPORTING
               OUTPUT             = GI_FINAL-MATNR
             EXCEPTIONS
               LENGTH_ERROR       = 1
               OTHERS             = 2
            IF SY-SUBRC <> 0.
            ENDIF.
            OBJECTID = GI_FINAL-MATNR ."to ensure that objid is in proper
    *format
            SELECT *
                   FROM CDPOS
                   INTO TABLE GI_CDPOS
              PACKAGE SIZE 100
              FOR ALL ENTRIES IN GI_cdhdr
                   WHERE OBJECTID = OBJECTID
                     AND CHANGENR = GI_CDHDR-CHANGENR
                     AND OBJECTCLAS = OBJECTCLAS
                     AND CHNGIND =  CHANGE_IND." only those values will b
    *takn which have been modified nd nt created
            IF SY-SUBRC = 0.
              LOOP AT GI_CDPOS.
          MOVE GI_MARC-MATNR TO GI_FINAL-MATNR.
          MOVE GI_MARC-DISPO TO GI_FINAL-DISPO.
          MOVE GI_CDHDR-USERNAME TO GI_FINAL-USERNAME.
          MOVE GI_CDHDR-UDATE TO GI_FINAL-UDATE.
          MOVE GI_CDHDR-TCODE TO GI_FINAL-TCODE.
          MOVE GI_CDHDR-CHANGENR TO GI_FINAL-CHANGENR.
                MOVE GI_CDPOS-TABNAME TO GI_FINAL-TABNAME.
                MOVE GI_CDPOS-TABKEY TO GI_FINAL-TABKEY.
                MOVE GI_CDPOS-FNAME TO GI_FINAL-FNAME.
                MOVE GI_CDPOS-VALUE_NEW TO GI_FINAL-VALUE_NEW.
                MOVE GI_CDPOS-VALUE_OLD TO GI_FINAL-VALUE_OLD.
                  APPEND GI_FINAL.
                  CLEAR GI_FINAL.
               ENDIF.
                VAR = VAR + 1.
       ENDSELECT.
              ENDLOOP.
            ENDIF.
          ENDLOOP.
              CALL FUNCTION 'ARCH_ANA_PROGRESS_INDICATOR'
             EXPORTING
                  TEXT = 'Processing'.
        ENDIF.
      ENDLOOP.
      endform.
    form f_fieldcat_init using lt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv.
       clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'MATNR'.
      ls_fieldcat-seltext_l    = 'Material number'.
    ls_fieldcat-tabname      = 'GI_final'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'DISPO'.
      ls_fieldcat-seltext_l    = 'mrp controller'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'USERNAME'.
      ls_fieldcat-seltext_l    = 'Username'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'CHANGENR'.
      ls_fieldcat-seltext_l    = 'Change Number'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'UDATE'.
      ls_fieldcat-seltext_l    = 'modified date'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'UTIME'.
      ls_fieldcat-seltext_l    = 'MODIFIED TIME'.
      append ls_fieldcat to lt_fieldcat.
    clear ls_fieldcat.
    ls_fieldcat-fieldname    = 'UDATE'.
    ls_fieldcat-seltext_l    = 'MODIFIED DATE'.
    append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TCODE'.
      ls_fieldcat-seltext_l    = 'TRANSACTION CODE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TABNAME'.
      ls_fieldcat-seltext_l    = 'TABLE NAME'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'TABKEY'.
      ls_fieldcat-seltext_l    = 'TABLE KEY'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'FNAME'.
      ls_fieldcat-seltext_l    = 'FNAME'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'FVALUE'.
      ls_fieldcat-seltext_l    = 'FVALUE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'VALUE_NEW'.
      ls_fieldcat-seltext_l    = 'NEW VALUE'.
      append ls_fieldcat to lt_fieldcat.
      clear ls_fieldcat.
      ls_fieldcat-fieldname    = 'VALUE_OLD'.
      ls_fieldcat-seltext_l    = 'OLD VALUE'.
      append ls_fieldcat to lt_fieldcat.
    endform.                    " f_fieldcat_init
    form alv_display tables  gi_final using gt_fieldcat .
      call function 'REUSE_ALV_LIST_DISPLAY'
       exporting
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = ' Material list '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
         is_layout                      = gs_layout
         it_fieldcat                    = gt_fieldcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        tables
          t_outtab                       = gi_final
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.
    regards
    siva

  • Different Schemas in different environments for same tables used in a Universe

    Hi,
    I have a Universe in Development where I have tables pointed to a schema (DW) in DEV but in TEST/INT I have the same tables under a different schema (TESTDW). So when I promote the Universe & reports from DEV to TEST, I will be getting errors as the schema is incorrect. So we need to find a way so that we can define the schema globally instead of having it at the individual table.
    I know we can repoint the schemas, etc but i need to avoid extra work in other environments.
    Known Solutions: Promote the reports to TEST, then select all the tables & change the schema by Right Clicking the selected tables and selecting Change Qualifier/Owner.
    One of the few reasons, I don't want to follow this route, because I have lot of derived tables which I need to change it manually by editing the SQL Statement,  &  also If I add new tables or columns again in future & promote them to TEST, then again I have to change the schema.
    Did anyone faced this kind of issue?Is there any other way that we can use like Begin_Sql , etc?
    (FYI, I am using BO4.0 SP5)

    Mark, Thanks a lot for your concern. We actually have same schema name across all 3 environments but there is a huge project going on in my company which is kind of hard to explain, so our team has decided to go ahead with a different names for schemas as 2 different teams will be working on paralelly on these schemas & they will combine them after a year or so. (I know this is not a solution)
    Thanks Swapnil for Synonyms solution. Your solution might have worked, if we were using BO 4.1 SP5 but unfortunately we are using BO 4.0 and in this version I can't view any synonym tables in the universe.

  • Which views/tables to use for retrieving item information

    Hi All,
    I need to write a PL/SQL procedure for retrieving detailed information for a specified item (given inventory item ID and organization ID). I'm not quite sure which views/tables to us for this.
    I found out that view MTL_SYSTEM_ITEMS_FVL is the underlying view for the Master Item Form (via help / record history menu option). But when looking up in eTRM following warning is described:
    Warning: Oracle does not recommend you query or alter data using this view. It may change dramatically in subsequent minor or major releases.
    The second view I found is MTL_SYSTEM_ITEMS_VL. But when quering for data in this view, it turned out that the view is empty.
    Can anybody tell me for what purposes this view is used?
    Is it the correct way to use one of these views (or any other?) for retrieving detailed item information or should I better define a new query within the procedure using tables such as MTL_SYSTEM_ITEMS_B, MTL_SYSTEM_ITEMS_TL and MTL_PARAMETERS (any others) ?
    Any ideas for that?
    Best Regards,
    Carolin

    Hi Carolin,
    It's usually more efficient to use base tables instead of views. The tables you will actually need will depend on your requirements. Regarding your question about MTL_SYSTEM_ITEMS_VL, it's usually ok to use the _VL views. These typically contain the same information as the base tables plus some logic to get the appropriate translations for fields that can be shown in different languages (for instance, DESCRIPTION). Typical table names you will need could be:
    Item Master: MTL_SYSTEM_ITEMS_B
    Organizations: MTL_PARAMETERS
    Subinventories: MTL_SECONDARY_INVENTORIES
    Units of Measure: MTL_UNITS_OF_MEASURE
    Onhand Quantity: MTL_ONHAND_QUANTITIES_DETAIL
    Material Transactions: MTL_MATERIAL_TRANSACTIONS
    Categories: MTL_CATEGORIES_B, MTL_CATEGORY_SETS_B, MTL_ITEM_CATEGORIES
    If your query didn't return any data, it's probably because the language was not properly setup in your session (check USERENV ('LANG') so see what's the language in your session).
    Hope it helps.

  • Create view for Global Temporary Table

    if view is create for global temporary table so exactly how it works which helps regarding application performance.
    Regaards,
    Sambit Ray

    A view is just a stored query. It can be on global temporary tables or regular one, makes no difference.

  • Performance for join 9 custom table with native SQL ?

    Hi Expert,
    I need your opinion regarding performance to join 9 tables with native sql. Recently i have to tunning some customize extraction cost  report. This report extract about 10 million cost of material everyday.
    The current program actually, try to populate the condition data and insert into customize table and join all the table to get data using native sql.
    SELECT /*+ ordered use_hash(mst,pg,rg,ps,rs,dpg,drg,dps,drs) */
                mst.werks, ....................................
    FROM
                sapsr3.zab_info mst,
                sapsr3.zab_pc pg,
                sapsr3.zab_rc rg,
                sapsr3.zab_pc ps,
                sapsr3.zab_rc rs,
                sapsr3.zab_g_pc dpg,
                sapsr3.zab_g_rc drg,
                sapsr3.zab_s_pc dps,
                sapsr3.zab_s_rc drs
            WHERE mst.zseq_no = :p_rep_run_id
            AND mst.werks = :p_werks
            AND mst.mandt = rg.mandt(+)
            AND mst.ekorg = rg.ekorg(+)
            AND mst.lifnr = rg.lifnr(+)
            AND mst.matnr = rg.matnr(+)
            ...............................................   unitl all table (9 tables)
            AND ps.mandt = dps.mandt(+)
            AND ps.knumh = dps.knumh(+)
            AND ps.zseq_no = dps.zseq_no(+)
            AND COALESCE (dps.kbetr, drs.kbetr, dpg.kbetr, drg.kbetr) <> 0
    It seems the query ask for database to using hashed table. would that be it will burden the database ? and impacted to others sap process ?
    Please advise
    Thank You and Best Regards

    you can only argue coming from measurements and that is not the case.
    Coming from the code, I see only that you do not understand it at all, so better leave it as it is. It is not a hash table, but a hash join on these table.

Maybe you are looking for

  • Which type of psu for K8d Master3 FS - please help !!!

    Hello community, unfortunately we are unable to get a K8D Matser3 FS running. We excluded problems in CPU or memory so we think the problem is the power supply. In the manual of the board in the pin-assignment on pin20 there is written "3VSB". Does t

  • Family Migration Strategy needed (from mobileme)

    My brain is about to explode. I have read countless articles about mobileme to iCloud migration, and I am NOT clear as to how to accomplish this... - I have an "AppleID" ([email protected]) that I have used for my family for countless years to purc

  • Set text of container - javascript help, please!

    I have used Dreamweaver behaviours to "Set text of container" and make different writing appear inside a box when I click a hotspot. Now I want people to be able to click on the writing that just appeared and make more text appear in another box. Cou

  • PSE 7 catalog questions

    I made an abortive attempt to upgrade from PSE 4 to PSE 7 in May. When I had difficulty converting my PSE 4 catalog and did not have time to deal with it, I de-installed PSE 7 and reverted to using PSE 4. Now, I am trying to update again and have 3 q

  • Need information to have 2 applications accessing one UCM server

    Hi, I need help to configure the second application in my UCM which has already one application connected to database and weblogic server.I have to develop another individual application which runs on different weblogic server and shares same databas