Previous Week Select Query

I need to find all records from the previous week(Sun-Sat) based on the sysdate in a select statement. Any ideas on how i could do this?
Message was edited by:
user635070

Hi,
On Saturday, May 10 "next_day(sysdate,'SUN')-14)" will be April 27, but "next_day(sysdate,'SAT')-7" will be May 10.
If you want to use NEXT_DAY, I suggest
l.allo1_dt >= TRUNC (next_day (sysdate, 'SUN')) - 14 and
l.allo1_dt <  TRUNC (next_day (sysdate, 'SUN')) -  7

Similar Messages

  • Selection variable with default value as previous weeks mon through sun

    Hi Experts,
    1.)
    I need to create a Selection Variable ZTRANS_DT ( type Interval ), with the default value as  "Previous week, Monday Through Sunday" .
    Should we have to write a customer exit to populate these interval values dynamically every time the user runs the report ?
    If so can you please write a sample ABAP code.
    2.)
    The filter restriction for the date feild ZBUSINSDT has to be set to ">=#1/1/CURRENT YEAR#" ..
    How to set current year dynamically.
    Help done would be appreciated and would be assigned points.
    Thanks,
    Santosh..

    Hello,
    I dont remember of any standard variable but still you can wait to see if any1 comes up with one.
    Or else you can try the foll:
    Create the variable as per your requirement.
    Then in CMOD, write a simple code for i_step = 1.
    logic can be l_t_range-low = sy-datum - 1.
    Regards,
    Shashank

  • Run the query with previous weeks date automatically

    Hi Guyz,
    I need to  dynamically populate the previous weeks  date value every week,
    i.e Run the query every Monday automatically, with previous weeks date value .
    Is there any SAP Exit which I can use ??
    Regards,
    Ravi
    Edited by: Ravi Srinivas on Aug 4, 2009 1:40 PM
    Edited by: Ravi Srinivas on Aug 4, 2009 1:52 PM

    Ravi,
    If you are thinking of re-running the previous week's queries automatically in the front-end, then U. Tummers is correct.  You can create new columns alongside your existing query if you so wish and use your restrictions with an offset sepending on how far back you'd like to go.
    Best,
    Philips

  • InfoView - Query Filter for date variable of previous week

    I am trying to automate the process to generate a report for the previous week's data.  Right now I just prompt the user to enter in the start & end date/times, but I would like to somehow automate the date filtering using a Query Filter.
    In particular, the report will be generated every Thursday at 12:35 PM, and it needs to filter only the date field between the date's of the previous Thursday @ 1:31 PM, and the current Thursday @ 12:30 PM.
    I know there is a way to do this using an offset or something like that, but I'm a bit of a newbie to InfoView....so any help is greatly appreciated.  Sorry if the explanation is confusing.
    Thanks so much,
    Nick

    Hi,
    You can create two objects on universe level or first database level then add in the universe based the sysdate.
    Then go to  webi  query and  replace the prompt value by these objects and from next time when ever user refresh this report will run  without any prompt.Same thing in the scheduled report.
    Thanks,
    Amit

  • Previous week Dates

    Hi all
    Please help in writing a query to get the previous week data.
    If the input date is sysdate then it should return values for previous week Monday to Sunday.
    Whatever the input it should get the value for previous week from Monday to Sunday.
    Thanks
    Jo

    IW is the formatter for the "Iso-Week"
    ISO = international standard organization
    See also: http://en.wikipedia.org/wiki/ISO_week
    Main thing is that it will always start with monday. The weeknumber might be different then for ww format. This doesn't matter in your case. But you migh want to do some experiments with to_char(sysdate,'IW'), to_char(sysdate,'WW').
    Trunc(<datevale>,'IW') will cut the date back to the first day of this iso-week.
    select to_char(sysdate-365,'IW') IW , to_char(sysdate-365,'WW') WW from dual;
    IW     WW
    37     36Edited by: Sven W. on Sep 9, 2010 2:29 PM

  • Oracle 11g :SELECT query blocked..??

    Hi Experts,
    could you please explain why the below SQL query is blocked?
    SELECT 1 FROM DUAL is blocking the SQL statement on GTTAPPUSR@gttccuatcriba04 ( SID=469 ) blocked SQL -> DELETE FROM GTTDB.PURCHASE_ENTRY_ID=:1
    SELECT 1 FROM DUAL is blocking the SQL statement on GTTAPPUSR@gttccuatcriba04 ( SID=367 ) blocked SQL -> DELETE FROM GTTDB.PURCHASE_ENTRY_ID=:1
    I am scratching my head without any solution when I had a look at the db today. Thanks in advance for your help.
    Regards,
    Boris
    Edited by: user12075620 on Dec 4, 2012 8:58 AM

    The SELECT statement is not blocking the UPDATE. As I said in the previous reply, the string that this query produces does not match the logic.
    This query is (at least on the surface) correctly identifying that session 1 is blocking session 2. Session 1 holds some lock that session 2 is waiting on. So far, so good. Since session 2 is waiting on the lock, we can easily enough see what session 2 is running (the UPDATE statement). But since session 1 is not blocked, it is potentially off running a ton of other SQL statements (or no SQL statement at all). The query is looking to see what session 1 is running currently. It has no way of determining what session 1 ran at some point in the past to acquire the lock in the first place.
    Going back to my KING example,
    At noon, session 1 runs
    UPDATE emp
       SET sal = sal * 2
    WHERE ename = 'KING'Session 1 now has a lock on the KING row in the EMP table. But session 1 neither commits nor rolls back, it is still in a transaction. Session 1 might not have any more activity for a long time-- the user might go off to lunch, for example (obviously, applications should not be designed to allow users to maintain open transactions indefinitely, but not all applications are designed correctly). Or it might start running other queries. Let's say that session 1 now runs a query that is going to go for an hour
    SELECT *
      FROM giant_view_with_lots_of_computationsNow, at 12:45, session 2 comes in and runs
    UPDATE emp
       SET bonus = 100
    WHERE ename = 'KING'Session 2 is blocked. Session 2 is running the UPDATE statement. Session 1 still holds the lock but it is running some completely unrelated SQL statement.
    If we run the query you posted, the query will correctly report that session 1 is running the query against the GIANT_VIEW_WITH_LOTS_OF_COMPUTATIONS but incorrectly imply that this SELECT query is the source of the lock. It is not. It simply happens to be the query that the session that does hold the lock happens to be executing at the current moment (why the application seems to be running a lot of queries that select a constant from dual is a separate question).
    Justin

  • How to get data for current week and previous week using customer exit in Bex.

    Hi everyone,
    I have a scenario in which I need to display data for current week and previous week (based on "sy_datum" the program has to calculate current week and previous week) in Bex using  Customer exit. I have created one variable in Bex Query Designer and I have written code for the variable in CMOD. But it is not working fine, (I know that we can do the same by using offset value in Bex). Can some one guide me how to achieve my requirement using customer exit.
    Thanks in Advance,
    G S Ramanjaneyulu.

    Hi krishna,
    Thanks for your quick reply, can you have a look at my code,
    case i_vnam.
    WHEN 'ZPWK_CWK'.
    ranges : pre_week for sy-datum.
    data : start_date type DATS,
           end_date TYPE dats .
    ************FM TO GET FIRST DATE OF CURRENT WEEK ************************
    CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
      EXPORTING
        DATE_IN  = sy-datum
      IMPORTING
        DATE_OUT = start_date.   " WEEK FIRST DATE
    end_date = START_DATE + 6.   " WEEK LAST DATE
    END_DATE   = START_DATE - 1.   " PREVIOUS WEEK END DATE
    START_DATE = START_DATE - 7.   " PREVIOUS WEEK START  DATE
    **********PREVIOUS WEEK DATES IN PRE_WEEK******************
    pre_week-SIGN   = 'I'.
    pre_week-option = 'BT'.
    pre_week-LOW    = START_DATE.
    pre_week-HIGH   = END_DATE.
    APPEND  pre_week.
    CLEAR : START_DATE,END_DATE.
    endcase.
    Regards,
    G S Ramanjaneyulu.

  • Select Query to achieve specified output (Script given)

    Hello all,
    SOURCE DATA
    Given below is the data present in the table:
    EMP_ID YEAR SAL
    10 1997 1400.00
    10 2001 1500.00
    10 2003 1600.00
    10 2004 1700.00
    10 2006 1800.00
    20 2003 2500.00
    20 2005 2800.00
    20 2006 3000.00
    REQUIREMENT
    Write a select query to return rows with consecutive years,
    if in case the year is not present for a particular employee
    then that year must be populated with the previous years's data of the same employee
    example - For the employee 10, for the years 1998, 1999, 2000 are populated
    with the data of 1997
    Pls let me know if you need any information from my end.
    Thank you.
    EMP_ID YEAR SAL
    10 1997 1400.00
    10 1998 1400.00
    10 1999 1400.00
    10 2000 1400.00
    10 2001 1500.00
    10 2002 1500.00
    10 2003 1600.00
    10 2004 1700.00
    10 2005 1700.00
    10 2006 1800.00
    20 2003 2500.00
    20 2004 2500.00
    20 2005 2800.00
    20 2006 3000.00
    SCRIPT:
    CREATE TABLE temp (
    emp_id NUMBER(4),
    year NUMBER(4),
    sal NUMBER(10,2),
    CONSTRAINT pk_temp PRIMARY KEY (emp_id, year)
    INSERT INTO temp (emp_id, year, sal) VALUES (10, 1997, 1400);
    INSERT INTO temp (emp_id, year, sal) VALUES (10, 2001, 1500);
    INSERT INTO temp (emp_id, year, sal) VALUES (10, 2003, 1600);
    INSERT INTO temp (emp_id, year, sal) VALUES (10, 2004, 1700);
    INSERT INTO temp (emp_id, year, sal) VALUES (10, 2006, 1800);
    INSERT INTO temp (emp_id, year, sal) VALUES (20, 2003, 2500);
    INSERT INTO temp (emp_id, year, sal) VALUES (20, 2005, 2800);
    INSERT INTO temp (emp_id, year, sal) VALUES (20, 2006, 3000);
    COMMIT;
    Thanks and Regards,
    Muthu
    Message was edited by:
    [email protected]

    Hi,
    What about this :
      1  select emp.emp_id, emp.year,
      2         case when temp.sal is null then (select max(sal) keep (dense_rank last order by year)
      3                                          from   temp
      4                                          where  emp.emp_id=temp.emp_id
      5                                          and    emp.year>temp.year
      6                                          and    temp.sal is not null)
      7     else temp.sal end sal
      8  from
      9  (select emp_year.emp_id, y.year
    10   from (select emp_id,
    11                min(year) min_year,
    12                max(year) max_year
    13         from temp group by emp_id) emp_year,
    14   (select min_year+rownum-1 year
    15    from (select min(year) min_year, max(year) max_year from temp)
    16    connect by level <=max_year-min_year+1) y
    17   where y.year>=emp_year.min_year
    18   and   y.year<=emp_year.max_year) emp,
    19  temp
    20  where emp.emp_id=temp.emp_id(+)
    21  and   emp.year=temp.year(+)
    22* order by 1,2
    SQL> /
        EMP_ID       YEAR        SAL
            10       1997       1400
            10       1998       1400
            10       1999       1400
            10       2000       1400
            10       2001       1500
            10       2002       1500
            10       2003       1600
            10       2004       1700
            10       2005       1700
            10       2006       1800
            20       2003       2500
            20       2004       2500
            20       2005       2800
            20       2006       3000
    14 rows selected.
    SQL> select * from temp order by 1,2;
        EMP_ID       YEAR        SAL
            10       1997       1400
            10       2001       1500
            10       2003       1600
            10       2004       1700
            10       2006       1800
            20       2003       2500
            20       2005       2800
            20       2006       3000
    8 rows selected.Nicolas.

  • How to escape the special character ' (ascii 39) in a select query?

    Hi,
    does anybody know how to escape the special character ' (ascii 39) in a select query?
    I've tried a lot of ways but nothing seems to work, for example I try to get all
    names in table foo where coloumn name contains a '-sign (ascii 39)
    select name from foo where name like '%\'%';
    select name from foo where name like '%{'}%';
    select name from atg_horse where name like '%chr(39)%'
    ... but neither works, I end up with a ORA-01756: quoted string not properly terminated
    I would apriciate any help
    /Carl-Michael

    friends
    thanks for ur time and effort that u gave to reply to my problem.
    But my main problem is that when my application (VC++ 7) fires the following query in the oracle database , it does not return any rows.
    SELECT count(*) FROM ORGANISATION WHERE UPPER(ORGANISATION.ORGANISATIONNAME)
    LIKE N'&#946;%' ORDER BY ORGANISATION.ORGANISATIONNAME
    the above question in the previous thread was just to check on sql plus as it's editor does not support unicode characters.

  • Sinlge select query in different schemas for same table(Indentical Structu)

    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.

    Thanks for the reply
    Creating an view is an option.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.
    So is there any option that would allow me to use single query on different schema's ?

  • Sinlge select query in diff schemas for same table(Indentical Structure)

    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.
    Creating an view is an option.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.
    So is there any option that would allow me to use single query on different schema's ?

    Hi,
    970773 wrote:
    Scenario :
    Table XYZ is created in Schema A
    After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
    For eg
    Schema A contains table XYZ with data of 2012 yr
    Schema B contains table XYZ with data of 2011 yr
    Table XYZ in both the schemas have identical structure.
    So can we fire a single select query to read the data from both the tables in effective way.That depends on what you mean by "effective".
    Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
    However the data resides in 2 different schema altogether.You can do a UNION, so the data from the two years appears together. The number of actual tables may make the query slower, but it won;t change the results.
    Given that you have 2 tables, the fact that they are in different schemas doesn't matter. Just make sure the user running the query has SELECT privileges on both of them.
    Creating an view is an option.Is it? You seem to say it is not, below.
    But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
    So the queries would be formed by the ORM layer and are not hand generated.
    So i cannot use view.So creating a view is not an option. Or is it?
    So is there any option that would allow me to use single query on different schema's ?Anything that you can do with a view, you can do with sub-queries. A view is merely a convenience; it just saves a sub-query, so you don't have to re-code it every time you use it. Assuming you have privilges to query the base tables, you can always avoid using a view by repeating the query that defines the view in your own query. It will not be any slower

  • High # fetches for a select query

    Following is the tkprof output. Can anybody tell why the fetches are too high and what should be done? Thanks.
    SELECT COUNT (*)
    FROM
    ACA_PI_ALLOC_CVE A WHERE A.PRGRM_INDEX = :B2 AND A.ALCTN_CODE = :B1 AND
    TRUNC (SYSDATE) BETWEEN TRUNC (A.FROM_DATE) AND TRUNC (A.TO_DATE) AND
    A.STATUS_CID = 2 AND A.OPRTNL_FLAG = 'A' AND A.FISCAL_MNTH =
    FN_FISCAL_MONTH (SYSDATE)
    call count cpu elapsed disk query current rows
    Parse 6494 0.32 0.31 0 0 0 0
    Execute 18760 1.69 1.67 0 0 0 0
    Fetch 18760 604.39 593.07 801 22993642 0 18760
    total 44014 606.40 595.05 801 22993642 0 18760
    Misses in library cache during parse: 1
    Misses in library cache during execute: 2
    Optimizer mode: ALL_ROWS
    Parsing user id: 277 (recursive depth: 1)
    Rows Row Source Operation
    5 SORT AGGREGATE (cr=2242 pr=17 pw=0 time=302663 us)
    5 TABLE ACCESS BY INDEX ROWID ACA_PI_ALLOC_CVE (cr=2242 pr=17 pw=0 time=302541 us)
    3265 INDEX RANGE SCAN TUNE_ACA_PI_ALLOC_CVE_01 (cr=30 pr=0 pw=0 time=26431 us)(object id 1331914)

    FeNiCrC_Neil wrote:
    Thanks Enrique. Is there a way to decrease the elapsed time for the fetches?I think that Mark pointed you in the right direction. Reposting what you previously posted:
    SELECT
      COUNT (*)
    FROM
      ACA_PI_ALLOC_CVE A
    WHERE
      A.PRGRM_INDEX = :B2
      AND A.ALCTN_CODE = :B1
      AND TRUNC (SYSDATE) BETWEEN TRUNC (A.FROM_DATE) AND TRUNC (A.TO_DATE)
      AND A.STATUS_CID = 2
      AND A.OPRTNL_FLAG = 'A'
      AND A.FISCAL_MNTH = FN_FISCAL_MONTH (SYSDATE);
    call     count    cpu elapsed disk    query current  rows
    Parse     6494   0.32    0.31    0        0       0     0
    Execute  18760   1.69    1.67    0        0       0     0
    Fetch    18760 604.39  593.07  801 22993642       0 18760
    total    44014 606.40  595.05  801 22993642       0 18760
    Misses in library cache during parse: 1
    Misses in library cache during execute: 2
    Optimizer mode: ALL_ROWS
    Parsing user id: 277 (recursive depth: 1)
    Rows Row Source Operation
       5 SORT AGGREGATE (cr=2242 pr=17 pw=0 time=302663 us)
       5  TABLE ACCESS BY INDEX ROWID ACA_PI_ALLOC_CVE (cr=2242 pr=17 pw=0 time=302541 us)
    3265   INDEX RANGE SCAN TUNE_ACA_PI_ALLOC_CVE_01 (cr=30 pr=0 pw=0 time=26431 us)(object id 1331914)The query, which is executed 18,760 times, is performing 22,993,642 logical IOs and is experiencing CPU limitations (606.40 CPU seconds, about 1/3 of a second per execution) due to the number of logical IOs. The execution plan that you posted is for a single execution, using a very unselective index. In this case, the unselective index returned 3,265 rows, of which only 5 survived the other restrictions specified by the WHERE clause.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Doubts in Select query

    Hai,
    I have problem in my select query,
    My previous select query:
      SELECT  rrcty 
            ryear 
            rbukrs
            rzzpspid 
            SUM( hslvt )
            SUM( hsl01 )
            SUM( hsl02 )
            SUM( hsl03 )
            SUM( hsl04 )
            SUM( hsl05 )
            SUM( hsl06 )
            SUM( hsl07 )
            SUM( hsl08 )
            SUM( hsl09 )
            SUM( hsl10 )
            SUM( hsl11 )
            SUM( hsl12 )
            SUM( mslvt )
            SUM( msl01 )
            SUM( msl02 )
            SUM( msl03 )
            SUM( msl04 )
            SUM( msl05 )
            SUM( msl06 )
            SUM( msl07 )
            SUM( msl08 )
            SUM( msl09 )
            SUM( msl10 )
            SUM( msl11 )
            SUM( msl12 )
             FROM zzsl5t
           INTO TABLE it_erbproj
             WHERE rldnr       EQ  c_rldnr        AND
                rrcty      EQ  c_rrcty        AND
                ryear       EQ  v_srr_fyear    AND
                rbukrs      EQ  v_srr_ccode    AND
                racct      EQ  v_racct        AND
                rzzpspid  IN r_zzpspid         
             GROUP BY  RRCTY ryear RBUKRS rzzpspid.
    now i want change the above select query as,
    If user enters input period 03 means,
    i have to select
    SELECT  rrcty 
            ryear 
            rbukrs
            rzzpspid 
            SUM( hslvt )
            SUM( hsl01 )
            SUM( hsl02 )
            SUM( hsl03 )
            SUM( mslvt )
            SUM( msl01 )
            SUM( msl02 )
            SUM( msl03 )
    only, not to select all the periods.
    how can i give fields dynamically.
    please suggest me.
    Elamaran

    Duplicate message. Please close this one and look at my answer Doubt in Select query.

  • Previous weeks data

    Hi all,
    I have a requirement where I need to show the Unbilled amount of this week as well as last 20 weeks based on region. Let say I am on fiscal week 20. Now if create a report based on region and Unbilled amount I will get $ 20 for europe. Now if after one week i.e FW 21 , I run the same report I get & 25 for Europe. Again let say after one more week i.e FW 22 I get $ 27 for Europe.
    Now user if run a report on FW 22. he wants areport like
    Week   Region  Unbilled
    FW20   Europe  $20
    FW21   Europe  $25
    FW22 Europe    $27
    i.e history data is required . As data is changing every day , user wants to see previous 20 weeks data.
    Now I am using a Zcube built on standard extarctor 0FI_GL_4. i dont have loading date or system date.
    Please suggest what to do
    Regards,
    Sunny

    Hi.
    If your object fiscal week restricted by variable you should do the next:
    1. create 20 calculated KF each one restricted with this variable with appropriate offset (lets say previous week wth vriable and offset -1, 2 weeks ago with variable and offset -2 ...)
    2. create another calculated KF with variable without offset to represent user selection week.
    So at the end you will see one KF with current week and 20 another KF with 20 previous weeks.
    Regards.

  • Performance of  Select query

    Hi All,
    I am using select stmt on MARA and ZTSDNETPR.
    In ZTSDNETPR table,  pltyp,konda,MATNR,DATAB,DATBI are indexes in same order as i am using in my select stmt.
    But it is taking 1 hrs 45 min to take execute. Please give me any suggestion.
    SELECT  MATNR MTART MATKL ZPLINE ZREL ZLANG ZUSG_TYPE
      ZDEPLOY ZLIC_TYPE ZSER_TYPE ZSVC_SALE_TYPE
      ZSUB_LEVEL ZSUB_REL ZASM ZREF_TYPE ZUPD_FRM
      FROM MARA
      INTO CORRESPONDING FIELDS OF  TABLE IT_MATERIAL_INFO
      WHERE MATNR IN S_MATNR
      AND   MATKL IN S_MATKL
      AND   ERSDA IN S_ERSDA.
      IF SY-SUBRC = 0.
        sort it_material_info by matnr.
    ***Fetching the price details from ZTSDNETPR table
       select pltyp konda MATNR datab datbi
       from ZTSDNETPR
       into TABLE IT_ZTSDNETPR
       for all entries in it_material_info
       where
         pltyp <> space  
         and konda <> space
         AND MATNR = it_material_info-matnr
         AND  DATAB <= sy-datum
         AND  DATBI >= sy-datum.
    Regards,
    Shiv.

    shiv,
    SELECT MATNR MTART MATKL ZPLINE ZREL ZLANG ZUSG_TYPE
    ZDEPLOY ZLIC_TYPE ZSER_TYPE ZSVC_SALE_TYPE
    ZSUB_LEVEL ZSUB_REL ZASM ZREF_TYPE ZUPD_FRM
    FROM MARA
    INTO CORRESPONDING FIELDS OF TABLE IT_MATERIAL_INFO
    <b>WHERE MATNR IN S_MATNR
    AND MATKL IN S_MATKL
    AND ERSDA IN S_ERSDA.</b>
    changed to
    SELECT MATNR MTART MATKL ZPLINE ZREL ZLANG ZUSG_TYPE
    ZDEPLOY ZLIC_TYPE ZSER_TYPE ZSVC_SALE_TYPE
    ZSUB_LEVEL ZSUB_REL ZASM ZREF_TYPE ZUPD_FRM
    FROM MARA
    INTO CORRESPONDING FIELDS OF TABLE IT_MATERIAL_INFO
    WHERE MATNR IN S_MATNR.
    loop at it_material_info.
    if ( it_material_info-matkl  not in s_matkl ) or ( it_material_info-ersda not in s_ersda )
    delete it_material_info.
    endif.
    endloop.
    In your previous query the fields given in the where clause are not primary keys.Always make it a point to use only primary keys or index in the where clause.This will enhance the performance.
    So,I had changed the select query accordingly and then filtered it w.r.t the selection-screen matkl and ersda.
    The same you apply for the ztable also.This will surely enhance the performance.
    K.Kiran.
    Message was edited by:
            Kiran K

Maybe you are looking for

  • How can I access free apps without a credit card?

    I'm trying to create an Apple ID for some elderly folks that want something as simple as checking the weather and potentially other free apps but at no point can I create an account without a credit card, an idea that's very bad for folks that are no

  • I need to restore an external backup on my macbook pro but the "command R" function isn't working at startup. What do I do now?

    I've had a bunch of things replaced on my macbook pro, which meant that the hard drive was wiped. I did a full backup on an external hard-drive but now I can't restore it. Apparently I need to press Command and R upon startup (when the grey screen ap

  • Where can I find blocks

    Hey everyone, I can not find blocks in the Labview 8.5 which i indicated in attachement view. If someone knew where are they in Labview?  Please for help Marek

  • Cracked Screen & Earphone part doesnt work

    I dont know what to do, I'm in Canada and one day at work I dropped my phone and totally messed the screen up, the touch screen still works, but the screen is cracked to ****. What do I need to do to fix this? and as you will kinda be able to see is

  • Help w/ Eye Diagrams and Mask Tests

    I could use some experienced help here So i have a scope capture of a representative signal that will be used in this VI. I have several problems which i could use some help with. 1) Trying to create an EYE diagram out of this waveform.  Because it i