Key date for a query

Dear All,
I have created a customer exit variable on key date of a query.
With this input variable i am first asking user to input one particular date say he enters 31.12.2010 then i am trying to add 1 more day to it and making it 01.01.2011.
I have put a break point in the code but it does not stop the processing there.. report executes directly taking the first user input.
I want to add 1 more day to the user entered date and this modifiied date should be the input date for key date field.
Below is my code.
  WHEN 'ZCAL_DAY_EXT'.
    IF I_STEP = 2. "after the popup
      LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
      WHERE VNAM = 'ZCAL_DAY_EXT'.
        CLEAR L_S_RANGE.
      ENDLOOP.
      DATA: v_temp like sy-datum.
      v_temp = loc_var_range-low.
      v_temp = v_temp + 1.
      L_S_RANGE-LOW = v_temp.
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT = 'EQ'.
      APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
Do let me know where am i going wrong? Or is it we cannot use customer exit with Key date.
Thanks & Regards,
Anup
Edited by: Anup Chaudhari on Aug 2, 2011 7:16 AM

Hi Anup,
Basically I_STEP = 1 is used for populating the default value which will be shown on selection screen and I_STEP = 2 is the step in which you does the processing on variable values which are entered on selection screen.
I am surprised that your internal table is empty, actually it is supposed to contain all the variable values which are entered in I_STEP = 1.
Can you try to add some more variables along with the current variable and check whether their value is coming in the internal table or not?
Finally what you can try is get the user input date in one variable and then create another customer exit variable in which you will calculate the new value and use this variable in Key date, the problem might be that we are trying to modify the same variable, actually it should not be the problem but I have no clue what is happening and you can just try this alternative.
Regards,
Durgesh.

