Top Activity page on DB 11g OEM always show as one CPU.

I have my development 11g (11.2.0.4.0) database run under Oracle Linux 6.3 (2.6.39-200.24.1.el6uek.x86_64) run in VMware Workstation VM.
I have allocated 4 x vCPUs to the VM and try monitoring performance with OEM. I have found that "CPU Cores" show on "Performance" tab is 4 but show as 1 on "Top Activity" page.
Do anybody know why is different?

Responding to direct message, the result of "select * from FROM v$license;" is as below.
SESSIONS_MAX
SESSIONS_WARNING
SESSIONS_CURRENT
SESSIONS_HIGHWATER
USERS_MAX
CPU_COUNT_CURRENT
CPU_CORE_COUNT_CURRENT
CPU_SOCKET_COUNT_CURRENT
CPU_COUNT_HIGHWATER
CPU_CORE_COUNT_HIGHWATER
CPU_SOCKET_COUNT_HIGHWATER
0
0
22
43
0
4
0
0
4
0
0

Similar Messages

  • Top activity on enterprise manager

    Hi
    I am using grid control.
    When I check one of my database, I notice that there is no graph in top activity page !!!!! , the top sql and the top sessions parts are also empty. Nothing is shown...
    There was no problem before...
    Other than top activity everything is normal.
    What is the reason for this? and Any suggestion
    Oracle Database Version: 10.1.0.5.0
    Grid Control agent version: 10.2.0.1.0
    I tried restarting the agent, it didnt solve the problem..

    Check the agent status and see if the metrics XML files are pending upload.
    Check in OEM to see the status of the agent.
    Try to run "emctl clearstate agent"
    Upgrade the OEM agent to a higher version - e.g. 10.2.0.5

  • Top Activity and Monitored SQL Executions

    Hi,
    We have some issues with our batch jobs and I bumped into an issue I've seen before.
    I can see in Top Activity that there is a job running in my database and I can see the SQL through Top Activity page in GC. When I try to monitor the SQL "live" with Monitored SQL Executions I can't see any executions at all in the database.
    If I go to the session browser in TOAD I can see the process (SID) as active and I can see the current statment (the same as in Top Activity)
    So to summarize:
    Why can't I see the SQL in Monitored SQL Executions?
    Btw We run Oracle 11.2.0.2
    Regards
    Morten

    Please log an SR provide SQL Monitor Active Report for your SQL. Thanks.
    -Mughees

  • Changing customer number in alv top of page for every new customer

    hi experts,
    in alv grid display top-of- page, how to change customer number  customer name for every new customer.
    please help me.
    Regards
    Naveen.

    You may look into this blog
    http://help-abap.blogspot.com/2008/09/salv-model-5-add-header-top-of-page.html
    This is has been contributed by one of the SCN contributor Naimesh Patel.

  • How to trigger top-of-page in ALV Grid

    How to trigger Top-Of-Page in ALV Grid...
    can any one plese send the sample code...
    thanks.

    here is sample code. try this. u need to build an internal table and then call function commentary write and pass that internal table.
    *&      Form  TOP_OF_PAGE
          Top_of_page
    FORM top-of-page.                                           "#EC CALLED
    *ALV Header declarations
      DATA: lit_header TYPE slis_t_listheader,
            lwa_header TYPE slis_listheader.
    Title
      lwa_header-typ  = 'H'.
      lwa_header-info = text-013.
      APPEND lwa_header TO lit_header.
      CLEAR lwa_header.
    BOM Number
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
        EXPORTING
          input  = p_matnr
        IMPORTING
          output = gv_matnr.
    Pass BOM number
      lwa_header-typ  = 'S'.
      lwa_header-key = text-014.
      lwa_header-info = gv_matnr .
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header ,
             gv_matnr .
    BOM description
      lwa_header-typ  = 'S'.
      lwa_header-key = text-015 .
      lwa_header-info = gv_maktx .
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header.
    start/end date format MM/DD/YY
      lwa_header-typ  = 'S'.
      lwa_header-key = text-016 .
      CONCATENATE s_erdat-low+4(2) '/'
                  s_erdat-low+6(2) '/'
                  s_erdat-low(4) ' - '
                  s_erdat-high+4(2) '/'
                  s_erdat-high+6(2) '/'
                  s_erdat-high(4)
                  INTO lwa_header-info.
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header.
    Run Date of Report format MM/DD/YY
      lwa_header-typ  = 'S'.
      lwa_header-key = text-017 .
      CONCATENATE  sy-datum+4(2) '/'
                   sy-datum+6(2) '/'
                   sy-datum(4) INTO lwa_header-info .
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header.
    call function REUSE_ALV_COMMENTARY_WRITE to use TOP_OF_PAGE event.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = lit_header.
    ENDFORM .                              " FORM top-of-page.

  • This SQL statement always in Top Activity, with PX Deq Credit: send blkd

    Hi gurus,
    The following SQL statement is always among the Top Activity. I can see the details in Enerprise manager that it suffers from PX Deq Credit: send blkd
    This is the statement:
    SELECT S.Product, S.WH_CODE, S.RACK, S.BATCH, S.EXP_DATE, FLOOR(Qty_Beg) QtyBeg_B,
            ROUND(f_convert_qty(S.PRODUCT, Qty_Beg-FLOOR(Qty_Beg), P.UOM_K ), 0) QtyBeg_K,
            FLOOR(Qty_In) QtyIn_B, ROUND(f_convert_qty(S.PRODUCT, Qty_In-FLOOR(Qty_In), P.UOM_K), 0) QtyIn_K,
            FLOOR(Qty_Out) QtyOut_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Out-FLOOR(Qty_Out), P.UOM_K ), 0) QtyOut_K,
            FLOOR(Qty_Adj) QtyAdj_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Adj-FLOOR(Qty_Adj), P.UOM_K ), 0) QtyAdj_K,
            FLOOR(Qty_End) QtyEnd_B, ROUND(f_convert_qty(S.PRODUCT, Qty_End-FLOOR(Qty_End), P.UOM_K ), 0) QtyEnd_K,
            S.LOC_CODE
            FROM V_STOCK_DETAIL S
            JOIN PRODUCTS P ON P.PRODUCT = S.PRODUCT
            WHERE S.Product = :pProduct AND S.WH_CODE = :pWhCode AND S.LOC_CODE = :pLocCode;The statement is invoked by our front end (web based app) for a browse table displayed on a web page. The result can be 10 to 8000. It is used to display the current stock availability for a particular product in a particular warehouse. The stock availability it self is kept in a View : V_Stock_Detail
    These are the parameters relevant to the optimizer:
    SQL> show parameter user_dump_dest
    user_dump_dest                       string   /u01/app/oracle/admin/ITTDB/udump
    SQL> show parameter optimizer
    _optimizer_cost_based_transformation  string   OFF
    optimizer_dynamic_sampling           integer  2
    optimizer_features_enable            string   10.2.0.3
    optimizer_index_caching              integer  0
    optimizer_index_cost_adj             integer  100
    optimizer_mode                       string   ALL_ROWS
    optimizer_secure_view_merging        boolean  TRUE
    SQL> show parameter db_file_multi
    db_file_multiblock_read_count        integer  16
    SQL> show parameter db_block_size column sname format a20 column pname format a20
    db_block_size                        integer  8192Here is the output of EXPLAIN PLAN:
    SQL> explain plan for
    SELECT S.Product, S.WH_CODE, S.RACK, S.BATCH, S.EXP_DATE, FLOOR(Qty_Beg) QtyBeg_B,
        ROUND(f_convert_qty(S.PRODUCT, Qty_Beg-FLOOR(Qty_Beg), P.UOM_K ), 0) QtyBeg_K,
        FLOOR(Qty_In) QtyIn_B, ROUND(f_convert_qty(S.PRODUCT, Qty_In-FLOOR(Qty_In), P.UOM_K), 0) QtyIn_K,
        FLOOR(Qty_Out) QtyOut_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Out-FLOOR(Qty_Out), P.UOM_K ), 0) QtyOut_K,
        FLOOR(Qty_Adj) QtyAdj_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Adj-FLOOR(Qty_Adj), P.UOM_K ), 0) QtyAdj_K,
        FLOOR(Qty_End) QtyEnd_B, ROUND(f_convert_qty(S.PRODUCT, Qty_End-FLOOR(Qty_End), P.UOM_K ), 0) QtyEnd_K,
        S.LOC_CODE
        FROM V_STOCK_DETAIL S
        JOIN PRODUCTS P ON P.PRODUCT = S.PRODUCT
        WHERE S.Product = :pProduct AND S.WH_CODE = :pWhCode AND S.LOC_CODE = :pLocCode
    Explain complete.
    Elapsed: 00:00:00:31
    SQL> select * from table(dbms_xplan.display)
    PLAN_TABLE_OUTPUT
    Plan hash value: 3252950027
    | Id  | Operation                               | Name                | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ
    Distrib |
    |   0 | SELECT STATEMENT                        |                     |     1 |   169 |     6  (17)| 00:00:01 |        |      |
             |
    |   1 |  PX COORDINATOR                         |                     |       |       |            |          |        |      |
             |
    |   2 |   PX SEND QC (RANDOM)                   | :TQ10003            |     1 |   169 |     6  (17)| 00:00:01 |  Q1,03 | P->S | QC
    (RAND)  |
    |   3 |    HASH GROUP BY                        |                     |     1 |   169 |     6  (17)| 00:00:01 |  Q1,03 | PCWP |
             |
    |   4 |     PX RECEIVE                          |                     |     1 |   169 |     6  (17)| 00:00:01 |  Q1,03 | PCWP |
             |
    |   5 |      PX SEND HASH                       | :TQ10002            |     1 |   169 |     6  (17)| 00:00:01 |  Q1,02 | P->P | HA
    SH       |
    |   6 |       HASH GROUP BY                     |                     |     1 |   169 |     6  (17)| 00:00:01 |  Q1,02 | PCWP |
             |
    |   7 |        NESTED LOOPS OUTER               |                     |     1 |   169 |     5   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |   8 |         MERGE JOIN CARTESIAN            |                     |     1 |   119 |     4   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |   9 |          SORT JOIN                      |                     |       |       |            |          |  Q1,02 | PCWP |
             |
    |  10 |           NESTED LOOPS                  |                     |     1 |    49 |     4   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |  11 |            BUFFER SORT                  |                     |       |       |            |          |  Q1,02 | PCWC |
             |
    |  12 |             PX RECEIVE                  |                     |       |       |            |          |  Q1,02 | PCWP |
             |
    |  13 |              PX SEND BROADCAST          | :TQ10000            |       |       |            |          |        | S->P | BR
    OADCAST  |
    |* 14 |               INDEX RANGE SCAN          | PRODUCTS_IDX2       |     1 |    25 |     2   (0)| 00:00:01 |        |      |
             |
    |  15 |            PX BLOCK ITERATOR            |                     |     1 |    24 |     2   (0)| 00:00:01 |  Q1,02 | PCWC |
             |
    |* 16 |             MAT_VIEW ACCESS FULL        | MV_CONVERT_UOM      |     1 |    24 |     2   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |  17 |          BUFFER SORT                    |                     |     1 |    70 |     2   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |  18 |           BUFFER SORT                   |                     |       |       |            |          |  Q1,02 | PCWC |
             |
    |  19 |            PX RECEIVE                   |                     |     1 |    70 |     4   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |  20 |             PX SEND BROADCAST           | :TQ10001            |     1 |    70 |     4   (0)| 00:00:01 |        | S->P | BR
    OADCAST  |
    |* 21 |              TABLE ACCESS BY INDEX ROWID| STOCK               |     1 |    70 |     4   (0)| 00:00:01 |        |      |
             |
    |* 22 |               INDEX RANGE SCAN          | STOCK_PK            |     1 |       |     2   (0)| 00:00:01 |        |      |
             |
    |* 23 |         TABLE ACCESS BY INDEX ROWID     | MV_TRANS_STOCK      |     1 |    50 |     3   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    |* 24 |          INDEX RANGE SCAN               | MV_TRANS_STOCK_IDX1 |     1 |       |     2   (0)| 00:00:01 |  Q1,02 | PCWP |
             |
    Predicate Information (identified by operation id):
      14 - access("P"."PRODUCT"=:PPRODUCT)
      16 - filter("CON"."PRODUCT"=:PPRODUCT)
      21 - filter("STOCK"."LOC_CODE"=:PLOCCODE)
      22 - access("STOCK"."PRODUCT"=:PPRODUCT AND "STOCK"."WH_CODE"=:PWHCODE)
      23 - filter("STS"(+)='N')
      24 - access("PRODUCT"(+)=:PPRODUCT AND "WH_CODE"(+)=:PWHCODE AND "LOC_CODE"(+)=:PLOCCODE AND "RACK"(+)="STOCK"."RACK" AND
                  "BATCH"(+)="STOCK"."BATCH" AND "EXP_DATE"(+)="STOCK"."EXP_DATE")
    42 rows selected.
    Elapsed: 00:00:00:06Here is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> SELECT S.Product, S.WH_CODE, S.RACK, S.BATCH, S.EXP_DATE, FLOOR(Qty_Beg) QtyBeg_B,
        ROUND(f_convert_qty(S.PRODUCT, Qty_Beg-FLOOR(Qty_Beg), P.UOM_K ), 0) QtyBeg_K,
        FLOOR(Qty_In) QtyIn_B, ROUND(f_convert_qty(S.PRODUCT, Qty_In-FLOOR(Qty_In), P.UOM_K), 0) QtyIn_K,
        FLOOR(Qty_Out) QtyOut_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Out-FLOOR(Qty_Out), P.UOM_K ), 0) QtyOut_K,
        FLOOR(Qty_Adj) QtyAdj_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Adj-FLOOR(Qty_Adj), P.UOM_K ), 0) QtyAdj_K,
        FLOOR(Qty_End) QtyEnd_B, ROUND(f_convert_qty(S.PRODUCT, Qty_End-FLOOR(Qty_End), P.UOM_K ), 0) QtyEnd_K,
        S.LOC_CODE
        FROM V_STOCK_DETAIL S
        JOIN PRODUCTS P ON P.PRODUCT = S.PRODUCT
        WHERE S.Product = :pProduct AND S.WH_CODE = :pWhCode AND S.LOC_CODE = :pLocCode
    Execution Plan
       0      SELECT STATEMENT Optimizer Mode=ALL_ROWS   1   169   6
       1    0   PX COORDINATOR
       2    1     PX SEND QC (RANDOM) SYS.:TQ10003 1   169   6   :Q1003  P->S   QC (RANDOM)
       3    2       HASH GROUP BY   1   169   6   :Q1003  PCWP
       4    3         PX RECEIVE   1   169   6   :Q1003  PCWP
       5    4           PX SEND HASH SYS.:TQ10002 1   169   6   :Q1002  P->P   HASH
       6    5             HASH GROUP BY   1   169   6   :Q1002  PCWP
       7    6               NESTED LOOPS OUTER   1   169   5   :Q1002  PCWP
       8    7                 MERGE JOIN CARTESIAN   1   119   4   :Q1002  PCWP
       9    8                   SORT JOIN          :Q1002  PCWP
      10    9                     NESTED LOOPS   1   49   4   :Q1002  PCWP
      11   10                       BUFFER SORT          :Q1002  PCWC
      12   11                         PX RECEIVE          :Q1002  PCWP
      13   12                           PX SEND BROADCAST SYS.:TQ10000           S->P   BROADCAST
      14   13                             INDEX RANGE SCAN ITT_NEW.PRODUCTS_IDX2 1   25   2
      15   10                       PX BLOCK ITERATOR   1   24   2   :Q1002  PCWC
      16   15                         MAT_VIEW ACCESS FULL ITT_NEW.MV_CONVERT_UOM 1   24   2   :Q1002  PCWP
      17    8                   BUFFER SORT   1   70   2   :Q1002  PCWP
      18   17                     BUFFER SORT          :Q1002  PCWC
      19   18                       PX RECEIVE   1   70   4   :Q1002  PCWP
      20   19                         PX SEND BROADCAST SYS.:TQ10001 1   70   4      S->P   BROADCAST
      21   20                           TABLE ACCESS BY INDEX ROWID ITT_NEW.STOCK 1   70   4
      22   21                             INDEX RANGE SCAN ITT_NEW.STOCK_PK 1     2
      23    7                 TABLE ACCESS BY INDEX ROWID ITT_NEW.MV_TRANS_STOCK 1   50   3   :Q1002  PCWP
      24   23                   INDEX RANGE SCAN ITT_NEW.MV_TRANS_STOCK_IDX1 1     2   :Q1002  PCWP
    Statistics
            570  recursive calls
              0  physical write total IO requests
              0  physical write total multi block requests
              0  physical write total bytes
              0  physical writes direct temporary tablespace
              0  java session heap live size max
              0  java session heap object count
              0  java session heap object count max
              0  java session heap collected count
              0  java session heap collected bytes
             83  rows processed
    Elapsed: 00:00:03:24
    SQL> disconnect
    Commit complete
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining optionsThe TKPROF output for this statement looks like the following:
    TKPROF: Release 10.2.0.3.0 - Production on Thu Apr 23 12:39:29 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Trace file: ittdb_ora_9566_mytrace1.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    SELECT S.Product, S.WH_CODE, S.RACK, S.BATCH, S.EXP_DATE, FLOOR(Qty_Beg) QtyBeg_B,
        ROUND(f_convert_qty(S.PRODUCT, Qty_Beg-FLOOR(Qty_Beg), P.UOM_K ), 0) QtyBeg_K,
        FLOOR(Qty_In) QtyIn_B, ROUND(f_convert_qty(S.PRODUCT, Qty_In-FLOOR(Qty_In), P.UOM_K), 0) QtyIn_K,
        FLOOR(Qty_Out) QtyOut_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Out-FLOOR(Qty_Out), P.UOM_K ), 0) QtyOut_K,
        FLOOR(Qty_Adj) QtyAdj_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Adj-FLOOR(Qty_Adj), P.UOM_K ), 0) QtyAdj_K,
        FLOOR(Qty_End) QtyEnd_B, ROUND(f_convert_qty(S.PRODUCT, Qty_End-FLOOR(Qty_End), P.UOM_K ), 0) QtyEnd_K,
        S.LOC_CODE
        FROM V_STOCK_DETAIL S
        JOIN PRODUCTS P ON P.PRODUCT = S.PRODUCT
        WHERE S.Product = :pProduct AND S.WH_CODE = :pWhCode AND S.LOC_CODE = :pLocCode
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.04       0.12          0         10          4           0
    Fetch       43      0.05       2.02          0         73          0          83
    total       45      0.10       2.15          0         83          4          83
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 164 
    Rows     Row Source Operation
         83  PX COORDINATOR  (cr=83 pr=0 pw=0 time=2086576 us)
          0   PX SEND QC (RANDOM) :TQ10003 (cr=0 pr=0 pw=0 time=0 us)
          0    HASH GROUP BY (cr=0 pr=0 pw=0 time=0 us)
          0     PX RECEIVE  (cr=0 pr=0 pw=0 time=0 us)
          0      PX SEND HASH :TQ10002 (cr=0 pr=0 pw=0 time=0 us)
          0       HASH GROUP BY (cr=0 pr=0 pw=0 time=0 us)
          0        NESTED LOOPS OUTER (cr=0 pr=0 pw=0 time=0 us)
          0         MERGE JOIN CARTESIAN (cr=0 pr=0 pw=0 time=0 us)
          0          SORT JOIN (cr=0 pr=0 pw=0 time=0 us)
          0           NESTED LOOPS  (cr=0 pr=0 pw=0 time=0 us)
          0            BUFFER SORT (cr=0 pr=0 pw=0 time=0 us)
          0             PX RECEIVE  (cr=0 pr=0 pw=0 time=0 us)
          0              PX SEND BROADCAST :TQ10000 (cr=0 pr=0 pw=0 time=0 us)
          1               INDEX RANGE SCAN PRODUCTS_IDX2 (cr=2 pr=0 pw=0 time=62 us)(object id 135097)
          0            PX BLOCK ITERATOR (cr=0 pr=0 pw=0 time=0 us)
          0             MAT_VIEW ACCESS FULL MV_CONVERT_UOM (cr=0 pr=0 pw=0 time=0 us)
          0          BUFFER SORT (cr=0 pr=0 pw=0 time=0 us)
          0           BUFFER SORT (cr=0 pr=0 pw=0 time=0 us)
          0            PX RECEIVE  (cr=0 pr=0 pw=0 time=0 us)
          0             PX SEND BROADCAST :TQ10001 (cr=0 pr=0 pw=0 time=0 us)
         83              TABLE ACCESS BY INDEX ROWID STOCK (cr=78 pr=0 pw=0 time=1635 us)
         83               INDEX RANGE SCAN STOCK_PK (cr=4 pr=0 pw=0 time=458 us)(object id 135252)
          0         TABLE ACCESS BY INDEX ROWID MV_TRANS_STOCK (cr=0 pr=0 pw=0 time=0 us)
          0          INDEX RANGE SCAN MV_TRANS_STOCK_IDX1 (cr=0 pr=0 pw=0 time=0 us)(object id 143537)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      PX Deq: Join ACK                               17        0.00          0.00
      PX qref latch                                   2        0.00          0.00
      PX Deq Credit: send blkd                       72        1.95          2.00
      PX Deq: Parse Reply                            26        0.01          0.01
      SQL*Net message to client                      43        0.00          0.00
      PX Deq: Execute Reply                          19        0.00          0.01
      SQL*Net message from client                    43        0.00          0.04
      PX Deq: Signal ACK                             12        0.00          0.00
      enq: PS - contention                            1        0.00          0.00
    ********************************************************************************The DBMS_XPLAN.DISPLAY_CURSOR output:
    SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'))
    PLAN_TABLE_OUTPUT
    SQL_ID  402b8st7vt6ku, child number 2
    SELECT /*+ gather_plan_statistics */          S.Product, S.WH_CODE, S.RACK, S.BATCH, S.EXP_DATE, FLOOR(Qty_Beg) QtyBeg_B,
    ROUND(f_convert_qty(S.PRODUCT, Qty_Beg-FLOOR(Qty_Beg), P.UOM_K ), 0) QtyBeg_K,      FLOOR(Qty_In) QtyIn_B, ROUND(f_convert_qty(S.P
    RODUCT,
    Qty_In-FLOOR(Qty_In), P.UOM_K), 0) QtyIn_K,      FLOOR(Qty_Out) QtyOut_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Out-FLOOR(Qty_Out), P
    .UOM_K ),
    0) QtyOut_K,      FLOOR(Qty_Adj) QtyAdj_B, ROUND(f_convert_qty(S.PRODUCT, Qty_Adj-FLOOR(Qty_Adj), P.UOM_K ), 0) QtyAdj_K,
    FLOOR(Qty_End) QtyEnd_B, ROUND(f_convert_qty(S.PRODUCT, Qty_End-FLOOR(Qty_End), P.UOM_K ), 0) QtyEnd_K,      S.LOC_CODE      FROM
    V_STOCK_DETAIL S      JOIN PRODUCTS P ON P.PRODUCT = S.PRODUCT      WHERE S.Product = :pProduct AND S.WH_CODE = :pWhCode AND S.LOC
    _CODE =
    :pLocCode
    Plan hash value: 3252950027
    | Id  | Operation                               | Name                | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |
    1Mem | Used-Mem |
    |   1 |  PX COORDINATOR                         |                     |      1 |        |     83 |00:00:02.25 |      83 |       |
          |          |
    |   2 |   PX SEND QC (RANDOM)                   | :TQ10003            |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   3 |    HASH GROUP BY                        |                     |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   4 |     PX RECEIVE                          |                     |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   5 |      PX SEND HASH                       | :TQ10002            |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   6 |       HASH GROUP BY                     |                     |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   7 |        NESTED LOOPS OUTER               |                     |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   8 |         MERGE JOIN CARTESIAN            |                     |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |   9 |          SORT JOIN                      |                     |      0 |        |      0 |00:00:00.01 |       0 | 73728 |
    73728 |          |
    |  10 |           NESTED LOOPS                  |                     |      0 |      1 |      0 |00:00:00.01 |       0 |       |
          |          |
    |  11 |            BUFFER SORT                  |                     |      0 |        |      0 |00:00:00.01 |       0 | 73728 |
    73728 |          |
    |  12 |             PX RECEIVE                  |                     |      0 |        |      0 |00:00:00.01 |       0 |       |
          |          |
    |  13 |              PX SEND BROADCAST          | :TQ10000            |      0 |        |      0 |00:00:00.01 |       0 |       |
          |          |
    |* 14 |               INDEX RANGE SCAN          | PRODUCTS_IDX2       |      1 |      1 |      1 |00:00:00.01 |       2 |       |
          |          |
    |  15 |            PX BLOCK ITERATOR            |                     |      0 |      1 |      0 |00:00:00.01 |       0 |       |
          |          |
    |* 16 |             MAT_VIEW ACCESS FULL        | MV_CONVERT_UOM      |      0 |      1 |      0 |00:00:00.01 |       0 |       |
          |          |
    |  17 |          BUFFER SORT                    |                     |      0 |     21 |      0 |00:00:00.01 |       0 | 73728 |
    73728 |          |
    |  18 |           BUFFER SORT                   |                     |      0 |        |      0 |00:00:00.01 |       0 | 73728 |
    73728 |          |
    |  19 |            PX RECEIVE                   |                     |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |  20 |             PX SEND BROADCAST           | :TQ10001            |      0 |     21 |      0 |00:00:00.01 |       0 |       |
          |          |
    |* 21 |              TABLE ACCESS BY INDEX ROWID| STOCK               |      1 |     21 |     83 |00:00:00.01 |      78 |       |
          |          |
    |* 22 |               INDEX RANGE SCAN          | STOCK_PK            |      1 |     91 |     83 |00:00:00.01 |       4 |       |
          |          |
    |* 23 |         TABLE ACCESS BY INDEX ROWID     | MV_TRANS_STOCK      |      0 |      1 |      0 |00:00:00.01 |       0 |       |
          |          |
    |* 24 |          INDEX RANGE SCAN               | MV_TRANS_STOCK_IDX1 |      0 |      1 |      0 |00:00:00.01 |       0 |       |
          |          |
    Predicate Information (identified by operation id):
      14 - access("P"."PRODUCT"=:PPRODUCT)
      16 - access(:Z>=:Z AND :Z<=:Z)
           filter("CON"."PRODUCT"=:PPRODUCT)
      21 - filter("STOCK"."LOC_CODE"=:PLOCCODE)
      22 - access("STOCK"."PRODUCT"=:PPRODUCT AND "STOCK"."WH_CODE"=:PWHCODE)
      23 - filter("STS"='N')
      24 - access("PRODUCT"=:PPRODUCT AND "WH_CODE"=:PWHCODE AND "LOC_CODE"=:PLOCCODE AND "RACK"="STOCK"."RACK" AND "BATCH"="STOCK"."B
    ATCH" AND
                  "EXP_DATE"="STOCK"."EXP_DATE")
    53 rows selected.
    Elapsed: 00:00:00:12I'm looking forward for suggestions how to improve the performance of this statement.
    Thank you very much,
    xtanto

    xtanto wrote:
    Hi sir,
    How to prevent the query from doing parallel query ?
    Because as you see actually I am not issuing any Parallel hints in the query.
    Thank you,
    xtantoKristanto,
    there are a couple of points to consider:
    1. Your SQL*Plus version seems to be outdated. Please use a SQL*Plus version that corresponds to your database version. E.g. the AUTOTRACE output is odd.
    2. I would suggest to repeat your exercise using serial execution (the plan, the autotrace, the tracing). You can disable parallel queries by issuing this in your session:
    ALTER SESSION DISABLE PARALLEL QUERY;
    This way the output of the tools is much more meaningful, however you might get a different execution plan, therefore the results might not be representative for your parallel execution.
    3. The function calls might pose a problem. If they are, one possible damage limitation has been provided by hoek. Even better would be then to replace the PL/SQL function with equivalent plain SQL. However since you say that it generates not too many rows it might not harm here too much. You can check the impact of the functions by running a similar query but omitting the function calls.
    4. The parallel execution plan contains a MERGE JOIN CARTESIAN operation which could be an issue if the estimates of the optimizer are incorrect. If the serial execution still uses this operation the TKPROF and DBMS_XPLAN.DISPLAY_CURSOR output will reveal whether this is a problem or not.
    5. The execution of the statement seems to take on 2-3 seconds in your tests. Is this in the right ballpark? If yes, why should this statement then be problematic? How often does it get executed?
    6. The statement uses bind variables, so you might have executions that use different execution plans depending on the bind values passed when the statement got optimized. You can use DBMS_XPLAN.DISPLAY_CURSOR using NULL as "child_number" parameter or DBMS_XPLAN.DISPLAY_AWR (if you have a AWR license) to check if you have multiple execution plans for the statement. Please note that older versions might have already been aged out of the shared pool, so the AWR repository might be a more reliable source (but only if the statement has been sampled).
    7. You have disabled cost based transformations: "_optimizer_cost_based_transformation" = OFF. Why?
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Say subject A is on top of page 1 and subject B is on top of page 2.  As more text is added subject 2 will be pushed to page 3 eventually is there a way to always keep all Subjects on top of the page even it is pushed forward to a new page?

    Say subject A is on top of page 1 and subject B is on top of page 2. 
    As more text is added subject 2 will be pushed to page 3 eventually is there a way to always keep all Subjects always on top of the page even if they are pushed forward to new pages?

    Hi ameryfromny;
    We can place a pagebreak before the Heading or Sub-Heading manually prior to or even after creating a Table of Contents. So that the Heading or Sub-Heading is placed always on top of a page.
    To create a Table of Contents:
    Under Format panel, define paragraph text as Title, Subtitle, Heading, Heading2 ..... and so on for displaying in TOC.
    After completion of document writing, place cursor where a TOC is to be displayed.
                   Insert > Table of Contents > Document
    A table of contents generates automatically.
    Regards,

  • 2:' Top of Page' always goes to Welcome page in IE & links show as blocks

    Hi
    I created a web page for our church and added a navigation bar at the bottom of each page.
    This NavBar works fine
    Using the same method, I added 'top of page' links on the longer pages and these work fine on my mac, and on other macs, and on my work PC in Firefox.
    But when i check with Explorer , every 'top of page' link takes me back to the Welcome Page. I've relinked them at home, even made new text boxes and relinked them, but it never changes.
    I've even refreshed the Explorer page, but still I return to Welcome, from all of the different 'top of page' links.
    Any ideas how to fix this?
    The website is http://stjamesanglicanchurch.ca
    And the main culprits that I've noticed are the Stained Glass and First Church pages.
    Thank you
    Elizabeth

    Thank you for telling me this. It makes me feel better knowing that they work after all.
    Related to my other problem, I was asked what version of IE I was using on the pc, and it's probably an older one, so that could be the problem, too, or it has some sort of a kink in its system.
    Elizabeth

  • Top activity (red bar) enterprise manager

    Hi I am new to oracle 10g and performance tuning;
    When I look at the top activity from enterprise manager, I notice that one person has red bar(which is making update).The activity is around %65, and the user said that the system hangs, it takes too long to finish the operation.
    Does the red bar occurs in update statements? What can be solution

    No one reading this has even the slightest idea of what red bar on what page and how it might or might not relate to any DML statement.
    Drill down and find out what is happening for that specific user having the issue. What were they doing? What SQL statement. Does it correspond with top SQL in OEM Grid?
    Then run ADDM and Explain Plan and if you can't figure out what is happening post the SQL statement and the explain plan (created using DBMS_XPLAN) and any relevant index information and we'll take a look.

  • Top Of Page not triggering in ALV

    Hi
    I am using ALV List Disaply. I have a itab that has 2000 Rows. When i scoll down, the header appears at the top always. Now i added the following code to trigger a Top of Page Event.
    FORM xevents.
      CLEAR xs_event.
      xs_event-name = slis_ev_top_of_page.
      xs_event-form = 'XTOP_OF_PAGE'.
      APPEND xs_event TO gt_xevents.
      CLEAR xs_event.
    ENDFORM.
    FORM xtop_of_page.
    BREAK-POINT.
      WRITE: / 'X_TOP_OF_PAGE'.
    ENDFORM.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
         i_callback_program             = sy-repid
        I_CALLBACK_PF_STATUS_SET       = ' '
        I_CALLBACK_USER_COMMAND        = ' '
        I_STRUCTURE_NAME               =
         is_layout                      = st_layout
         it_fieldcat                    = fieldcat[]
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
        IT_SORT                        =
         it_filter                      = filttab[]
        IS_SEL_HIDE                    =
        I_DEFAULT                      = 'X'
        I_SAVE                         = ' '
        IS_VARIANT                     =
          it_events                      = gt_xevents
        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                       = alv_tab[]
      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.

    this  may  be help u ....
    t_gt_events type slis_t_event,
    form display_alv.
      v_repid = sy-repid.
      sort vit_final by flag vbeln .
    perform get_top_of_page using t_gt_events[].
          gs_keyinfo-header01 = 'DISPO'.
          gs_keyinfo-item01 = 'DISPO'.
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
            I_INTERFACE_CHECK        = ' '
             i_callback_program        = v_repid
            I_CALLBACK_PF_STATUS_SET = ' '
            I_CALLBACK_USER_COMMAND  = ' '
            I_STRUCTURE_NAME         =
             is_layout                = vfl_layout
             it_fieldcat               = vit_fieldcat
            IT_EXCLUDING             =
              it_special_groups       =
             it_sort                  = vit_sort
            IT_FILTER                =
            IS_SEL_HIDE              =
            I_DEFAULT                = 'X'
            I_SAVE                   = ' '
            IS_VARIANT               = ' '
             IT_EVENTS                = t_gt_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
            I_BYPASSING_BUFFER       =
            I_BUFFER_ACTIVE          =
       IMPORTING
        tables
                t_outtab               = vit_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.                      " DISPLAY_ALV
    *&      Form  get_top_of_page
          text
    -->  p1        text
    <--  p2        text
    form get_top_of_page using t_gt_events type slis_t_event.
    data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = t_gt_events.
      read table t_gt_events with key name = slis_ev_top_of_page
                               into ls_event.
      move c_formtop  to ls_event-form.
      append ls_event to t_gt_events.
    endform.                    " get_top_of_page

  • Display data on top of page and sort issue. Pls help

    Hi guys,
    I need some help. I can't seem to get the code to work. Below is my code to display the ALV. It works fine but I want it to print some top of page details according to the SORT (grouping) but the sort isn't even working?
    http://i987.photobucket.com/albums/ae354/runningandrew/2010/Other_Random/Screenshot1.jpg
    HEre is screenshot of the output
    Sales Order Number : 1100001541      
    Purchase Order Number : 4500352015   
    Distributor Number : 20061            <====
    Ship To Name : ALPHA EZZ EL ARAB CO.,
    Order Date : 29.04.2010              
    Delivery Date : 29.04.2010           
    There should be another one printing  but its not.
    Sales Order Number : 1100001542       <=====
    Purchase Order Number : 4500352015   
    Distributor Number : 20063            <=====
    Ship To Name : ALPHA EZZ EL ARAB CO.,
    Order Date : 29.04.2010              
    Delivery Date : 29.04.2010           
    My it_report structure is
    BEGIN OF t_report,
             ebeln      TYPE bapivbeln-vbeln,
             purch_no   TYPE bstnk,
             kunnr      TYPE kunnr,
             wename1    TYPE name1_gp,
             order_date TYPE edatu_vbak,
             vdate      TYPE vbak-vdatu,
             matnr      TYPE matnr,
             matnr_txt  TYPE arktx,
             qty        TYPE kwmeng,
           END OF t_report.
    Here are the sort fields
    PERFORM add_sort_key USING: 'EBELN'      'X'    'X',
                                  'PURCH_NO'   'X'    'X',
                                  'KUNNR'      'X'    'X'.
    FORM add_sort_key  USING  pv_field    TYPE any
                              pv_ascen    TYPE any
                              pv_group    TYPE any.
      it_alv_sort-fieldname = pv_field.
      it_alv_sort-up        = pv_ascen.
      it_alv_sort-group     = pv_group.
      APPEND it_alv_sort.
      CLEAR it_alv_sort.
      it_sort_new-fieldname = pv_field.
      APPEND it_sort_new.
      CLEAR it_sort_new.
    ENDFORM.                    " ADD_SORT_KEY
    Here is my display ALV part
    v_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = v_repid.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
          EXPORTING
            is_layout                  = l_alv_layout
            it_fieldcat                = it_alv_fieldcat[]
            i_tabname                  = c_it_report
            it_events                  = it_alv_events[]
            it_sort                    = it_sort_new[]
          TABLES
            t_outtab                   = it_report
    Edited by: Slow ABAPer on Apr 29, 2010 5:43 AM

    Hi,
    You should always put the code in the tags as :
    for it to be displayed as proper code.
    With Regards,
    Samreen.

  • ALV Top of Page is not displaying

    Hi,
    in this program TOP OF PAGE is displaying as empty
    * Tables
    TABLES:/irm/ipsipart.
    * Type pools
    TYPE-POOLS slis.
    * Types
    TYPES:BEGIN OF typ_ipsipart,
          depcode  TYPE /irm/ip_depcode,
          partid   TYPE /irm/ip_ktonr,
          endda    TYPE /irm/ip_pedat,
          begda    TYPE /irm/ip_pbdat,
          END OF typ_ipsipart.
    TYPES:BEGIN OF typ_pa0000,
          pernr    TYPE persno,
          endda    TYPE endda,
          begda    TYPE begda,
          massn    TYPE massn,
          massg    TYPE massg,
          stat2    TYPE stat2,
          partid   TYPE /irm/ip_ktonr,
          END OF typ_pa0000.
    TYPES:BEGIN OF typ_pa0001,
          pernr    TYPE persno,
          endda    TYPE endda,
          ename    TYPE ename,
          END OF typ_pa0001.
    TYPES:BEGIN OF typ_pernr,
          pernr    TYPE persno,
          END OF typ_pernr.
    TYPES:BEGIN OF typ_a942,
          zzpersnr TYPE persno,
          END OF typ_a942.
    TYPES:BEGIN OF typ_a943,
          zzpersnr TYPE persno,
          END OF typ_a943.
    TYPES:BEGIN OF typ_a976,
          zzpersnr TYPE persno,
          END OF typ_a976.
    TYPES:BEGIN OF typ_final,
          pernr    TYPE persno,
          ename    TYPE ename,
          begda    TYPE begda,
          statx(9) TYPE c,
          mgtxt    TYPE mgtxt,
          depcode  TYPE /irm/ip_depcode,
          begda_c  TYPE /irm/ip_pbdat,
          endda_c  TYPE /irm/ip_pedat,
          END OF typ_final.
    TYPES:BEGIN OF typ_t530t,
          massn    TYPE massn,
          massg    TYPE massg,
          mgtxt    TYPE mgtxt,
          END OF typ_t530t.
    * Internal Tables
    DATA:it_a942     TYPE TABLE OF typ_a942,
         it_a943     TYPE TABLE OF typ_a943,
         it_a976     TYPE TABLE OF typ_a976,
         it_pernr    TYPE TABLE OF typ_pernr,
         it_pa0000   TYPE TABLE OF typ_pa0000,
         it_pa0001   TYPE TABLE OF typ_pa0001,
         it_ipsipart TYPE TABLE OF typ_ipsipart,
         it_final    TYPE TABLE OF typ_final,
         it_t530t    TYPE TABLE OF typ_t530t.
    * Work areas
    DATA:wa_a942     TYPE typ_a942,
         wa_a943     TYPE typ_a943,
         wa_a976     TYPE typ_a976,
         wa_pernr    TYPE typ_pernr,
         wa_pa0000   TYPE typ_pa0000,
         wa_pa0001   TYPE typ_pa0001,
         wa_ipsipart TYPE typ_ipsipart,
         wa_final    TYPE typ_final,
         wa_t530t    TYPE typ_t530t.
    * Constants
    CONSTANTS:c_stat2 TYPE stat2 VALUE '0',
              c_statx(9) TYPE c  VALUE 'Withdrawn',
              c_endda TYPE endda VALUE '99991231',
              c_ptype TYPE /irm/ip_patype VALUE 'PE',
              c_kappl TYPE kappl VALUE 'V',
              c_ysam  TYPE kschl VALUE 'YSAM',
              c_ysdm  TYPE kschl VALUE 'YSDM',
              c_yssm  TYPE kschl VALUE 'YSSM',
              c_ysse  TYPE kschl VALUE 'YSSE',
              c_sprsl TYPE spras VALUE 'E'.
    * Variables
    DATA:v_begda TYPE begda,
         v_endda TYPE endda.
    DATA:v_variant   LIKE disvariant,
         v_save(1)   TYPE c,
         v_repid TYPE sy-repid.
    * ALV Declaraion Part
    * FIELD CATALOG DECLARATION                                        *****
    DATA:it_fcat TYPE slis_t_fieldcat_alv,
         wa_fcat TYPE slis_fieldcat_alv.
    * ALV SORT INFORMATION                                             *****
    DATA:wa_sort TYPE slis_sortinfo_alv,
         it_sort TYPE slis_t_sortinfo_alv.
    *ALV LAYOUT INFORMATION                                            *****
    DATA:wa_layout TYPE slis_layout_alv.
    *ALV TOOLBAR EXCLUDING                                             *****
    DATA:it_excluding TYPE slis_t_extab,
         wa_excluding TYPE slis_extab.
    * Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:s_pernr  FOR /irm/ipsipart-partid,
                   s_date   FOR /irm/ipsipart-begda OBLIGATORY NO-EXTENSION,
                   s_depcod FOR /irm/ipsipart-depcode.
    SELECTION-SCREEN END OF BLOCK b1.
    * At Selection Screen
    AT SELECTION-SCREEN.
      IF NOT s_date-low IS INITIAL AND s_date-high IS NOT INITIAL.
        READ TABLE s_date INDEX 1.
        v_begda = s_date-low.
        v_endda = s_date-high.
      ENDIF.
      IF s_date-low IS INITIAL AND s_date-high IS NOT INITIAL.
        READ TABLE s_date INDEX 1.
        v_begda = s_date-high.
        v_endda = s_date-high.
      ENDIF.
      IF s_date-low IS NOT INITIAL AND s_date-high IS INITIAL.
        READ TABLE s_date INDEX 1.
        v_begda = s_date-low.
        v_endda = s_date-low.
      ENDIF.
    * Start of selection
    START-OF-SELECTION.
      break vkreddy1x.
      PERFORM get_data.
      PERFORM move_data_to_finalitab.
      IF NOT it_final[] IS INITIAL.
        PERFORM field_catalog TABLES it_final
                              USING it_fcat[]
                                    wa_fcat.
        PERFORM alv_sort_info USING it_sort[]
                                    wa_sort.
        PERFORM alv_layout_build USING wa_layout.
        PERFORM alv_toolbar_excluding USING it_excluding[]
                                            wa_excluding.
        PERFORM load-variant     USING v_variant v_repid v_save.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program     = v_repid
            i_callback_top_of_page = 'TOP_OF_PAGE'
            is_layout              = wa_layout
            it_fieldcat            = it_fcat
            it_excluding           = it_excluding
            it_sort                = it_sort
            i_save                 = v_save
            is_variant             = v_variant
          TABLES
            t_outtab               = it_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.
      ELSE.
        PERFORM info_msg.
      ENDIF.
    *&      Form  GET_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_data .
      SELECT zzpersnr FROM a942 INTO TABLE it_a942 WHERE kappl  = c_kappl
                                                   AND   kschl  = c_ysdm
                                                   AND   datbi >= v_begda
                                                   AND   datab <= v_endda.
      IF sy-subrc EQ 0.
        SORT it_a942 BY zzpersnr.
        DELETE ADJACENT DUPLICATES FROM it_a942 COMPARING zzpersnr.
        LOOP AT it_a942 INTO wa_a942.
          MOVE wa_a942-zzpersnr TO wa_pernr-pernr.
          APPEND wa_pernr TO it_pernr.
          CLEAR:wa_pernr,wa_a942.
        ENDLOOP.
      ENDIF.
      SELECT zzpersnr FROM a943 INTO TABLE it_a943 WHERE kappl  = c_kappl
                                                   AND  ( kschl = c_ysam
                                                       OR kschl = c_ysse )
                                                   AND   datbi >= v_begda
                                                   AND   datab <= v_endda.
      IF sy-subrc EQ 0.
        SORT it_a943 BY zzpersnr.
        DELETE ADJACENT DUPLICATES FROM it_a943 COMPARING zzpersnr.
        LOOP AT it_a943 INTO wa_a943.
          MOVE wa_a943-zzpersnr TO wa_pernr-pernr.
          APPEND wa_pernr TO it_pernr.
          CLEAR:wa_pernr,wa_a943.
        ENDLOOP.
      ENDIF.
      SELECT zzpersnr FROM a976 INTO TABLE it_a976 WHERE kappl  = c_kappl
                                                   AND   kschl  = c_yssm
                                                   AND   datbi >= v_begda
                                                   AND   datab <= v_endda.
      IF sy-subrc EQ 0.
        SORT it_a976 BY zzpersnr.
        DELETE ADJACENT DUPLICATES FROM it_a976 COMPARING zzpersnr.
        LOOP AT it_a976 INTO wa_a976.
          MOVE wa_a976-zzpersnr TO wa_pernr-pernr.
          APPEND wa_pernr TO it_pernr.
          CLEAR:wa_pernr,wa_a976.
        ENDLOOP.
      ENDIF.
      SORT it_pernr BY pernr.
      DELETE ADJACENT DUPLICATES FROM it_pernr COMPARING pernr.
      IF NOT it_pernr[] IS INITIAL.
        SELECT pernr endda begda massn massg stat2 FROM pa0000
                                                   INTO TABLE it_pa0000
                                                   FOR ALL ENTRIES IN it_pernr
                                                   WHERE pernr = it_pernr-pernr
                                                   AND endda >= v_begda
                                                   AND begda <= v_endda
                                                   AND stat2 = c_stat2.
      ENDIF.
      LOOP AT it_pa0000 INTO wa_pa0000.
        wa_pa0000-partid = wa_pa0000-pernr.
        MODIFY TABLE it_pa0000 FROM wa_pa0000 .
      ENDLOOP.
      IF NOT it_pa0000[] IS INITIAL.
        SELECT depcode partid endda begda FROM /irm/ipsipart
                                INTO CORRESPONDING FIELDS OF TABLE it_ipsipart
                                FOR ALL ENTRIES IN it_pa0000
                                WHERE nrart = c_ptype
                                           AND partid = it_pa0000-partid
                                           AND endda >= it_pa0000-begda
                                           AND begda <= it_pa0000-endda.
        SELECT pernr ename FROM pa0001 INTO TABLE it_pa0001
                                       FOR ALL ENTRIES IN it_pa0000
                                       WHERE pernr = it_pa0000-pernr
                                       AND endda   = c_endda.
        SELECT mgtxt FROM t530t INTO TABLE it_t530t
                                FOR ALL ENTRIES IN it_pa0000
                                WHERE sprsl = c_sprsl
                                AND massn = it_pa0000-massn
                                AND massg   = it_pa0000-massg.
      ENDIF.
    ENDFORM.                    " GET_DATA
    *&      Form  MOVE_DATA_TO_ITAB
    FORM move_data_to_finalitab .
      LOOP AT it_pa0000 INTO wa_pa0000.
        MOVE wa_pa0000-pernr TO wa_final-pernr.
        MOVE wa_pa0000-begda TO wa_final-begda.
        IF wa_pa0000-stat2 = c_stat2.
          MOVE c_statx TO wa_final-statx.
        ENDIF.
        READ TABLE it_pa0001 INTO wa_pa0001 WITH KEY pernr = wa_pa0000-pernr.
        IF sy-subrc EQ 0.
          MOVE wa_pa0001-ename TO wa_final-ename.
        ENDIF.
        READ TABLE it_t530t INTO wa_t530t WITH KEY massn = wa_pa0000-massn
                                                   massg = wa_pa0000-massg.
        IF sy-subrc EQ 0.
          MOVE wa_t530t-mgtxt TO wa_final-mgtxt.
        ENDIF.
        READ TABLE it_ipsipart INTO wa_ipsipart WITH KEY
                                                   partid = wa_pa0000-partid.
        IF sy-subrc EQ 0.
          MOVE wa_ipsipart-depcode TO wa_final-depcode.
          MOVE wa_ipsipart-begda TO wa_final-begda_c.
          MOVE wa_ipsipart-endda TO wa_final-endda_c.
        ENDIF.
        APPEND wa_ipsipart TO it_ipsipart.
        CLEAR wa_ipsipart.
      ENDLOOP.
    ENDFORM.                    " MOVE_DATA_TO_ITAB
    *&      Form  FIELD_CATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM field_catalog TABLES p_it_final  LIKE it_final
                       USING  p_it_fcat   TYPE slis_t_fieldcat_alv
                              p_wa_fcat   TYPE slis_fieldcat_alv.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '1'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'PERNR'.
      p_wa_fcat-key       = 'X'.
      p_wa_fcat-seltext_l = 'Personnel Number'.
      p_wa_fcat-seltext_m = 'Personnel No.'.
      p_wa_fcat-seltext_s = 'Pers.No.'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '2'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'ENAME'.
      p_wa_fcat-key       = 'X'.
      p_wa_fcat-seltext_l = 'Employee Name'.
      p_wa_fcat-seltext_m = 'Emp Name'.
      p_wa_fcat-seltext_s = 'Name'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '3'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'BEGDA'.
      p_wa_fcat-key       = ' '.
      p_wa_fcat-seltext_l = 'Termination start date'.
      p_wa_fcat-seltext_m = 'Term start date'.
      p_wa_fcat-seltext_s = 'Term start date'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '4'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'MGTXT'.
      p_wa_fcat-seltext_l = 'Reason f.action text'.
      p_wa_fcat-seltext_m = 'Reason for action'.
      p_wa_fcat-seltext_s = 'Act.reason'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '5'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'STATX'.
      p_wa_fcat-seltext_l = 'Employment status text'.
      p_wa_fcat-seltext_m = 'Employment status'.
      p_wa_fcat-seltext_s = 'Employment status'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '6'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'DEPCODE'.
      p_wa_fcat-seltext_l = 'Deployment Code'.
      p_wa_fcat-seltext_m = 'Deployment Code'.
      p_wa_fcat-seltext_s = 'Dep. Code'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '7'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'BEGDA_C'.
      p_wa_fcat-seltext_l = 'Participation Start Date'.
      p_wa_fcat-seltext_m = 'Participation Start'.
      p_wa_fcat-seltext_s = 'Start Date'.
      APPEND p_wa_fcat TO p_it_fcat.
      CLEAR p_wa_fcat.
      p_wa_fcat-col_pos   = '8'.
      p_wa_fcat-tabname   = p_it_final.
      p_wa_fcat-fieldname = 'ENDDA_C'.
      p_wa_fcat-seltext_l = 'Participation End Date'.
      p_wa_fcat-seltext_m = 'Participation End'.
      p_wa_fcat-seltext_s = 'End Date'.
      APPEND p_wa_fcat TO p_it_fcat.
    ENDFORM.                    " FIELD_CATALOG
    *&      Form  ALV_SORT_INFO
    *       text
    *      -->P_IT_SORT[]  text
    *      -->P_WA_SORT  text
    FORM alv_sort_info  USING   p_it_sort TYPE slis_t_sortinfo_alv
                                p_wa_sort TYPE slis_sortinfo_alv .
      p_wa_sort-fieldname = 'PERNR'.
      p_wa_sort-up = 'X'.
      APPEND p_wa_sort TO p_it_sort.
    ENDFORM.                    " ALV_SORT_INFO
    *&      Form  ALV_LAYOUT_BUILD
    FORM alv_layout_build  CHANGING p_wa_layout TYPE slis_layout_alv.
      p_wa_layout-no_input          = 'X'.
      p_wa_layout-colwidth_optimize = 'X'.
    ENDFORM.                    " ALV_LAYOUT_BUILD
    *&      Form  ALV_TOOLBAR_EXCLUDING
    *       text
    FORM alv_toolbar_excluding  USING   p_it_excluding TYPE slis_t_extab
                                        p_wa_excluding TYPE slis_extab.
      p_wa_excluding-fcode = '&GRAPH'.
      APPEND p_wa_excluding TO p_it_excluding.
      p_wa_excluding-fcode = '&ABC'.
      APPEND p_wa_excluding TO p_it_excluding.
      p_wa_excluding-fcode = '%SL'.
      APPEND p_wa_excluding TO p_it_excluding.
    ENDFORM.                    " ALV_TOOLBAR_EXCLUDING
    *&      Form  LOAD-VARIANT
    FORM load-variant  USING    p_v_variant STRUCTURE disvariant
                                p_v_repid
                                p_v_save.
      CLEAR p_v_variant.
      p_v_variant-report = p_v_repid.
      p_v_save = 'A'.
    ENDFORM.                    " LOAD-VARIANT
    *&      Form  info_msg
    *       text
    FORM info_msg .
      MESSAGE i016(rp) WITH 'No Data Selected for the Selection Criteria'.
    ENDFORM.                    "info_msg
    *&      Form  top_of_page
    *       text
    FORM top_of_page.
      DATA:it_listhead TYPE slis_t_listheader.
      DATA:wa_listhead TYPE slis_listheader.
      wa_listhead-typ = 'H'.
      wa_listhead-info = 'Withdrawn Employees Still Active on Commission Plan'.
      APPEND wa_listhead TO it_listhead.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listhead.
    ENDFORM.                    "top_of_page

    Hello,
    You try in this way you will get the solution
    data:
        y_i_events     TYPE STANDARD TABLE OF slis_alv_event,
    constants:
    y_k_top_of_page TYPE slis_alv_event-name VALUE 'TOP_OF_PAGE',
    y_k_top_of_form TYPE slis_alv_event-form VALUE 'Y_F_TOP_OF_FORM'.
        PERFORM y_f_build_events CHANGING  y_i_events.
    FORM y_f_build_events  CHANGING y_li_events TYPE STANDARD TABLE.
      DATA :  y_lwa_events   TYPE slis_alv_event.
      y_lwa_events-name = y_k_top_of_page.
      y_lwa_events-form = y_k_top_of_form.
      APPEND y_lwa_events TO y_li_events.
      CLEAR y_lwa_events.
    ENDFORM.                    " y_f_BUILD_EVENTS
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = y_lv_progname
          is_layout          = y_wa_layout
          it_fieldcat        = y_i_fieldcat[]
          it_events          = y_i_events
        TABLES
          t_outtab           = y_i_error
        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.
    FORM y_f_top_of_form .
    *To display the date in dd mm yyyy formate
      CLEAR y_v_date.
      MOVE: sy-datum TO y_v_date.
      y_wa_header-typ = y_k_h.
      CONCATENATE text-h01 y_v_date+6(2)
                           y_v_date+4(2)
                           y_v_date+0(4)
                           INTO y_wa_header-info
                           SEPARATED BY space.
      APPEND y_wa_header TO y_i_listheader.
      CLEAR y_wa_header.
    *Top of page
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = y_i_listheader[].
      REFRESH y_i_listheader[].
    ENDFORM.                    " y_f_top_of_form
    Try this you we get the top-of-page.

  • Is there a way to default the monthly calendar display so that the current day always shows on top?

    Is there a way to default the monthly calendar display
    so that the current day always shows on top? ie, I want to always be able to see what's in the future 3-4 weeks, not what's in the past 3-4 weeks. The default monthly display is archaic--only allows you to see through the last day of the month. Suddenly today
    is Oct. 30th, and I have a ton of projects lined up in November, but because I haven't been scrolling down every day, I haven't been aware of them every day. I realize there are other tools in Microsoft to help me stay on task, such as reminders and such,
    but it would be helpful if I could always have the current day display on top of the monthly view so I can quickly scan what's coming up in the next few weeks. 

    Thank you!
    Right, I already have it in Month view. My question is a little more specific--I'd like for the current day to always display at the top. For example, today is Oct. 31st, so the current day is at the bottom of the calendar since it is the last day of the month.
    I can view everything in October that I've already completed. What I can't see are the future weeks because we haven't hit November yet. I'd like for the current day to always display at the top of my calendar so I can always see what's coming in the following
    three - four weeks (whether they're a part of that month or not). I've been to other forums trying to find the answer, and have come across the same exact question from frustrated users--but there seemed to be no solution. So I'm posing the question myself
    in this forum. Do you know if this is possible? What I found from other forums is that Outlook defaults to a physical 'desk' type calendar format--so just as I'd use a paper calendar at my desk, I wouldn't be able to see the following weeks unless I either
    flip the page to that month or I come to the first day of the next month, thereby tearing the the old month off and now only able to see the current month. That format is just so...paper...and archaic! Essentially I want the calendars to loop so it doesn't
    even really matter what month it is--I just always want to see what lies ahead without having to scroll down. With our being in the Technology Age, I'd assume this is a logical expectation, but we may be stuck with the replica version of the paper-desk-calendar
    format until Outlook programmers add this Technology Age feature in newer versions.  
    See, this month kind of messed me up because I have so many projects for November that start tomorrow and next week, but I haven't seen them until this week. I would have been better quipped--at least expecting them--had I been able to see all of those projects
    since last week or the week prior.  
    If there is no solution to this answer, would you know how I can contact Outlook to provide feedback? I'm guessing a newer version is on its way...
    Thanks again in advance!

  • How to display 3 alv with top-of-page using splitter container

    Hi,
    I want to display 3 different alv in a single container corresponding to the 3 check boxes on selection screen.
    i.e.
    If user selects 1 check box only one alv should be displayed, if 2 checkboxes selected by user 2 alv should be displayed and same for 3.
    I cannot use 3 different containers bcoz if second checkbox is not selected then that place remains blank. So I am using single container and using splitter container dividing it into the no of rows corresponding to the no. of checkboxs selected by user.
    Now I also want to display top-of-page for each alv. Please guide me how to achieve this.
    Thanks & regards,
    Harshada

    create with some IF_ELSE conditions as i have done below. in my case the same things are required. if error table is there only then it will be displayed, else only output will be displayed.
    * First Main Container
      CREATE OBJECT obj_main1
        EXPORTING
          container_name = 'CC_CONTAINER'
          style          = cl_gui_custom_container=>ws_maximizebox.
    * create top-document
      CREATE OBJECT obj_dyndoc_id
        EXPORTING
          style = 'ALV_GRID'.
      IF pr_view EQ c_x OR pr_stat EQ c_x.
    * First Splitter Container
        CREATE OBJECT obj_splitter1
          EXPORTING
            parent  = obj_main1
            rows    = 2
            columns = 1.
    * Place obj_parent_html in First row First column
    * for Top_of_page
        CALL METHOD obj_splitter1->get_container
          EXPORTING
            row       = 1
            column    = 1
          RECEIVING
            container = obj_parent_html.
    * Place obj_container1 in Second row First column
        CALL METHOD obj_splitter1->get_container
          EXPORTING
            row       = 2
            column    = 1
          RECEIVING
            container = obj_container1.
    * Set the height of Top of page
        CALL METHOD obj_splitter1->set_row_height
          EXPORTING
            id     = 1
            height = 24.
      ELSEIF pr_email EQ c_x.
    * First Splitter Container
        CREATE OBJECT obj_splitter1
          EXPORTING
            parent  = obj_main1
            rows    = 3
            columns = 1.
    * Place obj_parent_html in First row First column
    * for Top_of_page
        CALL METHOD obj_splitter1->get_container
          EXPORTING
            row       = 1
            column    = 1
          RECEIVING
            container = obj_parent_html.
    * Place obj_container1 in First row First column
        CALL METHOD obj_splitter1->get_container
          EXPORTING
            row       = 2
            column    = 1
          RECEIVING
            container = obj_container1.
    * Place obj_container2 in Second row First column
        CALL METHOD obj_splitter1->get_container
          EXPORTING
            row       = 3
            column    = 1
          RECEIVING
            container = obj_container2.
    * Set the height of Top of page
        CALL METHOD obj_splitter1->set_row_height
          EXPORTING
            id     = 1
            height = 24.
      ENDIF.
    Please note there is no need to create a hEADER in the container, but create it for the 1st table only which is always displayed
    ags.
    Edited by: ags on Nov 4, 2009 4:49 PM
    Edited by: ags on Nov 4, 2009 4:50 PM

  • Ooalv top-of page printing

    hi,
    i got one object in that OOALV is USED.
    in the output of OOALV Grid its displaying all selection parameter elements.
    like i have selection parameter plant,werks,batch,postind date and posting time.
    in output its displaying plant,werks and batch low and high valuesbut not posting date and time.
    can any one tell me that  its not displaying and where i have to write the code.
    they used OOALV fieldcatalog abd GRId to display data.
    Thanks and regards
    suneetha

    Hi suneetha ,
    just go through this coding where i have used top-of page in  Grid FM
    i think might be useful to you 
    TABLES:  afko,                         " Order Header
             afpo,                         " Order Item
             aufk,                         " Order Master
             resb,
             afvc,                         " Order Operation w/i an Order
             afvv,                        " Qty/Dates/values in an Operation
             crhd,                         " Work Center
             mara,                         " Material Master
             makt,                         " Material Description
             ausp,                         " Characteristic Values
             cabn,                         " Characteristic
             plpo,                         " Task list-operation/activity
             plfl.                         " Task list - sequences
    TYPE-POOLS:slis.
    DATA:check(1).
    TYPES:BEGIN OF t_afko,
          check,
          aufnr TYPE afko-aufnr,
          gltrp TYPE afko-gltrp,
          gstrp TYPE afko-gstrp,
          gamng TYPE afko-gamng,
          plnbez TYPE afko-plnbez,
          END OF t_afko.
    DATA:i_afko TYPE STANDARD TABLE OF t_afko,
         w_afko LIKE LINE OF i_afko.
    DATA:i_afko1 TYPE STANDARD TABLE OF t_afko,
         w_afko1 LIKE LINE OF i_afko1.
    DATA:ponum TYPE afko-aufnr,
         stdate TYPE afko-gltrp,
         fidate TYPE afko-gstrp,
         quanty TYPE afko-gamng,
         mater  TYPE afko-plnbez,
         descr  TYPE makt-maktx,
         index  TYPE sy-index,
         count(3) VALUE '0'.
    TYPES:BEGIN OF t_final,
          check,
          aufnr  TYPE afko-aufnr,
          gltrp  TYPE afko-gltrp,
          gstrp  TYPE afko-gstrp,
          gamng  TYPE afko-gamng,
          plnbez TYPE afko-plnbez,
          maktx  TYPE makt-maktx,
          END OF t_final.
    DATA:i_final TYPE STANDARD TABLE OF t_final,
         w_final LIKE LINE OF i_final,
         i_final1 TYPE STANDARD TABLE OF t_final,
         w_final1 LIKE LINE OF i_final1.
    TYPES:BEGIN OF t_crhd,
          objid TYPE crhd-objid,
          arbpl TYPE crhd-arbpl,
          END OF t_crhd.
    DATA:i_crhd TYPE STANDARD TABLE OF t_crhd,
         w_crhd LIKE LINE OF i_crhd.
    TYPES:BEGIN OF t_afvc,
          aufpl TYPE afvc-aufpl,
          arbid TYPE afvc-arbid,
          END OF t_afvc.
    DATA:i_afvc TYPE STANDARD TABLE OF t_afvc,
         w_afvc LIKE LINE OF i_afvc.
    TYPES:BEGIN OF t_item,
          matnr  TYPE resb-matnr,       " Component Matl Number
          maktx  TYPE makt-maktx,       " Matl Desc for Component
          bdmng  TYPE resb-bdmng,       " Component Req'd Qty
          END OF t_item.
    DATA:i_item TYPE STANDARD TABLE OF t_item,
         w_item LIKE LINE OF i_item.
    TYPES:BEGIN OF t_resb,
          matnr TYPE resb-matnr,
          bdmng TYPE resb-bdmng,
          END OF t_resb.
    DATA:i_resb TYPE STANDARD TABLE OF t_resb,
         w_resb LIKE LINE OF i_resb.
    DATA:i_makt TYPE STANDARD TABLE OF makt,
         w_makt LIKE LINE OF i_makt.
    TYPES:BEGIN OF t_aufk,
          aufnr TYPE aufk-aufnr,
          auart TYPE aufk-auart,
          werks TYPE aufk-werks,
          END OF t_aufk.
    DATA:i_aufk TYPE STANDARD TABLE OF t_aufk,
         w_aufk LIKE LINE OF i_aufk.
    DATA:***_qty TYPE co_menge VALUE 0,
         lines TYPE i,
         v_aufnr TYPE afko-aufnr.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:
    p_werks TYPE aufk-werks OBLIGATORY MEMORY ID wrk,  " PLANT
    p_auart TYPE aufk-auart OBLIGATORY,                "ORDER TYPE
    p_arbpl TYPE crhd-arbpl OBLIGATORY.                "Work center
    SELECT-OPTIONS:
    s_plnbez FOR afko-plnbez,            "material
    s_gstrp  FOR afko-gstrp OBLIGATORY,  "ORDER BASIC START DATE
    s_gltrp  FOR afko-gltrp OBLIGATORY,  "ORDER BASIC FINISH DATE
    s_gstrs  FOR afko-gstrs,             "ORDER SCHEDULE START DATE
    s_gltrs  FOR afko-gltrs.             "ORDER SCHEDULE FINISH DATE
    SELECTION-SCREEN END OF BLOCK b1.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid,
          t_heading TYPE slis_t_listheader.
    DATA: it_events TYPE slis_t_event,
          wa_events LIKE LINE OF it_events.
    CLEAR:   wa_events.
    REFRESH: it_events.
    wa_events-name = 'TOP-OF-PAGE'.
    wa_events-form = 'top-of-page'.
    APPEND wa_events TO it_events .
    CLEAR wa_events.
    DATA:lst TYPE slis_t_listheader,
         wst like line of lst.
    wst-typ = 'H'.
    wst-info = 'PRODUCTION ORDERS SELECTION'.
    APPEND wst TO lst.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM get_events.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'CHECK'.
      fieldcatalog-seltext_m   = 'SELECTION'.
      fieldcatalog-col_pos     = 1.
    fieldcatalog-outputlen   = 10.
    fieldcatalog-emphasize   = 'X'.
    fieldcatalog-key         = 'X'.
    fieldcatalog-input       = 'X'.
      fieldcatalog-edit        = 'X'.
      fieldcatalog-checkbox    = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AUFNR'.
      fieldcatalog-seltext_m   = 'PO NUMBER'.
      fieldcatalog-col_pos     = 2.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'GSTRP'.
      fieldcatalog-seltext_m   = 'BASIC START DATE'.
      fieldcatalog-col_pos     = 3.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'GLTRP'.
      fieldcatalog-seltext_m   = 'BASIC FINISH DATE'.
      fieldcatalog-col_pos     = 4.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'GAMNG'.
      fieldcatalog-seltext_m   = 'PO QUANTITY'.
      fieldcatalog-col_pos     = 5.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PLNBEZ'.
      fieldcatalog-seltext_m   = 'MATERIAL'.
      fieldcatalog-col_pos     = 6.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MAKTX'.
      fieldcatalog-seltext_m   = 'MATERIAL DESCRIPTION'.
      fieldcatalog-col_pos     = 7.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    FORM build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
               i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events                = it_events
                i_save                  = 'X'
               is_variant              = z_template
           TABLES
                t_outtab                = i_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.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT objid arbpl FROM crhd INTO TABLE i_crhd WHERE arbpl = p_arbpl.
      IF NOT i_crhd[] IS INITIAL.
        SELECT aufpl arbid
                    FROM afvc INTO TABLE i_afvc
                    FOR ALL ENTRIES IN i_crhd
                    WHERE arbid = i_crhd-objid.
      ENDIF.
      IF NOT i_afvc[] IS INITIAL.
        SELECT aufnr gltrp gstrp gamng plnbez
                 FROM  afko INTO CORRESPONDING FIELDS OF TABLE i_afko
                 FOR ALL ENTRIES IN i_afvc
                 WHERE aufpl = i_afvc-aufpl
                   AND gstrp IN s_gstrp
                   AND gltrp IN s_gltrp.
        SORT i_afko BY aufnr.
      ENDIF.
      IF NOT i_afko[] IS INITIAL.
        SELECT aufnr auart werks FROM aufk INTO TABLE i_aufk
                     FOR ALL ENTRIES IN i_afko
                       WHERE aufnr = i_afko-aufnr
                         AND auart = p_auart
                         AND werks = p_werks.
      ENDIF.
      IF NOT i_afko[] IS INITIAL.
        SELECT * FROM makt INTO TABLE i_makt
                 FOR ALL ENTRIES IN i_afko
                 WHERE matnr = i_afko-plnbez
                   AND spras = sy-langu.
        SORT i_makt BY matnr.
      ENDIF.
      LOOP AT i_aufk INTO w_aufk.
        w_final-check = check.
        READ TABLE i_afko INTO w_afko
                  WITH KEY aufnr = w_aufk-aufnr BINARY SEARCH.
        w_final-aufnr = w_afko-aufnr.
        w_final-gltrp = w_afko-gltrp.
        w_final-gstrp = w_afko-gstrp.
        w_final-gamng = w_afko-gamng.
        w_final-plnbez = w_afko-plnbez.
        READ TABLE i_makt INTO w_makt WITH KEY
                          matnr = w_afko-plnbez BINARY SEARCH.
        w_final-maktx = w_makt-maktx.
        APPEND w_final TO i_final.
        CLEAR w_final.
      ENDLOOP.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  top_of_page
          text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
      it_list_commentary = lst
    I_LOGO =
    I_END_OF_LIST_GRID =
    ENDFORM.                    " alv_top_of_page
    *&      Form  get_events
          text
    FORM get_events.
      CLEAR : wa_events, it_events[].
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events.
      READ TABLE it_events WITH KEY name = slis_ev_top_of_page
                             INTO wa_events.
      IF sy-subrc EQ 0.
        MOVE 'TOP_OF_PAGE' TO wa_events-form.
        MODIFY it_events FROM wa_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "get_events
    regards
    Naveen Khan

Maybe you are looking for