Previous week data required

Hi all,
In my query user want to compare this week data verses previous week data. How can I get data which are there in previous week.
I donu2019t have loading date in my info provider.
Please suggest.

Hi,
See the Customer Exit Code, you need have only 0CALDAY incube you can get the data.
ZCDAY = Use input Variable on 0CALDAY
ZFDFW & ZLDFW  are Customer Exit variables on 0CALDAY.
To Get the First day of First Week in given Date
WHEN 'ZFDFW'.
      DATA: zdf1 TYPE sy-datum,
            zldate TYPE sy-datum,
            zday(2) TYPE n,
            zmnth(2) TYPE n,
            zyear(4) TYPE n.
      zday(2) = '01'.
      LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
        CLEAR l_s_range.
        zmnth = loc_var_range-low+4(2).
        zyear = loc_var_range-low+0(4).
        CONCATENATE zyear zmnth zday INTO zdf1.
        l_s_range-low = zdf1.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
        CLEAR l_s_range.
      ENDLOOP.
To Get the Last day of First Week in given Date
WHEN 'ZLDFW'.
      zday(2) = '07'.
      LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
        CLEAR l_s_range.
        zmnth = loc_var_range-low+4(2).
        zyear = loc_var_range-low+0(4).
        CONCATENATE zyear zmnth zday INTO zdf1.
        l_s_range-low = zdf1.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
        CLEAR l_s_range.
      ENDLOOP.
Note: In this way you need to calcukate, here I'm dividing the month into weeks based on 7 days this is my company policy, so you need to check with your Functional team how they divides a week in a month.
Thanks
Reddy

