Skip to Content
Author's profile photo Former Member

Integrated Planning – how to activate/deactivate data slice at RUNTIME

In one of my blogs (Integrated Planning – how to activate/deactivate data slice) I described how to activate/deactivate data slice in Integrated Planning using customers Z function module called within FOX formula. This technique usefull only for key user and requres restart of planning application, which not always possible or suitable for planning process.
This blog describes how to activate/deactivate data slice at RUNTIME of planning function/sequence.
Let us consider a scenario where we have records marked as LOCKED or UNLOCKED (with any infoobject) and data slice activated on locked records. At the beginning of planning process user updates data (this data marked as unlocked) and at the end he should lock this data by copying records to locked. The challenge is to make possible copying to locked, because data sclice activated on locked data and planning application will give an error. In this blog I’ll describe a solution that makes possible to deactivate data slice for specific steps in planning sequence.
General schema of implementation
1. Creating class which reads LOCK/UNLOCK command and according to this command our code will activate or deactivate data slice.
2. Creating custom function type in IP based on class.
3. Creating planning function based on our custom type. This function type will send command LOCK/UNLOCK to data slice.
4. Creating planning sequence with the next structure: Execute planning function for manipulation of locked records. -> Activate data slice.
5. Creating data slice based on class in IP Modeler. 
Detailed implementation  
Use TCode  SE24 to define a custom exit class. Set superclass to CL_RSPLS_DS_EXIT_BASE class.
Create your own method for implementing locking logic.
Define parameters to the MY_DATASLICE method.
1. I_S_DATA : input data
2. E_T_MESG: messages
3. E_NOINPUT: A Boolean flag. If you want to protect the cell, the set this parameter to X, otherwise leave the parameter blank. image  
Example of custom logic: You want to lock all lines that have marked “Locked” by MD of InfoObject Z_LOCK_IND.
In method MY_DATASLICE apply following code:  
DATA: l_msg TYPE if_rspls_cr_types=>tn_s_mesg .  
IF i_s_data = ‘00001’.    
l_msg-msgid = ‘RSPLS_CR’.     l
_msg-msgty = ‘E’.    
l_msg-msgno = ‘019’.    
l_msg-msgv2 = ‘0001’.   
APPEND l_msg TO e_t_mesg.  
e_noinput = rs_c_true.  
i_s_data contains line value of IO Z_LOCK_IND. If line locked (value = 1) message appears and no input allowed (e_noinput = true). Redefine the standard method IF_RSPLS_DS_METHODS~IS_PROTECTED to include buffering and the data slice switch. image
Add to this redefined method code in appendix A.Save the class and activate it.   For writing command LOCL/UNLOCK define class ZCL_MAINTAIN_DATASLICE for the switching function. Add the interface IF_RSPLFA_SRVTYPE_IMP_EXEC_REF to this class. image
Redefine next methods without adding any code (just redefine and save): IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~INIT_EXECUTION IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE Redefine method IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL and add code in appendix B. In this method you get the command from planning function (LOCK or UNLOCK) and store ti to SAP memory. This command will be read by IS_PROTECTED method as described above. Save the class and activate it.   Create InfoObject with master data LOCK and UNLOCK values: image
Create function type for switching data slice. Use transaction RSPLF.Set the next properties in function type: image
Go to the Parameter tab. Right-click the Parameter field to add an elementary parameter called COMMAND passed by InfoObject early created (with LOCK/UNLOCK master data).
Save and activate the function type.   Create planning function of type early created type for unlocking data slice. image
In parameter COMMAND select UNLOCK.
This function will deactivate data slice. Planning sequence should have next structure:
1. Deactivate the data slice.
2. Execute your function for manipulating locked records.
3. Activate the data slice (build this function similarly to deactivation function but with LOCK parameter).
Create data slice based on you own class.  Open modeler and navigate to InfoProvider – > Data Slice. Press Cerate and choose in “Data Slice Based On” “for an exit class” parameter.
At “Exit Class” choose your early created custom class.
In “Characteristics that are restricted by the exit class” choose your characteristic(s). image
Data slice should be active by default.

