cancel
Showing results for 
Search instead for 
Did you mean: 

How to get planning function in customized data slice?

Former Member
0 Kudos

Hi all,

we are using a customized data slice which implements IF_RSPLS_DATASLICE. Now we have the requirement that the data slice only protects the data when it calls via query. The data slice will not protect data if a planning function is executed. How can we implement this requirement? Is it possible in the method IF_RSPLS_DS_METHODS ~ IS_PROTECTED to read this information from an instance of the planning function (CL_RSPLS_CR_CONTROLLER?) or the buffer or something else? Or can we find some information about the query?

At the moment we only check if a planning sequence is called by a process chain. This works fine

IF sy-batch IS NOT INITIAL.
    e_noinput = rs_c_false.
    EXIT.
  ENDIF.

Thanks for your help!

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

I think this topic was already discussed in this forum.

By design, it should not matter whether a query or a planning function is not allowed to change records. This is what data slices were designed for.

OK, you need a different behaviour.

1. Maybe you can detect from the planning function filter or query filter whether you run function or a query. If this is the case use the method IS_OVERLAPPING of the data slice. There you get the filter as a I_TSX_SELDR or as a range table when you call SELDR_TO_RANGE. When you return r_is_overlapping = rs_c_false. the data slice will not be called.

2. Another option is to call the factory of the data slice and to use a flag in the data slice that indicates that the data slice is used in the context of a planning function. The factory method is GET_INSTANCE. Set a break point there to find out how the system calls this method. But when to call the factory? Check note 1101726. This note provides infrastructure to change the filter of a planning function at run time. But you can use this exit to call the factory method mentioned above. The nice thing is that you can raise the excpetion EMPTY in the exit, thus the function will not be called. So use a planning sequence with dummy1, your function, dummy2. For dummy1 switch on flag on, raise EMPTY, dummy1 will not be executed (almost no run time is needed), then 'your function' will be called (do nothing in the exit', then function dummy2 will be called, here switch the flag off again.

Check also the following link where the above technique is used to for the conditional execution of planning functions:

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0785271-1446-2d10-6987-d1e44f08e97c

Regards,

Gregor

schmidhnx
Explorer
0 Kudos

Hi Gregor,

I found your response when searching for IF_RSPLS_DATASLICE regarding this (old issue) I have additional Questions.

Maybe you can help me. My scenario is as the following.

I have a DSO used for lanning. inside this DSO I have historic Data (HIST) and actual Data (ACT).

The ACTdata should always be editable using an input ready query.

HIST data should be locked and only be shown in input ready query as a help for the planner.

So this I can easily do by implementing and activating a data slice on my DSO for HIST.

But now I want to do the following.

At the end of month I want to move ACT data to HIST data using copy function. To be able to do this I have to deactivate the data slice (manually)

Now I want to autmate this. So my guess is to implement my data slice with the use of exit class.

So my question is. When I use the exit class can I do a check for which planning function is running actually on my DSO?

And when yes is it possible to deactivate the data slice only for a special planning function (in my example copy function and for all other planning functions or input ready query HIST data will be locked.

Or is the exit class not designed for such a scenario?

If my issue can be solved using exit class. Could you rovide some samle code or do you now a ressource where to get some?

in the postings I read from you it seemed to me that you have already had the same problem/issue and that you had implemented a solution for this problem.

So it would be very nice to get some Feedback from you.

Very best regards

Timo