Skip to Content
author's profile photo Former Member
Former Member

Key date variable determined by user exit

Hi BEx experts

We have a challenge to get resolved.

In the table below you see 0CALDAY, ZCALDAY and an employee (0EMPLOYEE).

0CALDAY ZCALDAY Employee 01.02.2012 31.01.2012 Mr. James Bond 02.02.2012 01.02.2012 Mrs. Money Penny 03.02.2012 02.02.2012 Mr. Q

ZCALDAY should be determined through 0CALDAY. ZCALDAY should finally also be used as key date variable feeded through a customer exit which calculates the day before 0CALDAY.

At which place in the Query designer must we define the variables?

I got confused when I tried to define a variable with replacement path in the key date area of the query. There you have to use 0DATE as reference characteristic. Under "Replacement path" you can use a query or another variable.

In our query we don't use a variable for 0CALDAY, only for 0CALMONTH (interval).

How can I solve this problem? Is it possible to calculate for each row another key date through my key date variable in order to use time-dependent master data of 0EMPLOYEE?

thanks

C208

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 14, 2012 at 11:11 AM

    Hello C208,

    with the BAdI and virtual characteristic you are responsible to fill the specific value which will be displayed in the query.

    You have to create some ABAP coding to read the value for 0CALDAY , calculate ZCALDAY and get the right masterdata with this new "key date" for each row. The system can't use several key dates as mentioned above. But virtual characteristics will likely result in poor query performance.

    You can display

    the historical truth (values written on the database, as own caracteristics for example in the cube)

    and/or through navigation attributes the truth for ONE specific date.

    I suggest to get the user to dismiss their unusual requirement for several key dates :-)

    Best regards

    Heiko

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 10, 2012 at 03:59 PM

    Hello C208,

    the key date is the date, the query is using to get time dependent attributes, texts etc.

    You can set a fixed key date (usually this is not making any sense) or a variable key date in the query properties.

    This key date is used globally in the query, i.e. you can set only one key date per query. The standard value is empty, that means the actual date (query execution date) is used as key date.

    To set a variable key date, create a variable on 0DATE. For example, you could determine the last calender day of an entered month.

    If you would like to get a key date per row, you cannot achieve this with the standard key date. I think you have to use a virtual characteristic with ABAP coding to get the value at query runtime according to the ZCALDAY. That usually results in poor query performance.

    You can find some hints how to implement that by BAdI in SDN, searching for virtual characteristic.

    Best regards

    Heiko

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Heiko

      Your proposal "virtual characteristic for determining the key date per row" sounds interesting.

      But: Does this proposal really works as key date for my time dependent attributes?

      I just try to sort out the key date technique, once in the query to use a fix key date or a variable, and on the other hand your proposal using a BADI. How does the query recognize that the BADI calculated date is a key date for the rows?

      Thanks

      C208

  • Posted on May 11, 2012 at 08:39 AM

    Create a Customer exit key date variable(not ready for input) on 0calday.

    ZCALDAY is 0calday - 1 or 0calday = zcalday + 1

    Create the dummy variable (say A)

    User will input 31.01.2012 to 01.02.2012

    Add one to the date and pass it as the input paramenter for the key date variable created on 0calday.

    So the input to 0calday will be 01.02.2012 to 02.02.2012 and will display the correct result i.e Mr. James Bond and Mrs. Money Penny.

    Thanks,

    Vinay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 08, 2012 at 07:06 PM

    Hi C208,

    Do u still need details on how to implement virtual characteristic on BW? DO let me know if you need that, I can provide some documentation.

    Cheers,

    DM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.