Similar Messages

  • Variable : Key date of the query

    Hello Everyone,
    I would like to share couple of points with you all during this cool holiday season.
    I need to use variable for a  time dependent hierarchy. I have a variable and selected that. Again I want to restrict this hierarchy by using variable for key date of the query.
    I can select a variable for the hierarchy. But I am not able to restrict the hierarchy.  When I choose a varaible for "key date of the query" system responed with an error message ' For characteristic 0Date, enter value in permitted format'. So I am not able to select a variable for "key date of the query " and restrict the hierarchy to choose a node.
    Please share your valuable inputs.
    Thanks in advance
    RJ

    Hello,
    what is the variable name that you are using to restrict the hierarchy date?
    Regards,
    Daniel

  • AP Aging report - key date for user entry

    Hi All,
    We have a requirement to calculate aging buckets like 0-30,31-60,61-90...etc.
    I know the key date for this report is created on net due date in SAP standard report.
    In standard SAP report , key date is always a system date(SY-DATUM).
    What we need for this report is , we need to get all the invoices which are outstanding as of that date(the date which user enters).
    If user enters today's date(08/28/07) , he should get all the invoices outstanding till that date in aging buckets and if user enters some date in the past like 07/26/07, he should get all the invoices outstanding as of that date.
    Can  someone Pls tell me if aging buckets are calculated based on a user entry ?
    Regards,
    Kumar

    Hi Voodi,
    Aging in the standard report is being calculated like below...
    1.For open items
    Posting date<key date
    Item status = O
    2.Posting date < keydate and clearing date > key date and net due date with offsets on keydate ( key date + 1 - keydate+30 --- for 1-30 days) like wise for all aging buckets.
    in this scenarion , key date is always system date ie today's date.
    But user wants to get all the invoices based on his user entry...
    is this possible with the same standard key date variable or do we need implement any other logic???
    Regards,
    Kumar

  • Bex query-KEY date for time dependent objects

    Hi
    I have one infoobject called 0customer that has one time dependent attribute .called status. I would know how the system works in the following senario for the a given key date(which in bex properties).
    question 1)
    customer todate          fromdate    status
    1            20071231     20070101     Y
    1            20081231     20080101      N
    1            20091231     20081101      X
    can the data in the infoobject be overlapped? is the 3 rd record is  valid in the above example - as months(11&12of2008)  overlapping with second record? ? pls advise
    question 2)
    customer todate          fromdate    status
    1            20071231     20070101     Y
    1            20081231     20080101      N
    1            20091231     20090101      X
    If the keydate is 20080201 which record will it return?would it return the record that has status 'N'?
    what does the keydate is compared against? is it with from date or todate or between fromdate and todate? does the query return only one customer record for a given customer when it runs in the query?
    Please advise.
    Thanks
    Vennela

    1) Normally you cannot activate the data with this constellation. If you have inconsistent master data you can repair with transaction RSRV.
    2) The system returns N for key data 20080201.
    Best regards
    Dirk
    Edited by: Dirk Herzog on Nov 19, 2008 1:16 PM

  • What is "key date" in the query definition

    Hello,
    What is "key date" in the definition of query. Where does it come in picture and I see that it has value varaible?
    Can someone explain?
    Thanks

    Hi K M,
    This date is relevant for the time dependant master data if you are using it in your query.
    http://help.sap.com/saphelp_nw04/helpdata/en/1e/99ea3bd7896f58e10000000a11402f/content.htm
    You can use a variable in the key date and then the master data suuplied to the query (like nav attr) will be as per the date you have specified.
    Hope this helps...

  • Currency Translation on Key Date for AR Aging

    Need your valuable advice!
    I have created an AR Aging query including both Open and Cleared Items based on 0FIAR_C03_Q0005 standard query. However the requirement is to do currency translation to Group Currency (USD) on Key Date. This Key date is defaulted to today but the user can change this to go back in time and pull all the ARs as of that back dated key date.
    I was planning to create a currency translation type on M rate based on the Key Date Variable in RSCUR. However I am confused on which variable to base this currency translation. I have several key date variables in my query such as 0P_KEYD2 (based on Posting Date), 0P_KEYDT (based on Net Due Date) and 0P_KEYD3 (based on Clearing Date).
    Which Key Date Variable should I use in 'Time Reference from Variable' field in RSCUR? Would it be one of the 3 mentioned above or something else and why?
    Appreciate your valuable advice.
    Thanks,
    Al

    Hi,
    Yes I do want to use the Key date from the variable screen and I am using the standard 0FIAR_C03_Q005 with slight modification including currency translation.
    As I mentioned in my original post I have several key date variables in this query such as 0P_KEYD2 (based on Posting Date), 0P_KEYDT (based on Net Due Date) and 0P_KEYD3 (based on Clearing Date). My question is which one should I use if I want to base it on the specific key date variable from the variable screen? I need the specific Key Date variable technical name.
    Thanks,
    Al

  • Capturing key data for tracking/compliance

    We have two separate user groups, both of whom can access eLearning portal. One group (permanent staff) does have LMS logins but a bigger (volunteer) group have no login IDs (in a year or so, this may change)
    However, i'd appreciate advice on how to capture basic data (Pass/score and Name, - plus users Location/Role/Manager, not currently captured in our LMS)
    Using CP4, I have set up a Random Q pool and then a slide with free Text Entry Boxes, to input key data.
    There are potentially too many people to manage creating an email to send data.
    How do I collect/export the data into, say, a spreadsheet (as an interim solution to capture data to report for compiance training ) .
    If this is possibile, Step-by-step help would be appreciated. (not a techy and never used anything like java scripting)
    Much thanks in advance

    That seems remarkably complicated - surely there must be an easy way to say That is precisely the way all Actions are handle by Swing components. It is extremely easy if you take a few minutes to understand how it works.
    Using a KeyListener is the wrong approach.

  • Bill key date for manual billing

    When a manual billing document is invoiced, the bill key date field in table ERDK remains empty even though it has been correctly filled in ERCH. Any idea why this is so and how it can be corrected?

    Hi,
    To update the Bill Key date in ERDK,we implemented the BADI ISU_DEF_BILL_PERIOD and inside it,under method SET_BILLING_PERIOD_INV we made the code changes to update the billing key date.
    Thanks,
    Shreeraj

  • Created on Date for Adhoc Query

    Hi Everyone,
    I have a requirement for creating a query which will list the adhoc queries created by the power users.
    User - Query - Infocube - Created on - No of Navs - Last Used.
    Is there a way to make the BW Stats system give me the 'Created on' Day. I know it has the Last changed date which can be either the day it was created on or enhanced on.
    Also (just a thought I had) .... No of Navs - this number denoted the number of times the query requested data (executions and drilldowns). Is there key figure which can give only the no of times the query was executed and not the drilldowns it made.
    Any suggestions will be greatly appreciated.
    Thankx!
    Kumar.
    Edited by: kumar saurabh on Aug 18, 2008 5:34 PM

    Hi..
    Pls check below code to fetch the tesxt of historical org unit. hope it will help.
    *//Internal table declaration.
    DATA : lt_00  TYPE STANDARD TABLE OF pa0000,
           lt_psn TYPE STANDARD TABLE OF zhrpositions,
           lt_ret TYPE STANDARD TABLE OF bapiret2,
           lt_01  TYPE STANDARD TABLE OF pa0001,
           lw_01  TYPE pa0001,
           lw_psn TYPE zhrpositions,
           lt_comps  LIKE zstr_hr_comps,
           lt_return LIKE bapiret2.
    Thanks,
    kl
    Edited by: Narayana on Aug 10, 2010 10:50 AM

  • Why between for date is not returning data for this query ?

    Hello,
    i have a table with this structure and i am writing this query for fetching some rows based on some condition , but this query is not returning any data . Can you please tell why ?
    ID     DT
    003     11/8/2011
    002     10/8/2011
    001     9/8/2011
    And the query is :
    SELECT * FROM TABLE_NAME WHERE DT BETWEEN TO_DATE('08/08/2011','dd/mm/yyyy') AND TO_DATE('12/08/2011','dd/mm/yyyy');
    Edited by: bootstrap on Aug 13, 2011 7:10 AM

    >
    >
    but what is the problem with that, why that date is not matched when i am providing the date format ?Which part don't you understand? You did not use TO_DATE while inserting data and default date format was mm/dd/yyyy, right? Same default date format is used if you issue:
    SELECT * FROM TABLE_NAME Your original post states the above select returns:
    ID     DT
    003     11/8/2011
    002     10/8/2011
    001     9/8/2011So dates you inserted are November 8, 2011, October 8 2011 and September 8 2011. Now TO_DATE('08/08/2011','dd/mm/yyyy') is August 8 2011 and TO_DATE('12/08/2011','dd/mm/yyyy') is August 12 2011. So obviously:
    SELECT * FROM TABLE_NAME WHERE DT BETWEEN TO_DATE('08/08/2011','dd/mm/yyyy') AND TO_DATE('12/08/2011','dd/mm/yyyy');will not return any rows. Bottome line - never write code that uses implicit date conversions since your code becomes client NLS settings dependent and might work for one client and fail or produce wrong results for other client.
    SY.

  • Problem in display of char. and key figure for yearly query

    Hello all,
    I got a query in which i have to do restriction on
    Calendar Day/Month in Rows under Material which is a Characteristics
    So it should be
                                                               PACKAGE QUANTITY
                                            JAN  FEB  MAR   APRIL.......DEC
    PACK1
    PACK2
    PACK3
    PACK4 for current year
    PACK4 for prior YEar
    Now the months display is not pre decided, it can be anything as per the input of user.
    So i have to restrict it on Calendar month for Material twice
    In current year , just introducing the Interval range variable
    In previous year, same restricition with offset -12
    Now the problem is while displaying it shows
                                           JAN'06 JAN'07  FEB'06 FEB'07  MAR'06 MAR'07........ 
    PACK1
    PACK2
    PACK3
    PACK4 for current year
    PACK4 for prior YEar
    Which is not desirable.
    I only want value for Jan in one column
    and for previous year and current year in different rows thats it.
    If i remove Calendar year/month from columns there is no way I CAN DISPLAY MONTHS .
    How to achieve this.
    Please suggest.

    Kartikey,
    Rusty's suggestion wont work - using two characteristics for year and month will have the same effect as the position you are in at the moment.
    ie..
    2007     Jan.07     Feb.07    Mar.07   Apr.07
    2006 -
    Jan 06  Feb 06  Mar 06
    If you have the posting period of 01 - 02 - 03  (just the period number only, no year) then your query will display
    2007-01-02-03-04
    2006-01-02-03-04
    Regards
    Gill

  • Fieldes planned delivery date and actual good recipt date for SAP QUERY

    Hi Gurus
    I am changing sap query. I need to find two fieldes  : planned delivery date and actual goods recipt date
    I dont know MM tables, do you know wrhere are?
    in table EKPO i don't find the fieldes.
    Thanks in advance

    Thank a lot!
    Regards

  • Variable For Query Key Date

    Hi All,
    I am using time dependent master data, i want to count number of employees on particular key date for diffferent Orgunits. So i created variable in the query properties for dynamic date selection .I also have other variable - Calendar month.
    If the user enters particular  Calendar Day (21.03.2008), then the report should show the total number of employees for that particular day.
    If the user chooses Cal Year/month  then the report should show the total number of employees for that time frame (12.2007-12.2008).
    When i enter Cal Year/month and execute the system not allowing to execute the report. It says Calender Day is mandatory.
    How can i bypass the calenderday when i choose calyear/month.
    Variable for Key date :
    Char - Calender Day
    Mandatory
    Ready for Input
    Regards
    A.Vasister

    Hi,
    For this work you have to create another 2 variable.
    1. Make your both user entry variables as optional.
    2. Create another 2 variables processing type as user exit.
    3. In the CMOD program, identify which variable contains data.
       - If the user entered month, then in the user exit of Calender day's from date should be
         first day of the month parameter and to    date should be the last date of the month parameter.
       - If the user entered date, then pass corresponding month&year value of the date to calmonth variable.
    Let me know the position.
    Vivek

  • How to make key date of query as transcation date in cube

    I am facing an issues in displaying the transaction data with time dependent master data.
    I want to set the key date of the query to go against the transaction date and diplay the respective master data.
    I read in other posts,
    that i cant use the user exit variable, because the exit is executed only once before the query run.
    The fllowing is the report i want to achive,
    customer|customer_grp-|date-|--|sale
    100-----|-sa|jan 1|--- 15$
    100-----|-ic|oct 1|--- 32$
    in the above scenario, customer_grp for cusotmer 100 is sa from jan - mar and
    customer_grp for cusotmer 100 is ic from apr - dec
    I have customer_grp as time dependent attribute of customer. when i execute the report with key date as ,nov 1st
    it displays as,
    customer|customer_grp-|date-|--|sale
    100-----|-ic|jan 1|--- 15$
    100-----|-ic|oct 1|--- 32$
    if key date is jan 1st it displays as,
    customer|customer_grp----|date-|--|sale
    100--|-sa|jan 1|--- 15$
    100--|-sa|oct 1|--- 32$
    let me know whether it is possible to achive this type of report
    -thanks in advance
    - points will be awarded for  inputs

    Hello,
    I have the same kind of requirement.
    Is it possible to assign a Date field from the cube to Keydate of the query so that the time-dep attribute value is properly displayed based on InvoiceDate of each record, not based on today(query keydate by default)?
    Otherway i can think of is to add a Char/KF to cube and insert the value using a query on Masterdata in update rules. How far this approach is recommended?
    Thanks in advance,
    vamsi.

  • Key date variable only works for i_step = 1?

    Hi, I'm working with the query designer. I need to change the key date of a query before and after the user input.
    Using the debugging on transaction rsrt I found out that key date of the query only works for i_step = 1.
    With i_step = 2 I never get this variable.
    After the popup I can only change the date manually.
    I couldn't find any documentation about this specific subject.
    Can anyone confirm/ help?
    Thanks,
    Cristina

    you can go thru the Article at [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d09d4588-3832-2c10-e185-f778d9dbea85?quicklink=index&overridelayout=true]
    with I_STEP = 1
    the enhancement call takes place before varaible entry. so this can be used to populate variables with default values
    with I_STEP = 2
    called after the processing of the variable pop-up.

