Custom Exit "Previous Date" based on sy-datum

Hi!
I want to make a custom exit that I can use as a variable to get previous date based on current date (sy-datum), but I have some problems getting it to work.
Here is the code:
WHEN 'ZCPRDAY'.
    Returns the previous day for current calendar month*
    CHECK i_step = 2.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = sy-datum - 1.
      APPEND l_s_range TO e_t_range.
When a create an variable on this and use it on an infoobject, I get the message
Values for InfoObject SC_OP_DAT have a maximum length of 8 characters. The user exit for variable ZCPRDAY delivers value ", that is longer than 8 characters.
can anyone tell me what I am doing wrong here?
Thanks!

Hi  helge ovstedal,
Again type problem:
WHEN 'ZCPRDAY'.
* Returns the previous day for current calendar month
DATA: L_PREDAY TYPE SY-DATUM. " declare field with reference to sy-datum
CHECK i_step = 2.
L_PREDAY = SY-DATUM - 1.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
MOVE L_PREDAY TO l_s_range-low . "as datatypes are different, use move instead of =
APPEND l_s_range TO e_t_range.
Hope it Helps
Srini

Similar Messages

  • Variable Exit - Last Three months date range based on Sy-datum

    Hi
    I have a requirement to filter last 3months data based on sy-datum. I have a variable filter on Posting Date.
    For e.g. Today is 20110622
    I have to determine below range: When users run the report prompt should be auto filled with below date range.
    From Value: 20110301
    To Value     : 20110531
    From sy-datum I can find the first day of the current month - In this scenario 20110601 (I'll replace last 2 characters with "01").
    If I subtract "-1" I'll get the To Value: 20110531
    Question is to get the "From Value". If I subtract 90days from To value, it will work for few months.
    For e.g. If my To value is Feb 28th and if I subtract 90days, I may get a different answer.
    Is there any better approach to determine this date range?
    Thanks for your help.
    Best Regards,
    Sree

    Hi Sree,
      Pleae find this approach and compare
    data : l_date type sy-datum,
    l_startdate type sy-datum,
    l_endate type sy-datum,
    l_startmonth(6) type c,
    l_endmonth(6) type c,
    l_date = sy-datum.   say "20110622
    l_endmonth = sydatum(6)   "201106
    Pass year month and get previous month using this standard .
              CALL METHOD cl_rs_time_service=>shift_year_month
                EXPORTING
                  i_year_month = l_endmonth
                  i_shift      =  -1
                RECEIVING
                  r_year_month = l_endmonth
                EXCEPTIONS
                  failed       = 1
                  OTHERS       = 2.
    "l_endmonth = 201105.
              CALL METHOD cl_rs_time_service=>shift_year_month
                EXPORTING
                  i_year_month = l_endmonth
                  i_shift      =  -2
                RECEIVING
                  r_year_month = l_startmonth
                EXCEPTIONS
                  failed       = 1
                  OTHERS       = 2.
    "l_startmonth = 201103
    l_startdate(6) = l_startmonth.
    l_startdate+6(2) = '01'.
    "l_startdate = 20110301
    We got startdate in and we want to get enddate , but we got endmonth ...
    now we need to get last date of the endmonth.
    Use this function module SLS_MISC_GET_LAST_DAY_OF_MONTH  and u can get it. Input should be date.
    so put l_enddate+6(2) = '01'.
    l_enddate(6) = l_endmonth.
    now pass end date to the  Function module and this will return the end date of the month.
    So you get l_startdate and l_enddate as you require. This will work for leap years or feb 28 days what ever...
    Regards
    vamsi
    Edited by: vamsi talluri on Jun 22, 2011 10:06 PM

  • Currency conversion type by customer exit variable doesn't work

    Hi all.
    In my query I need amounts by quarter, applying quarters last date rates as currency conversion.
    Query has Year parameter. Based on this parameter, by customer exits I calculate every quarters last date and use them as currency conversion types.
    The problem is that query DOESN'T APPLY currency conversions!
    I checked TCURR table - currency conversions do exist for applied days
    I checked my customer exits - the date calculation works fine
    I suppose where is something wrong in query processes (customer exits/currency conversions) sequence before running it.
    Someone knows anything 'bout that?

    Check these docs.. and check again.
    [Creating Currency Translation Types|http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6813e07211d2acb80000e829fbfe/content.htm]
    [Use Variables for Currency Conversion|http://www.scribd.com/doc/7061035/How-to-Use-Variables-for-Currency-Conversion]

  • Custom Exit  help needed

    HI ,
    I have developed a custom exit , to restrict based on USER who logs in and gets detais for him from my two ODS in the report
    the code is some thing like this
    FOR I_STEP = 2 .
    select zempno from /bic/azhrpe00100 into table itab1 where /bic/zspnm = sy-uname.
    select zempno from /bic/azhrpe00100 into table itab2 where /bic/zspnm = sy-uname.
    CLEAR L_S_RANGE.
    loop at itab1 into temp_zempno1.
    L_S_RANGE-LOW = temp_zempno1.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    CLEAR L_S_RANGE.
    loop at itab2 into temp_zempno2.
    L_S_RANGE-LOW = temp_zempno2.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    EXIT.
    ENDLOOP.
    SORT E_T_RANGE.
    DELETE ADJACENT DUPLICATES FROM E_T_RANGE.
    ENDIF.
    this is my code , when i debug i can see E_T_RANGE getting the values , for the STEP 2 , but i am getting this error
    <b>Error: Error for variable in customer enhancement ZEMPLO</b>

    Hi,
    For what variable? (Remember => NOT ready for Input! and mandatory input)
    a.) encapsulate it by
    FOR I_STEP = 2.
    CASE I_VNAM.
    WHEN <Your Variable>.
    Your Coding
    endcase.
    b.) also assign a high value.
    L_S_RANGE-LOW = temp_zempno1.
    L_S_RANGE-HIGH = temp_zempno1. "as well as for zempno2.
    L_S_RANGE-SIGN = 'I'.
    hth
    cheers
    sven

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

  • Customer Exit for Calendar Month based on the day (system Date)

    Hello,
    I need help in creating a customer exit for Calendar month without the user input. The logic is as follows:
    For the BEx variable created with customer exit option and no user input:
    If the day on the system date falls in between 1 to 14 take the calendar year/month value as previous month.
    If the day on the system date falls in between 15 through 31 then take the calendar year/month as current month.
    eg if report is run on March 24th2009 the calendar year/month variable should be calculated as 03/2009 (March 2009)
    if the report is run on March 1st2009 the calendar year/month should be calculated as 02/2009 (Feb 2009).
    The code should be effective when run in the first 15 days of Jan when the previous month would contain the previous year as well.
    Thank You
    Srishti

    Thanks Shanthi. I am trying to incorporate the logic when the query is run in beginning of Jan when the year should be the previous year.Following is the code.please let me know if it would work. Is there a way I can test it as well?
    CASE I_VNAM.
    WHEN 'ZCURCALMON'.
    IF i_step = 2.
    data: mm(2),
            dd(2),
            yy(4),
            FM(6).
    if sy-datum+4(2) EQ 1.
    sy-datum(4) = sy-datum(4) - 1.
    else.
    sy-datum(4) = sy-datum(4).
    endif.
    if sy-datum+6(2) LE 15.
      mm = sy-datum+4(2) - 1.
      concatenate sy-datum(4) mm into FM.
    else.
      concatenate sy-datum(4) sy-datum+4(2)  into FM.
    endif.
    l_s_range-low = FM.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    append l_s_range to e_t_range.
    Endif.
    ENDCASE.
    Thanks
    Srishti

  • Need for customer exit code to go to previous date

    In the ODS there is a date which is a user entry on my report. I need to write a customer exit which goes to previous date.
    In other words let's say user entered 07/07/07 at the user entry, and there is no activity for the entered date. The previous activity date in ODS data is 07/05/07. The report should run based on the previous date. ( Date is the key by the way )
    I will appreciate any help with points,
    Regards,
    Mike

    I just wrote this quickly and I limited to 10 loops because something is wrong if it is further back than that and I think another solution should be done.  This is also assuming the volume of data is not too large.  If so you may want to take the year off the date and add that to the select statement.
    Can the previous date be any date?  So lets say the user entered 07/07/07 and the last activity was 01/01/07?  Is date the only key? 
    If so you can do something like this.
    date_ 1 like <date_ field in ODS>
    date_ 2 like <date_ field in ODS>
    counter(2) type n
      DATA:    BEGIN OF data_all OCCURS 0,
                 Date_ 3 like date_ 1
               END OF data_all
    date_ 1 = user enter
    counter = 10
    Select <date_ field> from <ods backend table> into data_all
    Sort ascending
    While counter > 0
       Read data all where data_all-date_3 = date_1
    If sy-subrc <> 0
      Date_ 1 = date_ 1 – 1
    Counter = counter - 1
    Continue.
    Else
    date_2 = date_1
    Exit.
    Endif
    End loop
    Return date_2

  • Customer exit Variable for Previous 12months Rolling based on 0calday

    Hi Experts,
    I am creating a Customer exit variable to derive Rolling 12 months based on calday,
    Could you please any body correct the below code,
    Or if you any body have pseudo code based on calday, could you please pass to me
      WHEN 'zcalday'.
    * Rolling 12 months to period
        IF i_step = 2.
          CLEAR: l_s_range, loc_var_range,
          LOOP AT i_t_var_range INTO loc_var_range
            WHERE vnam = 'RYEAR'.
       MOVE sy-datum TO: lv_date_from,
                                        lv_date_to.
               zmonth = lv_date_from+4(2)
           l_s_range-high = zmonth = loc_var_range-low.
            v_fiscper = v_fiscper - 12.
            l_s_range-low = v_fiscper.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'BT'.
            APPEND l_s_range TO e_t_range.
          ENDLOOP.
        ENDIF.
    Thanks and regards
    Sree

    Hi Yasemin,
    Thanks for your help,
    I have small clarification, I have following data in base cube,After restricting the customer exit variable
    on revenue I suppose I will get one Amount, i.e 7800, But If I want month wise, Do I need to create offset? or without creation of offset is there any way that will split based customer exit variable.....
    Thanks a lot
    regards
    Sree
    Execution date
    24/06/2014
    Comp Code
    Date
    Revenue
    C100
    01/07/2013
    100
    C100
    01/08/2013
    200
    C100
    01/09/2013
    300
    C100
    01/10/2013
    400
    C100
    01/11/2013
    500
    C100
    01/12/2013
    600
    C100
    01/01/2014
    700
    C100
    01/02/2014
    800
    C100
    01/03/2014
    900
    C100
    01/04/2014
    1000
    C100
    01/05/2014
    1100
    C100
    01/06/2014
    1200
    Total
    7800

  • Customer exit code for fiscalyear period based on system date

    Hi Experts,
    Please provide customer exit code for fiscalyear period derive based sy-datum. Fiscal year period derivie current to previous 12 periods and current to fast 12 periods.
    Thanks,
    Subbaraju

    Hi Subbaraju,
    Please use below customer exit code for your solution. Please define declarations as per requirement.
    When 'ZFPERIOD'.
    IF I_STEP = 2.
    ztoday = sy-datum.
    zfast = sy-datum + 365.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        i_date               =  ztoday
        i_periv              = 'K4'
    IMPORTING
       E_BUPER              = PERIOD2
       E_GJAHR              = YEAR2.
    CONCATENATE YEAR2 PERIOD2 INTO FISCPERLOW.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        i_date               =  zfast
        i_periv              = 'K4'
    IMPORTING
       E_BUPER              = PERIOD2
       E_GJAHR              = YEAR2.
    CONCATENATE YEAR2 PERIOD2 INTO FISCPERHI.
    L_S_RANGE-LOW = FISCPERLOW.
    L_S_RANGE-HIGH = FISCPERHI.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Similar code user for your previous periods also.
    Thanks,
    Chandra

  • FM to get previous sunday date based on current date(SY-DATUM)

    hi all,
    Is there any function module to get the previous sunday date based on current date(sy-datum)?
    Regards,
    Kapil Sharma

    Hi Kapil,
    You can follow the logic below:
    data:
    l_date like sy-datum, **TODAY
    l_date2 like sy-datum, **Previous Sunday
    data:
    l_daynr like HRVSCHED-DAYNR.
    *Get today's date
    l_date = sy-datum.
    *Gey today's day (Monday, Tuesday, etc.)
    CALL FUNCTION 'HRIQ_GET_DATE_DAYNAME'
    EXPORTING
    langu = 'EN'
    date = l_date
    IMPORTING
    daynr = l_daynr.
    CASE l_daynr.
    *If it is Monday
    WHEN 1.
    -Subtract 2 days for the previous Sunday
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 2
    IMPORTING
    ed_date = l_date2.
    *If it is Tuesday
    WHEN 2.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 3
    IMPORTING
    ed_date = l_date2.
    *If it is Wednesday
    WHEN 3.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 4
    IMPORTING
    ed_date = l_date2.
    *If it is Thursday
    WHEN 4.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 5
    IMPORTING
    ed_date = l_date2.
    *If it is Friday
    WHEN 5.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 6
    IMPORTING
    ed_date = l_date2.
    *If it is Saturday
    WHEN 6.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 7
    IMPORTING
    ed_date = l_date2.
    *If it is Sunday
    WHEN 7.
    CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
    EXPORTING
    id_date = l_date
    id-operator = '-'
    is_duration = 8
    IMPORTING
    ed_date = l_date2.
    ENDCASE.
    Regards,
    Dilek

  • FM to get the previous sunday date based on current date(sy-datum)

    hi all,
    Is there any function module to get the previous sunday date based on current date(sy-datum)?
    Regards,
    Kapil Sharma
    Moderator Message: Basic date related questions are not allowed
    Edited by: Suhas Saha on Sep 19, 2011 11:39 AM

    Hi,
    There are function modules to find out the current day of the week depending on sy-datum. These are as below:
    1. DATE_COMPUTE_DAY - Returns a number indicating what day of the week the date falls on. e.g. Monday is returned as a 1, Tuesday as 2,...., Sunday as 7.
    2. RH_GET_DATE_DAYNAME  - Returns the day based on the date provided, e.g. Monday, Tuesday,..., Sunday.
    Using any of the above, if you can find out the current day, then you can calculate and compute the date of the previous Sunday.
    My observation is that using the first FM might make the calculation simpler.
    Hope this is of help to you.
    Regards,
    Shayeree

  • Custom Exit to count No: of Employee based on User Input Date

    Hi There,
    I have a requirement to Count the no: of Employees for each Position Id. This count value changes with time (Time-dependent).
    So, when the user Keys-in a date at the Query Execution-Prompt, it should take the date value and then count the no: of employees for each Position Id.
    Next, it should display text  like If Count = 1    "Single"
                                                      If Count =2     "Double"
                                                      If Count >=3   "Triple"
    I was informed that we should create a Calculated Key Figure and then introduce a variable in it with Replacement path as Customer Exit.
    My Question is: Could any one provide me the logic to implement the Customer Exit for above requirement. I kow that I need to implement this is BI ABAP editor as Include file.
    Further, I referred following Forums links. However, I need more information.
    counting the number of rows.
    Customer Exit Variable Code
    Any Suggestions!
    - Anil

    Hi,
    As I understood, first thing you may not have text for a key figure (will not be able to display "Single", "Doüble" etc..)
    Are you doing reporting on master data or cube?.
    If it is a master data the it will be better to include count at staging level. You just need to include one key figure count as an attribute and assign 1 over there. You may usee this key figure directly in report.
    If it is one cube/DSO then just create one CKF assign value as 1 in report in that. Use Exception aggrigation for this CKF reffering Position id in report. Dipslay this key figure.
    I hope it will help.
    Thanks,
    S

  • Customer exit to calculate previous quarter based on user entry in 0PCALMON

    Hi,
      I have written a CMOD code to calculate previous quarter based on user entry in 0PCALMON (0CALMONTH).  That is if 09.2008 is entered for 0PCALMON, it should fetch the months 04.2008, 05.2008,06.2008.
    But unfortunately I am getting all years and all months.
    Could you please help me debug this code.
    Global Declaration :
           z_vcalmonth(2) TYPE n ,
           z_vcalyear(4) TYPE n.
    When 'YQV_LQ'.
    if i_step = 2.
    READ TABLE i_t_var_range WITH KEY
      vnam = '0PCALMON'
      iobjnm = '0CALMONTH'
      INTO l_s_var_range.
      if sy-subrc = 0.
            z_vcalmonth = l_s_var_range-low+4(2).
            z_vcalyear = l_s_var_range-low(4).
          IF ( z_vcalmonth >= 1 AND z_vcalmonth <= 3 ).
            z_vcalyear = z_vcalyear - 1.
            CONCATENATE z_vcalyear '10' INTO l_s_range-low.
            CONCATENATE z_vcalyear '12' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 4 AND z_vcalmonth <= 6 ).
            CONCATENATE z_vcalyear '01' INTO l_s_range-low.
            CONCATENATE z_vcalyear '03' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 7 AND z_vcalmonth <= 9 ).
            CONCATENATE z_vcalyear '04' INTO l_s_range-low.
            CONCATENATE z_vcalyear '06' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 10 AND z_vcalmonth <= 12 ).
            CONCATENATE z_vcalyear '07' INTO l_s_range-low.
            CONCATENATE z_vcalyear '09' INTO l_s_range-high.
          ENDIF.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'BT'.
          APPEND l_s_range TO e_t_range.
    endif.
    endif.

    Hi,
    U can use the FM SLIM_GET_QUARTERLY_PERIODS
    Pass the variable first date of 0PCALMON ( 09.2009 => '01.09.2009') to get the table of all the 4 period ranges in PERIODS  table in result
    and read the Last entry to get the Previous Quarter period
    PERIODS table
    S OP LOW        HIGH      
    I BT 01.07.2008 30.09.2008
    I BT 01.10.2008 31.12.2008
    I BT 01.01.2009 31.03.2009
    I BT 01.04.2009 30.06.2009
    Then pass this values in l_s_range-low l_s_range-high
    Hope this helps
    Sonal...

  • Key Date a Customer Exit and Variant use

    Hello,
      I have a query and it includes time dependent data. The key date uses a  variable that is filled with the current date in a customer exit. Works nicely when the query is executed. However, if I save a variant with various values for variables on the starting/selection screen, the date is saved as a constant date and not dynamic based on the current date so that when the variant is selected to be used on a different day, the key date is the date the variant was saved and not the current date. This can be handled in R/3 ABAP report variants but I've not found a way to do it in BEx. Any help?
    Thanks,
    Diane

    Hi,
    If you are running on BI 7.0 you can maintain variants with the below code. make data sy-datum instead of user input.
    You can also chect the document. It also contains a method for bw 3.5 variants.
    You can schedule this program in a process chain or make variations of this as needed.
    [How To… Troubleshoot Information Broadcasting (BEx Workbooks)|http://www.sapadvisors.com/resources/HowtoInformationBroadcasting.pdf]
    *& Report Z_MASS_VARIANT_MAINTENANCE *
    *& Program to mass update BEx Variants within SAP NetWeaver 2004s *
    REPORT Z_MASS_VARIANT_MAINTENANCE.
    parameter variable like RSRVARIANT-VARI.
    parameter vname like RSRVARIANT-VNAM.
    parameter sign_01 like RSRVARIANT-SIGN.
    parameter opt_01 like RSRVARIANT-OPT.
    parameter low_01 like RSRVARIANT-LOW.
    parameter high_01 like RSRVARIANT-HIGH.
    tables: RSRVARIANT.
    select * from RSRVARIANT.
    if rsrvariant-VARI = variable AND rsrvariant-vnam = vname.
    rsrvariant-SIGN = sign_01.
    rsrvariant-OPT = opt_01.
    rsrvariant-LOW = low_01.
    rsrvariant-HIGH = high_01.
    elseif rsrvariant-vnam = vname.
    rsrvariant-SIGN = sign_01.
    rsrvariant-OPT = opt_01.
    rsrvariant-LOW = low_01.
    rsrvariant-HIGH = high_01.
    endif.
    update rsrvariant.
    if sy-subrc <> 0. insert rsrvariant. endif.
    endselect.
    regards,

  • How to Include in Customer Exit to select max of the date

    Hi,
    Every Employee will have a health Insurance Policy which is valid for 6 six months.
    From Source System i am getting
    Employee and his policy Start date,Based on Policy Start Date in Transformations i am calculacting the Policy Expiry date (Policy Start date + 6 Months)(Ex:If Policy Start Date is 01/Nov/2007 then Exp date is 01/May/2008)
    My report is to Show employees who doesn't had a valid policy on the day report executed (Sys Date)
    For that i created a Customer Exit Variable on Policy Expiry Date
    (If Policy Expiry date is < Sys Date)
    IF i_step = 2.
          CLEAR l_s_range.
          l_s_range-low = sy-datum.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'LT'.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    Problem:
    Data in the cube
    Employee--Policy Start date-Policy Expiry Date
    1--01/01/2008-----30/06/2008
    1--01/07/2007-----31/12/2007
    1--01/01/2007-----30/06/2007
    When i execute the report i should expect the Emp 1 shouldn't be displayed as he had valid policy which is going to expir in June 2008....but the above exit is displaying the below 2 records
    Can i include any changes in the above exit that will select the Max Policy Expire date and then it will check with the Sys Date
    Please update me on how to proceed
    Thanks

    Hi thomos,
    Thanks for the update
    Bit Confused.....could you please explain me
    "Your variable (intervall) should be based on the Policy Expiry Date
    l_s_range-low = '10000101'.
    l_s_range-high = 'sy-datum - 1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'
    How this is going to solve my problem....
    As i got 3 records on a employee one of which got expiry date greater tha sys date
    Thans

Maybe you are looking for