How to use Key Date in query

Imagine an invoice was created for a customer on the 1st of January 2008 for £1000
On the 1st of Feb, he paid $300, owing $700
On the 1st of Mar, he paid $450, owing $250
On the 1st of Apr, he paid $250.
If I run an AR report today the 10th of Aug, I would see he owes nothing. What I want to do is to run the report today based on the 2nd of March and see a debt of £250. I dont want to use the posting date in the selection criteria henceI think this is the case when you use a key date but I’m not sure how to use this in the query properties of BI7. What Characteristic do I need to specify as time dependant? Is there anything else I should consider?

hi,
Key Date setting is for the 'time dependent' master data.
Lets say u have a Characteristic MATERIAL with a time dependent attribute MATERIAL GROUP as follows.
MATERIAL FROM TO MATERIAL GROUP
ABD 01/01/1995 12/31/2003 X
ABD 01/01/2004 12/31/9999 Y
Depending on what you have for the Keydate, the Material group is selected.
If your key date is, ex, 06/12/2001 there material group is X. Or if key date is 02/15/2005, material group is Y.
If you do not enter any value for keydate, system automatically assumes today' date.
hope it helps..

Similar Messages

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

  • How to use OData Date filter query to filter data from OData NetWeaver Gateway Service?

    Hello,
    I am trying to use the OData Filter query. to filter data records from the OData Service, using Date range for filters.
    Please check the below URL for the SAP's sample OData Service, with filter option.
    Service Query URL :
    https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/SalesOrderCollection?$filter=CreatedAt eq DateTime
    It gives out following error :->
    <message xml:lang="en">'$filter ' is not a valid system query option</message>
    Please let me know, if there is any mistake in the Query or is there anything that needs to be done on the
    Backend  Service.
    Thanks & Regards,
    Suraj Kumar

    Hi Jitendra,
    Once again, thank you for your help.
    I am able to filter the records using a date range.
    I am sharing the information, just in case anyone out there might need it.
    The OData Filter Query for Date Range (i.e. with Two date values) will return the results only if the OData Back-end Service is modified to accommodate such filter requests.
    This has to be done in ABAP.
    Please refer the following links which talks more about the Back-end ABAP Service being modified to ensure that the service returns records of data, as per the date range filter query
    http://scn.sap.com/thread/3170195
    http://scn.sap.com/blogs/lindsay.stanger/2012/12/29/gateway-odata-calls-convert-ivfilterstring-to-itfilterselectoptions
    http://scn.sap.com/thread/3173146
    Hope these links are helpful for those looking for OData Date Range filter query.
    Do let me know.
    Regards,
    Suraj Kumar.

  • Key date in query designer

    Hi All,
    I have a requirements to read data based on t.code S_AHR_61016403 by using Trip Begins On date and filter by receipt date therefore I’m using DS 0FI_TV_01 and able to get data into Cube level correctly.
    In Query designer, I have to use trip beginning date and filter by receipt date then put in MTD and YTD bucket based on receipt date.
    For example, trip beginning date 01.07.2014 – 31.07.2014, could get 100 records which has different months data with total amount1500/- but based on receipt date 01.07.2014 – 31.07.2014 there are only 75 records with total amount 1000/-  I only interested total value 1000/-
    I’m thinking to create a Key Date in query designer to read beginning date range and receipt date range. 
    Can anybody give how to achieve this.
    regards
    Naani

    0FI_TV_01 is a transaction datasource. Hence your Trip begin/Enddates are transactional data. You cannot use them as part of Key date in Query designer.
    One more thing, you can't use ranges in Key date. It works only with single date.
    you have to either create two variables in query filter. or restrict your KF with both variables.

  • About the Key date in Query Properties

    Hi,
    With regard to the Key date in Query Properties, As I understood from the previous postings that it is used to filter out the data for Time dependent Master data object. But once we set up this key date, isn't it applicable to all InfoObjects in Query. For example, if I give  Key date as 20/05/2007, can't we get data beyond 20/05/2007 to all the objects in Query when I have Employee Group as Time dependent Attribute. And if we create any variable for Key date under calday, isn't it applicable to all objects. How is it applicable to only Employee Group.

    Re: Key Date in Query Properties -can it be dynamic ?
    Say i have a query that has a user input date range interval. Say the query is supposed to display some key figures restricted on a Time Dependent Characteristic attribute for the date range.
    So, in the Query Properties - i really DONT want to set the Key Date to a fixed date ( today or a user input date) but instead i want to set it to the system date that the BW olap processor is going to use while selecting each and every row from the cube while processing the date range.
    for example while processing the date range - for each one of the dates it hits upon a fact table record and it has to fetch the attribute from the time dependent master data table using that date and if this attribute is 'x' then aggregate the key figure if not go to the next one...
    do i make sense ? let me know if the above doesn't. I will try to explain my Q again. Want to know if BW lets you do that.
    thanks
    Arun Pond.

  • How to display current date in query header?

    Hi,
    How to display current date in query header?
    I use Query Designer for development.
    Thanks,
    Arun KK

    Hi Arun,
    You can define fixed header lines and footer lines so that when you generate the query list, they can receive current values of certain fields. When you define a header line or a footer line, you must specify a character string of the type &field, where field is the short name of a field.
    This function allows you (for example) to place a sort criterion in the header line.
    You can include the following fields as variables in the headers directly:
    %NAME
    Name of the user processing the query
    %DATE
    Current date
    %TIME
    Current time
    %PAGE
    Current page number (6 characters)
    %P
    Current page number (3 characters)
    These fields can be used in the short forms N,D,T and P. If you want to use these letters as short names for query fields, the field values from the query are used.
    You can also see the link
    [http://help.sap.com/saphelp_nw70/helpdata/EN/6e/dd68721faf11d6b1d500508b6b8b11/frameset.htm]
    Regards,
    NR

  • How to get key from MDX Query

    Hi All,
    how to get key from mdx query ?
    example :
    SELECT [Measures].[67822GFASOU7KUT6FKHSQ34FV] ON COLUMNS NON EMPTY CROSSJOIN([ZCOMPANY].MEMBERS, [ZMILL].MEMBERS) ON ROWS FROM ZODS_GL/ZODS_GL_001
    the result from this mdx query are zcompany text and zmill text, how to get company key and mill key ?
    Regards
    JeiMing

    hi Jeiming,
    to get key in mdx, you can try something like
    [ZCOMPANY].[LEVEL01].MEMBERS
    properties [ZCOMPANY].[2ZCOMPANY]
    following threads may useful
    Extracting texts with MDX
    MDX Statement - display only keys for characterstics and their dis. attrib.
    hope this helps.

  • How to use same Data Type and Length for two fields

    How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
    SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
    FROM bsik
    INTO TABLE it_bsik
    WHERE bukrs = p_bukrs
    AND lifnr IN s_lifnr.
    IF it_bsik IS NOT INITIAL.
    SELECT belnr gjahr awkey awtyp
    FROM bkpf
    INTO TABLE it_bkpf
    FOR ALL ENTRIES IN it_bsik
    WHERE belnr = it_bsik-belnr
    AND gjahr = it_bsik-gjahr.
    IF it_bkpf IS NOT INITIAL.
    SELECT belnr gjahr lifnr xblnr
    FROM rbkp
    INTO TABLE it_rbkp
    FOR ALL ENTRIES IN it_bkpf
    WHERE belnr = it_bkpf-awkey+0(10)
    AND gjahr = it_bkpf-awkey+10(4).
    ENDIF.
    ENDIF.
    Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
    Kindly clarify.

    Hi Saurabh,
    Please see the example code that I have developed for you. It will help you solve the problem.
    REPORT ZTEST_3 .
    tables : BKPF.
    data : begin of it_bkpf occurs 1,
             belnr type RE_BELNR,
             awkey type awkey,
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf.
    data : begin of it_bkpf1 occurs 1,
             belnr type RE_BELNR,
             awkey type gjahr,              " change the data type
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf1.
    data : begin of it_rbkp occurs 1,
             belnr type BELNR_D,
             gjahr type gjahr,
             lifnr type LIFRE,
             xblnr type XBLNR,
           end of it_rbkp.
    select belnr
           awkey
           awtyp
           gjahr
           from bkpf
           into table it_bkpf
           where BUKRS = 'TELH'.
    loop at it_bkpf.
    it_bkpf1-belnr = it_bkpf-belnr.
    it_bkpf1-awkey = it_bkpf-awkey+10(4).           "Here only append the required length.
    it_bkpf1-awtyp = it_bkpf-awtyp.
    it_bkpf1-gjahr = it_bkpf-gjahr.
    append it_bkpf1.
    clear it_bkpf1.
    endloop.
    select  belnr
            gjahr
            lifnr
            xblnr
            from RBKP
            into table it_rbkp
            for all entries in it_bkpf1
            where belnr = it_bkpf1-belnr
    This is just an example. Change the fields according to your requirement.
    Regards
    Abhii
    Edited by: Abhii on Mar 9, 2011 9:08 AM

  • How to use Sql data source from Essbase 9.3.1

    Hi All,
    How to use Sql data source from Essbase 9.3.1 for ASO cube.Are there any rules and limitations for that.
    Do we need to create any data source connection for this purpose. If there please let me know the dteps to create that connection.
    Regards

    Yes you need to create one DSN connection and you have to use DSN name and login details at the time of building/loading of the outline.
    Create DSN
    Goto Administrative tools -> DataSources (ODBC) and add the DSN name and specify the Server name of SQL and login details and database.
    goto data prep editor and click on File Menu and Click on Open SQL option Next window opens.
    There you have to enter the details of the DSN connection and SQL query to build/load.
    Thanks,
    Prathap

  • How to use the same POWL query for multiple users

    Hello,
    I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
    "Query 'ABC' is already open in another session."
    where 'ABC' is the query name.
    Can you please tell me how to use the same POWL query for multiple users ?
    A fast reply would be highly appreciated.
    Thanks and Regards,
    Sandhya

    Batch processing usually involves using actions you have recorded.  In Action you can insert Path that can be used during processing documents.  Path have some size so you may want to only process document that have the same size.  Look in the Actions Palette fly-out menu for insert path.  It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..

  • How to use open data set in SAP

    Hi SAP Gurus,
            Could anyone help, how to use open data set in SAP.
          I need to upload a file from Application server (ZSAPUSAGEDATA) to internal table (IT_FINAL).
    Thanks & Regards,
    Krishnau2026

    Hi Krishna.
    These are the steps you need to follow.
    tables: specify the table.
    data: begin of fs_...
            end of fs_    " Structure Field string.
    data: t_table like
            standard table
                      of fs_...
    data:
    w_file TYPE string.
    data:
      fname(10) VALUE '.\xyz.TXT'.
    select-options: if any.
    PARAMETERS:
      p_file LIKE rlgrap-filename.
    w_file = p_file.
    select .... statement
    OPEN DATASET fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    *OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
    LOOP AT t_... INTO fs_....
    write:/ .....
    TRANSFER fs_... TO fname.
    or
    TRANSFER t_... TO fname
    ENDLOOP.
    CLOSE DATASET fname.
    Reward points wisely and if you are benefitted or ask for more detailed explanation if problem not solved.
    Regards Harsh.

  • How to use Jquery Data Grid in HTML

    can anyone please tell me how to use JQuery Data grid in my HTML page with example.
    I have one HTML page i want the standard JQuery Data Grid with search and pagination functionality.

    Guys I have got the solution
    thanks a lot
    please refer this link for JQGrid
    http://www.codeproject.com/Articles/609442/Using-JqGrid-in-ASP-NET

  • How to use TRIM  DATA in CFFORM?

    How to use TRIM DATA in CFFORM? when data is retrieving from
    DATABASE. Wanna rtrim and ltrim while spaces.

    Better to trim those values after the form submission.
    Once you put them into form,
    user may also makes mistake by hitting space, right?
    Also, by trimming all form fields after submission, you will
    be sure that your DB is clean... no whitespaces on it.
    Well unless someone insert data directly onto it :)

  • HT3529 how i use key board

    How i use key board specially  typing of upper case letter

    Press the shift key (looks like an up arrow).  Then press the letter you wish to type in upper case.

  • How to use Results from Another Query for SAP BW universes

    Hi Everyone,
    I have two SAP BI universes.In my First universe I have Sales Doc no (dimension) and Orderqty (Measure) and in my second universe I have Sales Doc no(Dimension) and BillQty (Measure).
    Here in my first dataprovider I have 1200 rows of data and in second dataprovider I have 75,000 rows. The report should fetch only the BillQty details that matches to corresponding  Sales doc no in first data provider.
    I want to place all these fileds into a single report like as shown.
    (Datarpovider1)                (Datarpovider1)                    (Datarpovider2)
    *Sales Doc No*               Orderqty                           BillQty
    Here I am able to generate single report using merge dimension but it is leading to performance issues. I want to restrict the values at query level by passing the First dataprovider Sales doc no to second Data provider Sales doc number using Results from Anothery Query feature so that It can fetch only the matching records.
    I tried it but it was giving the follwing error:
    A filter contains a wrong value. You cannot run this query. (Error: WIS 00007)
    How Can I get rid of this error. Can we use Results from Anothery Query option for OLAP universe. Are there any limitation on it.
    All this I am doing in Webi Rich Client.
    Appreciate your help
    Thanks &in Advance
    Kiran Saka

    Hi Kiran,
    I think the filter has a wrong operand. For example, a filter with an empty constant, or a filter that deals with numeric values is defined with an alphanumeric value.Check out for this.
    Regards,
    Neeraj

Maybe you are looking for