cancel
Showing results for 
Search instead for 
Did you mean: 

Variable for key date for char derivation depending on version

cornelia_lezoch
Active Contributor
0 Kudos

Hi all,

I want to write data records for budget and forecast within the same planning cube.

some characteristics shall be derived from time dependent navigation attributes. Therefore I need to define a key date that fits to the version

- for budget I want to use the 01.01. from planning year

- for forecast I want to use the 01. of the current month (current date might also do)

Did anyone ever use the key date like this - depending on the version?

Could we implement a variable that delivers for each data record it´s own key date depending on the version that is included in the data record and then use standard attribute derivations?

Or should we rather leave the key data as current date but define an exit derivation, that is reading the correct time dependent attribute value depending on the version?

thanks for your ideas

Cornelia

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Cornelia,

the planning key date used in derivation is fix in the user session. What you need is to determine the key date (to be used for the attribute lookup) from the record. You need an exit implementation for this. You can check the standard implementation in class CL_RSPLS_CR_MASTER_DATA but this class uses a factory GET_INSTANCE where I_DATETO is not part of the 'key' to reuse already existing instances.

Regards,

Gregor

JochenRaab
Explorer
0 Kudos

Hello Gregor,

I am working with Cornelia on this project. Until now we tried to bypass this problem using other methods. However, with the year change, we find ourselves faced with this issue again.

Do I call the CL_RSPLS_CR_MASTER_DATA in an exit for the variable which I use under the central settings of the infoprovider? I am currently having difficulties of getting the right parameters for the GET_INSTANCE method.

Thanks and kind regards, Jochen

0 Kudos

Hello Jochen,

as I understand the requirement you want to use the standard key date (no customizing -> SY-DATUM) you get in I_DATETO (in GET_INSTANCE) and the version BUDGET or FORECAST to determine another key date to be used in derivation:

BUDGET: determine current year C_YEAR from I_DATETO and use 01.01.C_YEAR

FORECAST: determine current year C_MONTH, C_YEAR from I_DATETO and use 01.C_MONTH.C_YEAR

My first idea was to extend the standard class CL_RSPLS_CR_MASTER_DATA in such a way that I_DATETO is used as a key in the table to buffer the instance (P_TSX_INSTANCE); this is not the case in the standard so you have to implement your own helper class. Then your exit in DERIVE might simply determine the key date to be used from the record an then dispatch the call to the correct instance of the extended class.

Another idea is to check the implementation of CL_RSPLS_CR_MASTER_DATA, DERIVE and to copy the code to your exit that you need (determine key date from version and call P_R_READER->FIPT_TRANSFORM). How to create an instance of P_R_READER can be found in the CONSTRUCTOR.

Remark:

I_DATETO contains the planning key date (central settings key date) when your exit class is called by the system.

Regards,

Gregor

JochenRaab
Explorer
0 Kudos

Hello Gregor,

to clarify our requirements: we have one cube on which we plan both forecast and budget. In the planning query, we have a customer exit variable, in which the planner can enter the planning year. This planning year should determine the master data key date and does so already for the query key date. Depending on whether the planning year variable is for FC or budget, the key date is 01.01. (budget) or 31.12. (FC) of the planning year.

If I understand you correctly, I need to retreive the entered value from the year variable and then call the CL_RSPLS_CR_MASTER_DATA->GET_INSTANCE in the FM of our variable determination (Step 2) and the returned instance will be used for the validation?

Thanks and kind regards, Jochen

Answers (0)