Maybe you are looking for

  • Can't bind Panther to AD

    I'm trying to add an iMac running 10.3.9 to an active directory. It hangs on the binding process at step 1, invalid domain name. domain is asms.dogr.local, forest should then be dogr.local I got my Leopard equipped MacBook on it fine. Any ideas befor

  • T400s solid state hard drive already full

    I have a newly-purchased t400s with a 120gb solid state hard drive.  The drive is already almost full, and I have only uploaded about 35gb of data from my old computer.  How is this possible?  Are there specific programs that are eating up my storage

  • Error while trying to deploy 32 bit windows 7 using mdt

    I am trying to deploy 32 bit windows 7 on a 64 bit machine using MDT. After the initial loading it gives an error stating that windows failed to start. File:\Windows\system32\drivers\stm_tpm.sys status: 0xc000035a info: windows failed to load because

  • Screen moving when using Execute query (F8)

    Hi i have a screen oracle form when i used the key F8 ( execute query) then the screen moved down a half. Could you please help me how to fix it.

  • IDS database is too big

    Hi all, I see in Security monitor: IPS database file: 119% (Usuage) idsmdc.db (28.94%) idsmdc.log (90.45%) Now, I want to ask, If I delete file idsmdc.log, Cisco VMS can run well or not? How to decrease the IDS database? Thank you very much.