Save your data slice.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      I never thought about a solution like this.
      This is just what I need now.


      Author's profile photo Former Member
      Former Member
      your solution works fine, my requirement is to pass Data slice Characteristics values dynamically. Can I define Variables (for data slice Chars..) if so how..?


      Author's profile photo Former Member
      Former Member
      We have around 10 reports built into a web template. The selections for the web template is Region and Fiscal Period
      Each report is restricted to a particular Business Division ( lets say 1 to 10 )

      Each report in the web template has a button "POST". The requirement is when the user clicks this button, the data in the current report should be locked. Say for example Business Divison = 5, fiscal Period ( selected by User ) = 10/2011, and Region ( selected by User ) = Texas.

      We wouldn't know what region the user will use as a selection. We have around 40 to 50 regions and its not a good idea to create n number of dataslices considering Region, Fiscal Period, Business Division combinations.

      Hence we want a dynamic solution.
      The dynamic solution should have custom data slice ( as per your web log in link 2 ) and it should operate based on what the user has selected.

      I have created 10 Filters in the modeler with single hardcoded values for Business Divison and two variable for Region and Fiscal Period.

      Intention is to use these filters and a planning function ( lock/unlock ) and use buttons to lock the data.

      Is it possible to achieve above using the custom dataslice?


      Author's profile photo Former Member
      Former Member
      I have the Same senario. did you able to do it. If so let me know hoe
      Author's profile photo Former Member
      Former Member


      Very Informative blog. Thanks for sharing.

      Currently we are facing Authorization issues while activating and deactivating data slice for users.

      The data slice gets needs to get activated and deactivated for certain planning sequences which are called in SAP Analysis Office 1.4 SP9 version.

      The planning sequence is called by the particular user. The issue faced is that users do not have 0BI_ALL authorizations.

      Is there any particular authorization to activate and deactivate data slice? We have tried with S_RS_ICUBE auth. But yet the issue remains.



      Author's profile photo B. Struijk
      B. Struijk


      Thank you very much for this clear explanation.
      It was very helpful for me.
      As an IP consultant I am a mediocre abap-er and I could clearly understand your blog.

      For all people working with Integrated Business Planning (IBP) on S4/HANA I would like to add a comment. I took me half a day and an evening sweating to find out, so by sharing I hope it may save you time and sweat :-).

      Using CL_RSPLS_DS_EXIT_BASE as superclass did not work for me in our S4/HANA system with IBP functionality.
      I did get correct lock messages, but the data was not locked in input-ready queries.
      I tested my query with transaction RSRT, I saw the lock was set, but still the data was input ready.

      Then I did exactly the same with CL_FCOM_IP_DS_EXIT_BASE as superclass.
      Then it worked perfectly fine! The data was locked exactly as required.

      Of course, there are several ways to do this.
      As a starting point I copied class CL_FCOM_IP_DS_EXIT_BPC_BASE.
      There were plenty more examples in my system with a similar name.
      There was already an active dataslice type exit with this class in my system.

      Be aware, when I copied class CL_FCOM_IP_DS_EXIT_BPC_BASE I got errors on the Test Implementation. I commented all the code for the test implementation.
      You can go there with one of the big buttons on the top right called 'Local Test Classes'.

      I created my own method using method CHECK_CATEGORY as an example.
      Method CHECK_CATEGORY comes from class CL_FCOM_IP_DS_EXIT_BPC_BASE.

      Additional information:
      I created a Z-table for the locking.
      With the SE11 Table Maintenance Generator (menu: Utilities) I created an SM30 maintenance view.
      With transaction SE51 Layout Editor I adjusted the table width, the column widths and column titles.
      One column was an indicator column (char1, X=yes, Space=no). I converted it's display to a checkbox choosing from Layout Editor menu: Edit -> Convert -> Checkbox -> Left Button.
      In the new method I read the values from this lock table and set the value of the eb_noinput variable accordingly.

      That's it.