Similar Messages

  • 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

  • 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

  • Getting previous weeks data based on parameters entered

    I am using CRXI. I have a RT that gives me the current week data but I need to be able to report on previous week data based on the paraments so if I enter dates between sunday and saturday of one week it will report on those data plus the same days of the previous week. I looked at the lastfullweek function, but not sure how to implement it in my scenerio. any ideas?
    Ralph

    That worked, thankyou. My next question along the same lines, is I am also having a third column that will indicate the percent change. for example
    Current             Previous              % Change
    97                    108
    I am trying to computer the % change between curent and previous basically it would look at previous as being the control and computer positive or negative based on what current is. I can do the math formulas, but I'm not sure what to comute to find the % change.
    Ralph

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

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

  • 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

  • Report Issue: Previous Weeks, Current Week and Next Week Values

    Hello Folks,
    this is a typical requirement...at-least typical for me..
    we have 20 weeks of data at weekly level. we have four Metrics out of which two are coming from Database and rest two are calculated metrics.
    Metric0: On Hand Qty
    Metric1: Past Qty
    Metric2: sell Qty
    Metric3: unsell qty
    Metric4: Total Qty
    the report will always be shown for 20 weeks, but depending on whats my current week, all the past weeks should be flagged as Past Week. (so i wrote a case statement for this). for Instance: I am in Week11, so my weeks in should be Past Week, Wk11, Wk12.........Wk20.
    Metric 1 is always dependent on result of Metric4 (This is the Complexity) per week basis
    Metric1 for Past weeks value in Week Column will be wk1 to wk10 On Hand Qty (fox ex: 80)
    Metric4 for Pass Weeks Value in Week Column will be Metric1 for Pastweeks + Metric2 for Past Weeks (For Ex: 20) (Past weeks mean wk1 to wk10)
    value of Metric4 is now 100
    Metric1 for Week11 Now should 100 (From Past weeks Calculation)
    Metric4 for Week11 will be Metric1 for Week11(100) + Metric2 for Week11(10) + Metric3 for Week11 (10)
    Now...Metric1 for Week12 will be 120 which is wk11 total (100+10+10) and goes on Until Week 20
    Any Ideas how to achieve this in obiee 10g
    Thanks
    Rake

    Please try out in this way....
    Database level --Create opaque view & procedure or function  to get the week total,week ago total, current week , Past week ,future week & do rpd modelling and use PIVOT VIEW.
    At answers:
    1.Here Previous week M4 is the current week M1 which means it is a cumulative value carried forward week by week.
    2. M2 & M3 are direct database columns.
    3. You have time hierarchy with WEEK Level.
    M1 - ago(rsum(m2+m3),weeklevel)
    M4- RSUM(M2+M3)
    week -AGO(RSUM(M2+M3)- M2-M3-RSUM(M2+M3)
    w1-0-10-20-30
    w2-30-11-21-62
    w3-62-12-22-96
    Now you can PIVOT IT to get in
    W1-W2-W3
    M1 0 - 30-62
    M2 10-11-12
    M3 20 -21-22
    M4 30 - 62-96
    NOW PASTWEEK (W1-W10), CURRENT WEEK(W11)-W12
    1.as you see cumulative here you need to use BINS.means ( case when week <= currentweek(maybe variable) then prior) else week)
    2. UNION - combine similar request - First cirteria week <= w11 and second criteria week > week 11 --combine pivot it. Use sum agg in fx criteria1.
    Hope this should solve your pblm at answers.
    Edited by: MK on Oct 27, 2011 12:48 PM

  • 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

  • Help needed in getting the previous Quarter Data

    Hello folks,
    I have this procedure where i have to modify the current procedure in the following manner:
    I need to get rid of the variables p_start and p_end so that i cannot see them in the crystal report and include the Frequency in the procedure to get the Data based on the Dates.
    and Main requirement is" If the Frequency is Quarterly " it should get the previous quarter Data, if "Frequency is monthly" it should return the previous month data.Can anyone please let me know where shud i make changes. Am including the procedure for refernce. Any help is appreciated
    Thanks a millioin,
    CREATE OR REPLACE PROCEDURE hcsc_recovery_report_h(report_record in out cr_return_types.gen_cursor,
    p_start       string,
    p_end         string)
    IS
    v_startdate date;
    v_enddate date;
    BEGIN
    v_startdate := to_date(p_start, 'YYYY/MM');
    v_enddate := last_day(to_date(p_end, 'YYYY/MM'));
    open report_record for
    select --distinct r.recovery_id
    r.event_id,
    r.event_case_id,
    c.client_id,
    c.client_code,
    c.client_name,
    b.branch_group_code,
    b.branch_group_description,
    g.employer_group_code,
    g.employer_group_name,
    e.client_policy_identifier,
    e.date_of_incident,
    e.event_type_code,
    sum(nvl(r.amount, 0)) as amt_received,
    nvl(sum(case
    when r.amount >= 0 then
    rd.fees
    else
    rd.fees * (-1)
    end),
    0) as fees,
    ec.close_date, *001* commented
    (case
    when ec.close_date <= to_date(to_char(v_enddate, 'MMDDRRRR') || '235959',
    'MMDDRRRR HH24MISS') then
    ec.close_date
    else
    null
    end) as close_date, --*001*  added
    get_case_value(ec.event_id, ec.event_case_id, v_enddate) as case_value,
    nvl(etl.fee_percent_flag, 'N') workmans_comp,
    max(to_char(r.recovery_date, 'FMMonthYYYY')) Year_Month,
    max(to_char(r.recovery_date, 'YYYYMM')) Y_M,
    max(to_date(to_char(r.recovery_date, 'MMYYYY'), 'MM/YYYY')) date_MY
    from recovery r,
    recovery_detail rd,
    event e,
    client c,
    branch_group b,
    employer_group g,
    event_case ec,
    event_type_lookup etl
    where r.event_id = e.event_id
    and r.event_case_id = ec.event_case_id
    and ec.event_id = e.event_id
    and rd.recovery_id(+) = r.recovery_id
    and r.recovery_date between v_startdate and
    to_date(to_char(v_enddate, 'MMDDRRRR') || '235959',
    'MMDDRRRR HH24MISS')
    and e.client_id = c.client_id
    and g.client_id = c.client_id
    and b.client_id = c.client_id
    and g.employer_group_id(+) = e.employer_group_id
    and b.branch_group_id(+) = g.branch_group_id
    and e.event_type_code = etl.event_type_code -- SST 130852 04/14/09
    group by r.event_id,
    r.event_case_id,
    c.client_id,
    c.client_code,
    c.client_name,
    b.branch_group_code,
    b.branch_group_description,
    g.employer_group_code,
    g.employer_group_name,
    e.client_policy_identifier,
    e.date_of_incident,
    e.event_type_code,
    ec.close_date,
    get_case_value(ec.event_id, ec.event_case_id, v_enddate),
    nvl(etl.fee_percent_flag, 'N')
    having sum(nvl(r.amount, 0)) <> 0
    order by c.client_code,
    b.branch_group_code,
    g.employer_group_code,
    r.event_case_id;
    Edited by: user11961230 on Oct 20, 2009 9:02 AM

    user11961230 wrote:
    1. I want to get rid of the p_start and p_end. So how do i declare the v_startdate and v_enddate in the following part?
    v_startdate := to_date(p_start, 'YYYY/MM');
    v_enddate := last_day(to_date(p_end, 'YYYY/MM'));I'm not sure what you mean by "declare".
    In PL/SQL, "declare" means state (at the beginning of a block) that there will be a certain variable with a certain name (such as v_startdate) and datatype (such as DATE). You're already declaring the variables v_startdate and v_enddate correctly, right before the BEGIN statement.
    Declaring a variable is not the same as initializing it, that is, giving it a value for the first time. Your next question seems to be about initializing..
    2. where exactly shud i include the logic that u have mentioned. sorry a dumb questionIn place of the two assignment statments that reference p_start and p_end.
    3. This time am gonna use frequency instead of report_type so that i will get rid of the p_start and p_end from the procedure.Do you mean you want to pass an argument (called frequency) that tells if you want a quarterly or a mionthly report, just like the variable report_type in my example?
    If so, replace report_type in my example with frequency.
    I think you want something like this:
    CREATE OR REPLACE PROCEDURE hcsc_recovery_report_h
    (      report_record         in out     cr_return_types.gen_cursor
    ,      frequency         IN           VARCHAR2
    IS
         -- Declare local variables:
         v_startdate     date;
         v_enddate      date;
    BEGIN
         -- Initialize v_startdate and v_enddate, depending on frequency
         IF  frequency = 'QUARTERLY'
         THEN
              v_startdate := TRUNC ( ADD_MONTHS (SYSDATE, -3)
                                           , 'Q'
              v_enddate := TRUNC (SYSDATE, 'Q');
         ELSIF  frequency = 'MONTHLY'
         THEN
              v_startdate := TRUNC ( ADD_MONTHS (SYSDATE, -1)
                             , 'MM'
              v_enddate := TRUNC (SYSDATE, 'MM');
         END IF;
         --   Subtract one second from v_enddate
              v_enddate := v_enddate - ( 1
                                            / (24 * 60 * 60)
         open report_record for
         select --distinct r.recovery_id
                r.event_id,
         and     r.recovery_date  BETWEEN  v_startdate     
                         AND       v_enddate
         ...When you post formatted text on this site (and code should always be formatted), type these 6 characters:
    (small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
    Edited by: Frank Kulash on Oct 20, 2009 2:37 PM
    Changed query to use BETWEEN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sharepoint 2007 - Creating a form to capture timesheets data, but need to track updates to previously submitted data

    Hi,
    We are using a basic version of Sharepoint 2007 and do not have access to InfoPath. I have created a list to allow team members to submit their weekly time on specific activities.  How do I go about tracking any changes to previously submitted data?
    For instance, a team member enters 5 hours for Activity 1 and submits on April 1.  on April 10 they realize they submitted too few hours and want to go in to edit the 5 hours to 12 hours.
    From a reporting perspective we already pulled a report (export to excel) and have the 5 hours listed for April 1. If the user goes in to edit their time sheet from April 1, we don't want the data to just override the 5 hours, we want some sort of flag to
    show the hours went from 5 to 12 hours.  How do we do this?
    As a work around, I added a question at the beginning of the survey/list asking is this a new submission or an edit. I thought if they select edit and were taken to a screen that allowed them to select the date (April 1), the activity and the new hours that
    I would have all of the previous data plus these 3 columns with the additional data: "Edit", "Activity 1", "12".  Instead the original data was over written and all I show are blanks for the previous questions and the edited
    info ("Edit", "Activity 1", "12").
    What suggestions do you have so that I can maintain the integrity of the original data and flag for my Project Manager which data needs to be changed in previous reports.
    Thanks in advance!
    AA

    I think the best way to answer your question would be to create a simple form and try various submissions. Be aware that unless the e-mail system is controlled, e-mail submission is not recommended due to client configuration issues of e-mail. Your question sounds like online submission would already be something you are comfortable with. In that case you can submit form data in 3 different ways: HTML, FDF, or XML. It can also be submitted as a PDF by saving the form, but that does not sound like what you need and also gets into issues of whether folks are using Reader or Acrobat.
    Also be careful (or try both) about using forms from within Acrobat and the forms created by the link in Acrobat to Designer. Once you go to Designer with the form you can not come back for editing in Acrobat. Normally you would create the basic form in a word processor or layout tool and then add the form fields in Acrobat (or Designer if that is preferred).
    I will let others address the anonymous and yet confirmation check issue.

  • Is it possible to post the Excise invoice previous month date.

    Dear All,
    We want to post a excise invoice with previous month date. Is that possible?
    We have created a billing document (VF01) last month (October) and not created Excise Invoice (J1IIN).
    Now our finance people requirement is to create the excise invoice with last month date.
    Kindly let me know whether it is possible.
    Regards,
    Mullairaja

    Yes quite possible provided your FI period is still open.  Once you execute J1IIN and clicked the tab "Billing", you can see a field Posting Date where you maintain the billing document date itself if FI period is open.
    But from excise point of view, this is wrong due to the fact that excise returns should be submitted on or before 3rd of every month in which case, the excise team would have submitted the returns for October.
    thanks
    G. Lakshmipathi

  • How to get previous month data from current month values

    Hi Experts,
    I have made one universe from BW Query in which Fiscal year period is entered in interval.
    I have made a universe from that and want to develop webI reports on top of that.
    In my webI reports, i have used one cross tab. In Rows section i have added Company Code and in Column section i have used Fiscal Year/Period and in Value section i have added Sales Value. I want this value of previous month.
    Requirement:
    Ex.
                            Feb'09          Mar'09     and so on...
    Comp_code1   Sales of Jan'09         Sales of Feb'0f         and so on....
    I am getting this.
    Ex.
                            Feb'09          Mar'09     and so on...
    Comp_code1   Sales of Feb'09         Sales of Mar'09         and so on....
    I hope i have clear my requirements.
    Please help as soon as possible.
    Thanks in Advance,
    Rishit

    Hi Rishit,
    Follow the below steps to get the desired result.
    Step1: Convert your fiscal year period from char to a date in your database or in your designer however its feasible.
    to_date('substr('009.2009',2)','mm.yyyy')
    you will get the result 01 sep 2009
    Step2: Convert this format to 01/09/2009 by using date functions.
    Step3: Create a Detail associated to the 'date' field (typically your fiscal period).
    Step4: Create a cross tab Like : Rows section should have Company Code and in Column section should have 'date'(created detail) and in Value section should be Sales Value.
    you should get the following result.
    01/02/2009 01/03/2009 and so on...
    Comp_code1 Sales of Feb'09 Sales of Mar'09 and so on....
    Step5: Use the following formula in your Column (date) formula bar.
    =(<date>-1)-DayNumberOfMonth(<date>-1)+1
    You will get the following result:
    01/01/2009 01/02/2009 and so on...
    Comp_code1 Sales of Feb'09 Sales of Mar'09 and so on....
    Format the cell according to your reruirement.
    Let me know if you will get any break in the above steps.
    Regards,
    Swati.

  • How to show a report for 'Previous Month' Data

    Hi Gurus,
    I have a requirement, where i have to default my report to show previous month data.
    Scenario:
    My prompts by Default are set to CURRENT (current year,quarter,month). once the user logs in, the report should display data for month 'Nov' instead of 'Dec'.
    I tried using TIMESTAMPADD() in the formula , but it didn't work, though i don't see any error. Not sure if i 'm missing something.
    Is there a way to achieve this.I 'm using OBIEE 11.1.1.6.
    Any help is highly Appreciated ! Please.
    Thanks,
    Ramya

    From what you wrote I am assuming the user can manually save the report results to the Excel file.
    If your report uses ALV Grid it is possible to export the data to a spreadsheet (one of the functions available in the ALV tool bar).
    If you have used WRITE statements it is also possible to save the output as a spreadsheet (menu System -> List -> Save), but the latter will not produce as nice a spreadsheet if the data don't form a matrix. In other words, some work may be necessary in the spreadsheet afterwards before it has the format your user wants.

  • Urgent : Bill Qty based on Fisrt day of Previous week to current week

    Hi,
    I have to create a Restricted Key figure.
    Bill Qty is to be restricted on a day, which is first day of previous week.
    (1) I have restricted KF, with Current Week SAP exit variable.
    (2) Restricted KF, with Calendar Day (Variable ZDATE, customer exit type).
    (3) I have written Customer Exit in CMOD...
    data: LT_RANGE  type  RSR_S_RANGESID,
          LS_VAR_RANGE like RRRANGEEXIT.
    case i_vnam.
    when 'ZDATE'.
    if i_step = 2.
    break-point.
    loop at i_t_var_range into ls_var_range where vnam = '0CWEEK'.
    data: var1(2) type c,
          var2(4) type c,
          var3 LIKE SCAL-WEEK,
          date1 like scal-date,
          DATE2(10) TYPE C,
          MNTH(2) TYPE C,
          DAY(2) TYPE C,
          YEAR(4) TYPE C.
    var1 = ls_var_range-low(2).
    var2 = ls_var_range-low(4).
    concatenate var2 var1 into var3.
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
      EXPORTING
        WEEK               = var3
    IMPORTING
       DATE               = date1
    EXCEPTIONS
      WEEK_INVALID       = 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.
    MNTH = DATE1+4(2).
    DAY = DATE1+6(2).
    YEAR = DATE1+0(4).
    CONCATENATE DAY '/' MNTH '/' YEAR INTO DATE2.
    lt_range-low = date2.
    lt_range-high = date2.
    lt_range-sign = 'I'.
    lt_range-opt = 'eq'.
    append lt_range to e_t_range.
    endloop.
    endif.
    <b>BUT I AM GETTING ERROR -</b>
    00010004              AError for variable in customer enhancement ZDATE
    Please suggest any idea..
    Thanks
    saurabh

    Hi Saurabh,
    Please try this dample code
    WHEN 'ZDATE'.
    DATA: Z_WEEK TYPE SCAL-WEEK.
    *Determine current week from SY-DATUM
            CALL FUNCTION 'DATE_GET_WEEK'
              EXPORTING
                DATE               = SY-DATUM
              IMPORTING
                WEEK               = Z_WEEK.
    *Determine first day of current week 
            CALL FUNCTION 'WEEK_GET_FIRST_DAY'
              EXPORTING
                WEEK = Z_WEEK
              IMPORTING
                DATE = LT_RANGE-LOW.
    LT_RANGE-SIGN = 'I'.
    LT_RANGE-OPT = 'eq'.
    APPEND LT_RANGE TO E_T_RANGE.
    Regards
    Joe

Maybe you are looking for