Customer exit variable for date range for the last day

Hi,
If user enters date ranges in variable
suppose user enters 9/1/2010 to 9/15/2010 and we have to calculate currency conversion based on last day i..e 9/15/2010 . 08
2)User input is date range 08/01/2010 to 08/30/2010
I need from the customer exit 08/30/2010 (on last day) to calculate currency conversion.
Can anyone help me with ABAP code to achieve this customer exit?And please tell me how to proceed step by step
Sridhar

create a variable to enter date range (ZDATE1)
create a key date variable(ZDATE2) with processing type customer exit, should not be ready for input.
In the exit ZXRSRU01 write below code.
DATA: l_s_range TYPE rsr_s_rangesid,
      loc_var_range LIKE rrrangeexit.
WHEN 'ZDATE2'.
    IF i_step = 2.
       read table i_t_var_range INTO loc_var_range
                with key vnam = 'ZDATE1'.
        CLEAR l_s_range.
        l_s_range-low = loc_var_range-high.
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    ENDIF.

Similar Messages

  • Problem with customer exit variable on date range

    Hi All,
    I have customer exit variable on date range. In the selection screen it has to give the week range  as a default (05/21/2009 to 05/27/2009).
    Earlier its working fine and from yesterday onwards it is not working properly. yesday onwards default date range was not displaying in selection screen.
    Wht would be the problem.
    Thanks in Advance

    Hi Ashish,
    I checked every thing what u told earlier. Every thing is fine.
    And another thing is
    I have routine in infopackage level. Since day before yesterday it was working fine and yesterday onwards it was not working.
    Eg: budat will take the data based on routine for the week. But yesterday onwards it is not picking up the data.however I have the data in datasource for the week.
    Wht would be the problem. I debuged the code and its working fine.
    Sekhar

  • Customer Exit Variable to populate one of the three dates

    Hi ,
    There is a requirement where we need to need to enter either of the following dates :
    1. Order Date
    2. Delivery Date
    3. Bill Date .
    Hence we need to write a Customert Exit Variable for the same .
    One of these 3 dates should be mandatory  i.e, the Report should  not execute if  none of them is entered  while it should execute when either of them is entered.
    All I know is that this Customer exit should be written in iStep = 3 .
    Please suggest the  remaining solution.
    Regards
    Garima

    Please verify if this is the correct Code which  need sto be written :
    IF i_s_rkb1d-compid EQ 'QUERY_NAME'.
    If i_Step = 3
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM EQ 'VAR1' OR
               VNAM EQ 'VAR2' OR VNAM EQ 'VAR3'
        LOW = LOC_VAR_RANGE-LOW.
        HIGH = LOC_VAR_RANGE-HIGH.
    IF SY-SUBRC NE 0 OR LOC_VAR_RANGE-LOW IS INITIAL.
                 CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
                   EXPORTING
                     I_CLASS  = 'RSBBS'
                     I_TYPE   = 'E'
                     I_NUMBER = '000'
                     I_MSGV1  = 'At least one date parameter should be entered'.
                 RAISE AGAIN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDIF.

  • Date Range in the last year

    Hi,
    I know this must be basic. I have searched the forum and I have expiremented but I can't come up with the answer And I'm not much of a coder...
    I have a date field and I need the records to be selected for any date in the past year. In the Select Expert there are many choices for "is in the period" but none of them actually give me the previous 12 months.
    Any help would be great!
    Thankyou.
    Chuck

    Hi Chuck, that is what Carl has given you.
    {db.date} in dateadd("yyyy", -1, {?date}) to {?date}
    dateadd ("yyyy", -1, {?date})
    will date the date you provide in your parameter and subtract one year.
    Dateadd, could subtract, or add, months, days, years....  so by putting the "yyyy" you
    are telling it to use years.
    Anyway, this should give you exactly one year ago from prompted date, to prompted date.
    HTH
    Jon

  • Error while executing customer Exit Variable (No value could be determined for variable.  BRAIN 632)

    Hello,
    I created a customer exit variable which has to show the range between the first and last day of the previous month. The query will be executed every first of the month.
    Variable is declared as: Customer exit, based on 0CALDAY, Interval, Mandatory and NOT input.
    When i debug the query, it is making the calculation but its not populating my variable; when I execute the query from RSRT, the output test shows a message:
    ENo value could be determined for variable ZRANGE_PREVMONTH.                            BRAIN               632ZRANGE_PREVMONTH
    Below the code i'm using (SAP 7.4)
    ***Customer Exit to calculate previous month.
    IF i_step = 2.
         CASE i_vnam.
              WHEN 'ZRANGE_PREVMONTH'.
    DATA:  LS_RA_SID  TYPE   RSR_S_RANGESID.
    DATA:  yyyy(4) TYPE n.
    DATA:  mm(2) TYPE n.
    DATA:  dd(2) TYPE n.
    DATA:  fst_date LIKE sy-datum.
    DATA:  fst_date2 LIKE sy-datum.
    LOOP AT i_t_var_range_c INTO loc_var_range
        WHERE vnam = '0DAT'.
          dd = sy-datum+6(2).
          mm = sy-datum+4(2).
          yyyy = sy-datum+0(4).
          fst_date2 = sy-datum.
          IF dd = '01' AND mm = '01'.
            mm = '12'.
            yyyy = yyyy - 1.
          ELSEIF dd = '01' AND mm <> '01'.
            mm = mm - 1.
          ELSEIF dd <> '01'.
            mm = mm - 1.
          ENDIF.
          CLEAR: fst_date.
          CONCATENATE yyyy mm '01' INTO fst_date.
          fst_date2 = fst_date2 - 1.
          CLEAR: ls_ra_sid.
          ls_ra_sid-sign = 'I'.
          ls_ra_sid-opt = 'BT'.
          ls_ra_sid-high = fst_date2.
          ls_ra_sid-low = fst_date.
          APPEND ls_ra_sid TO e_t_range.
    ENDLOOP.
    ENDCASE.
       ENDIF.

    Hi Fernanda,
    Try this:
    DATA:  LS_RA_SID  TYPE   RSR_S_RANGESID.
    DATA:  fst_date LIKE sy-datum.
       CASE i_vnam.
              WHEN 'ZRANGE_PREVMONTH'.
    fst_date = sy-datum - 1.
    concatenate fst_date(6) '01' into ls_ra_sid-low.
          ls_ra_sid-sign = 'I'.
          ls_ra_sid-opt = 'BT'.
          ls_ra_sid-high = fst_date.
          APPEND ls_ra_sid TO e_t_range.
    ENDLOOP.
    ENDCASE.
       ENDIF.
    Just post here for any queries..
    Regards,
    Loed

  • Customer exit variable issue

    Hi Friends,
    Below code using to find the Quarter values from Year,
    For ex: If ZU1_AY_YEAR = 2010 (User entry variable), I need Quarter values like 2009 Q1.
    ZZ1_Y_X6 is customer exit variable againt Quarter. Here Quarter values are always 2009 Q1,2009 Q2..etc.
    WHEN 'ZZ1_Y_X6'.
          IF i_step  = 2.
            CLEAR l_s_range.
            READ TABLE i_t_var_range INTO ls_t_var_range
              WITH KEY vnam = 'ZU1_AY_YEAR'.
            IF sy-subrc EQ 0.
              ls_t_var_range-low  =  ls_t_var_range-low - 1.
              CONDENSE ls_t_var_range-low NO-GAPS.
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              CONCATENATE ls_t_var_range-low 'Q2'INTO l_s_range-low SEPARATED BY space.
              APPEND l_s_range TO e_t_range.
            ENDIF.
          ENDIF.
    This code/customer exit variable is providing description of the values like 2009 Q1 for the text variables but not getting values through this variable (ZZ1_Y_X6) restriction.
    Hope you got a point. Other wise please let me know if need more details.
    XYZ is the keyfigure --> restricted with ZZ1_Y_X6 --> as per code value is 2009 Q1 --> But not getting key figure values into report as per this 2009 Q1
                                      --> Rows of the query --> created text variable with replacement  Hence value/description is getting
    Please advise?
    Thanks,
    RK

    Hi,
    You cannot use the same variable for text and for restricting the data. I think you have written the code for the text variable. However, for restricting you need to use (or create) a different variable for the 0CALQUARTER InfoObject
    And you must not use the letter 'Q' in the cust exit for the filtering variable. The Quarter values are stored as 20091 (first qtr of 2009), 20092 etc.
    So for the filtering variable, the concat statement will be
    CONCATENATE ls_t_var_range-low '2'INTO l_s_range-low.
    Regards,
    Suhas

  • Help needed in Customer exit variable

    Hi Experts,
    We have a scenario as below.
    User enters fiscal year period.Based on the fiscal year period,entire year will be selected.
    Row would contains
    0fiscper3(Fiscal months from Jan to Dec)
    Column contains Amount(Actual or Forecast)--There is a restricted keyfigure on amount.If value type=60 then forecast
    and value type=10 then actual amount
    If the user enters 002.2010 then it should give Actual values ie value type=10 for 001.2010 and 002.2010.For all values greater than 002.2010, it should give forecast values(value type=60)
    Report Format.
    Jan----
    Actual Value(value type=10 in the column for amount)
    Feb----
    Actual Value(value type=10 in the column for amount)
    Mar----
    Forecast Value(value type=60 in the column for amount)
    Apr----
    Forecast Value(value type=60 in the column for amount)
    May----
    Forecast Value(value type=60 in the column for amount)
    Jun----
    Forecast Value(value type=60 in the column for amount)
    Jul----
    Forecast Value(value type=60 in the column for amount)
    Aug----
    Forecast Value(value type=60 in the column for amount)
    Sep----
    Forecast Value(value type=60 in the column for amount)
    Oct----
    Forecast Value(value type=60 in the column for amount)
    Nov----
    Forecast Value(value type=60 in the column for amount)
    Dec----
    Forecast Value(value type=60 in the column for amount)
    I know that i have to create a customer exit variable for value type
    But in this scenario.the value for value type may change in each row based on fisper3(month).
    How can i obtain such a scenario in the customer exit
    Your help will be appreciated.
    Thanks,
    Senoy
    Edited by: senoy laxman on Feb 15, 2010 6:42 AM

    Hi Senoy,
    you have to create two customer exit variables for fiscal year period(0fiscper) as given below.
    1. for actual values (value type=10), coding in cmod such that showing values less than and equal to user input values.
    2. for forecasting values(value type=60,)coding such that showing values greating than user input values.
    use the first varible in the first selction and the second varible in the second selection in the given below structure(use the structure in rows)
    use the fiscal period user input varible in the third selection in the given structure below.
    structure
    selection - (Actual)-restrict with value 20 and first customer exit variable .
    selection -(Forecast)-restrict with value type 60 and second customer exit variable.
    Selection - 0fiscper
    Add the key figure 0Amount in the columns or in rows(in the selection of second structure) as per your requirment.
    hope this helps you.

  • How to change a customer exit variable in columns

    Hallo Experts,
    i have a query with two columns. In the first column is a customer exit variable, who get filled with the actual calyear. In the second column is the same variable with an offset -1.
    When i execute the query, in the first column i can see the year 2007 and in the second column i can see 2006. That´s ok.
    Now i want to change the year (dynamically) in a filter 2007 in 2005. The result should be in the first column 2005 and in the second column 2004.
    What can i do?

    Hi Jens,
    As I understand the scenario, you have two RKF or selections in column 1 and 2, one is restricted with variable ZYear, the other with the same variable, offset - 1 and variable ZYear provides current year.
    I think there is no way to change years dynamically in a filter, but you could solve the issue by refreshing the query and overwrite default value provided by customer exit.
    To achieve this, please change variable and check 'Ready for input' in change dialog..
    If this shouldn't work, please let me know details a variable definition and customer exit.
    Have a nice w/e
    Joe

  • Query Drilldown does not Invoke Customer Exit Variables

    We have a problem with performing a drilldown in a BEx Analyzer reprot, basically the client is a Trading company and they have inter company trading. We are using the Profit Centre as one of thre u201CFree Characteristicsu201D in the query and hence we are able to drilldown on a Characterictc by Profit Centre.
    We are using a couple of BEx query variables (Customer Exit variables) to determine the inter-area and extrenal area profit centres and these profit centres will be different based on the level of Hieracry node selected when the query is initially executed. For example if we assume a hierarchy with has one root node, 3 children under the root node and 2 grand-children under each of the 3 child nodes, now if we are at the root Node of the Hierarchy then every profit centre is internal and there are no external profit centres,  similarly if we are at the 2nd node (i.e. one of the child nodes) then everything under that node is internal and everything in the other 2 child nodes is external and so on.
    This is where the issue starts for us, since on the report if we select the the node we want to see the results for at the query rumtime (i.e. the Customer Exit Variables are invoked at I_STEP=2 and they select the other nodes of the hierarcy if any and group them into either external or internal)  then the results are correct. Now if we were to drilldown, i.e. We selected the root node and we drilldown on to see for example of the child nodes then the result are not correct, this becomes apparent when we drilldown further to the grand-child nodes.
    One logical explaination is that when we are doing the drilldowns the customer exit variables are not being invoked in the BEx analyzer report and hence they are not grouping the sums for the internal and external profit centres relevent to node selected in the Drill down.
    Does anyone have any suggestions regarding how to make this query work properly or show the correct results in BEx Analyzer (ideally), I have considered the Workbooks option but the client does not want Workbooks.
    Please let me know if there is a program etc we can customise to ensure that the Customer Exit variables logic is used when the user does a drilldown in the query or any other way to make it work.
    Many Thanks
    Jack

    Hi
    Just to aid anyone who is thinking what to do in a similar situation, I am aware that RRI or using workbooks are a couple of good alternatives (just that these are currently not being considered by the client, hence I am asking here).. Also, if someone has Business Objects WEBI then we can satisfy the requirement by creating a new Webi Report for each of the nodes and displaying it (similar to Workbooks but much nicer and faster) or we can get the Webi to execute the variables again during the drilldown... Unfortunately the client is not using Webi either... So the solution has to be in BEx Analyzer / Query designer based...
    If you have any thoughts on how I might be able to do what I want to do then please feel free, I am quite confident that I am not the 1st person to come accross this issue and someone somewhere has solved this issue. 
    Thanks

  • Custome Exit Variable Not prepopulating Parameter of CRE Report

    Hi
    I am using a customer exit varibale to pre populate a parameter in a Bex query I have created.  When I run the bex query the customer exit variable populates the parameter just as it is supposed to.  However when I use the bex query in Crystal Reports for enterprise the customer exit variable does not pre populate the parameter.  Is there something I need to do to make sure that CRE recognises the customer exit variable or does CRE not recognises them?  If it doesn't recognise them is it possible to create CRE level Customer Exit Variable?
    Many Thanks in advance
    Neil

    Hi Alun
    Thanks but I'm in BW so Stored procedures are not really an option on this one.  I suppose my primary question is, is there a reason that Customer Exit Variable is not working as it is creating a lot of difficulties by not populating the parameters in the same way it does in the bex query I am using to develop my Crystal report.
    Thanks
    Neil

  • Generating the last day of the week

    HI All,
    I have the Year value (for eg 2002, 2006) and the week number value in the year ( for eg : 32, 52) . Based on this information, how can I get the last day of the particular week.
    for eg What is the last day of the week - 2002,32
    Any pointer would be great.
    Thanks and Regards
    Venkat

    Or try this:
    SQL> WITH t AS
         (SELECT 2006 YEAR, 1 week
            FROM DUAL
          UNION ALL
          SELECT 2002 YEAR, 32 week
            FROM DUAL
          UNION ALL
          SELECT 2005 YEAR, 52 week
            FROM DUAL
          UNION ALL
          SELECT 2006 YEAR, 52 week
            FROM DUAL)
    SELECT YEAR,
           week,
           CASE
              WHEN TO_CHAR (TRUNC (TO_DATE (YEAR, 'RR'), 'RR'), 'IW') != 1
                 THEN TRUNC (TRUNC (TO_DATE (YEAR, 'RR'), 'RR') + 7, 'IW')
              ELSE TRUNC (TRUNC (TO_DATE (YEAR, 'RR'), 'RR'), 'IW')
           END
           + 6 + (week - 1) * 7 LAST_DAY
      FROM t
                                                  YEAR                                               WEEK LAST_DAY
                                                  2006                                                  1 08-JAN-06
                                                  2002                                                 32 11-AUG-02
                                                  2005                                                 52 01-JAN-06
                                                  2006                                                 52 31-DEZ-06
    4 rows selected.

  • Code (ABAP) for the Customer Exit Variable (CMOD)

    Scenario
    An employee can purchase any no of policies in a day or month.each policy will have start date and expiry date.
    My requirment
    Count all the policies(valid) by employee on a ranges basis exception reporting
    (0-10;10-20;20-30;30-40) and then able to drill down by policy start date and expiry date.
    As per the requirment is to show policies that employee had with in the give date intreval  which are not yet expired (active) i need to write a condition that will count only policies whose Expiry date is > Current calender day
    As Policy Expiry Date is a char i am converting it to KF using fourmala variable so that i can write a condition on it using current cal day formula variable sap exit
    Requirment:
    Need a code for SAP exit variable which will meet the following requirment
    There are the following 2 variables in the query
    1) A variable (User Input)(Date Range) on Policy Start Date and
    2) Authorisation Variable which is based on Authorisation Object(Analysis Authorisations)
    I need a SAP Exit variable (CMOD) that will
    BAsed on the user entered Policy Start date it has to pick all the policy exiry date of the policies and display all the policies whose expiry date is greate than Sy Date (Current Date) and also if Policy Expiry Date is blank or # it has to display
    Arun supplied me with the below code...but i think it doesn't include blank expiry date or #...as i am new to ABAP please update me with releavent code
    Policy Start Date : ZPST_DTE
    Policy Expiry Date: ZPSP_DTE
    Variable (Type:Customer Exit) on Expiry Date: ZEEXP_DTE
    Arun's Code:
    IF I_STEP = 1.
    CASE V_NAME
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.
    Please modify above code to include Blank or # values of Expiry Date
    Thanks Arun
    Please ask if you need further info as this is urgent
    Thanks

    Hi Arun,
    Thanks for the help...will definetly assign points
    (Closed the previous thread)
    Please spare bit of ur time as this is my first ABAP Code
    Can i include 2 restrictions..# and Variable (Customer Exit)...But how can i include Records with Blank Values
    As the data from Source system the expiry date is filled up with either Date or # or Blank...my requiorment is to include all 3 and
    Question:
    As there are 2 other variables defined ..one on Policy Start Date (User input date intreval) and Location (Authorization Variable..Analysis Authorisations)...Do i need to change I_STEP in the code
    (Req: Reports shows all the(still valid) policies emp has purchased between  2 give date (Variable on Policy Start date)
    IF I_STEP = 1.
    CASE V_NAME
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.

  • Error in the ABAP Code for Customer Exit Variable

    Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
    i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
    In CMOD i had written the below Code:
    When 'ZVWKNO'.
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    But when i execute the query the default value is not populated with Week-1 No in the variable screen
    Please update me what went wrong
    Thanks

    Case ZVWKNO.                "write this with out comments
    When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    Prabhudas

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • Looking for an ABAP-code for the customer-Exit Variable

    Hello,
    I have defined a Variable (Interval) which should be processed through Customer-Exit on characteristic Supplier-Date (date format). This Customer-Exit Variable is called ZDATE.
    We have another time characteristic Fiscal year / period (0FISCPER) which has single mandatory input variable for ex.  003.2011. This input variable is called ZFISCPER.
    Now I have to write an ABAP-Code where the customer exit variable ZDATE is derived (fiscal last year to last period) from input variable ZFISCPER in INCLUDE ZXRSRU01.
    Means when the input variable (ZFISCPER) is 003.2011 then the customer exit variable ZDATE should be calculated in INCLUDE ZXRSRU01 as 01.01.2010 u2013 28.02.2011 (fiscal last year to last period).
    Since I am quite new in ABAP, I will be grateful if you could write me sample ABAP for this.
    Many thanks.

    Hi,
    should be something like:
    DATA: l_s_range TYPE rsr_s_rangesid,
    input LIKE sy-datum.
    When 'ZDATE'
    CONCATENATE '0101' 0FISCPER+3(4)-1 into l_s_range-low. "You get 01012010
    CONCATENATE '01' Fiscper+1(6) into input.                            "You get 01032011
    l_s_range-high = input-1.                                                     "You get 28022011
    APPEND l_s_range TO e_t_range.
    Greetings
    Roman

Maybe you are looking for

  • Macbook Pro i7 running slow

    I just picked up a new Macbook Pro i7 Mid-2012 w/ 8GB of RAM.  I am running VMWare Windows 8 (or Windows 7), Apple Mail, LibreOffice, Text Edit, Safari and Firefox.  According to MemoryClean, and I have 3.17GB of RAM free.  Checked with Disk Unility,

  • HT1688 How do I check past iPhone accounts on iTunes?

    I think my son stole my old phone and I need to know if this is my old phone or really his.  How do I find out?  I don't have the orignal box anymore?

  • Syncing movies on iPhone 3G

    my iphone wont sync all my movies, 1 of 3 sync but not the others. They are all the same format (mp4. I can see them in itunes but they wont transfer onto the iphone.

  • Event when logistic invoice gets in the sys. through EDI with status cod 03

    Hello Gurus, I am trying to find the event that gets triggered when an incoming EDI logistics invoice gets posted/created in system with status code 3 (error status). I know that I can go to transaction SWELS to find the event using event trace. The

  • Pint user name in the report

    Hi I want to print the user name in the report. How can I ? Here username is the one which i am using to login into apex. Thanks Nav. Edited by: user13129164 on May 18, 2010 11:53 PM