Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Community
Former Member
April 12, 2010 7 minute read
Introduction
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.
Goal
This blog describes how to activate/deactivate data slice at RUNTIME of planning function/sequence.
Scenario
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 speci c 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 de ne a custom exit class. Set superclass to CL_RSPLS_DS_EXIT_BASE class.
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 1/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 2/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
3. E_NOINPUT: A Boolean ag. If you want to protect the cell, the set this parameter to X, otherwise leave the
parameter blank.
Example of custom logic: You want to lock all lines that have marked “Locked” by MD of InfoObject
Z_LOCK_IND.
Add to this rede ned method code in appendix A.Save the class and activate it. For writing command
LOCL/UNLOCK de ne class ZCL_MAINTAIN_DATASLICE for the switching function. Add the interface
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 3/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
Rede ne next methods without adding any code (just rede ne and save):
IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~INIT_EXECUTION IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~EXECUTE
Rede ne 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:
Create function type for switching data slice. Use transaction RSPLF.Set the next properties in function type:
Go to the Parameter tab. Right-click the Parameter eld to add an elementary parameter called COMMAND
passed by InfoObject early created (with LOCK/UNLOCK master data).
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 4/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
Save and activate the function type. Create planning function of type early created type for unlocking data
slice.
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.
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 5/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
In “Characteristics that are restricted by the exit class” choose your characteristic(s).
y_ _ _ _ _ __ g
= l_s_mesg e_noinput = o_r_protected->*. INSERT <l_s_buf> INTO TABLE
<l_th_buf>. ENDIF. e_noinput = o_r_protected->*.”fix pointer to <l_s_buf>-protected IF
e_noinput = rs_c_true AND e_t_mesg IS SUPPLIED. * o_r_s_mesg is a pointer to
‘_S_MESG’ in the buffer workarea e_t_mesg[] = l_s_mesg[]. ENDIF. ELSE. * no, do
not use the buffer, call a method that returns the * fields e_noinput and e_s_mesg CALL
METHOD my_dataslice EXPORTING i_s_data = i_s_data IMPORTING
e_t_mesg = l_s_mesg e_noinput = e_noinput. e_t_mesg[] = l_s_mesg[]. ENDIF.
ENDMETHOD. Appendix B
IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL code method
IF_RSPLFA_SRVTYPE_IMP_EXEC_REF~GET_REF_DATA_SEL. Data : l_r_param_elem
type ref to if_rsplfa_param_elem, l_unlock(10) type c. CALL METHOD i_r_param_set-
>get_param_elem EXPORTING i_param_name = ‘COMMAND’
RECEIVING r_r_param_elem = l_r_param_elem. CALL METHOD l_r_param_elem-
>GET_VALUE IMPORTING E_VALUE = l_unlock. Export COMMAND from l_unlock to
memory id ‘DATA_SLICE_LOCK’. endmethod. </body></body>
Alert Moderator
Assigned tags
Related Questions
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 6/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
5 Comments
Former Member
Hi,
I never thought about a solution like this.
This is just what I need now.
Thanks,
Matthieu
Like (0)
Former Member
Hi,
your solution works ne, my requirement is to pass Data slice Characteristics values dynamically. Can I de ne
Variables (for data slice Chars..) if so how..?
Thanks,
Madhu
Like (0)
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, scal Period ( selected by
User ) = 10/2011, and Region ( selected by User ) = Texas.
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 7/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
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.
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 lters and a planning function ( lock/unlock ) and use buttons to lock the data.
DV
Like (0)
Former Member
I have the Same senario. did you able to do it. If so let me know hoe
Like (0)
Former Member
Hi,
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 O ce 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.
Regards,
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 8/9
3/25/2020 Integrated Planning – how to activate/deactivate data slice at RUNTIME | SAP Blogs
Priyanka
Find us on
Newsletter Support
https://blogs.sap.com/2010/04/12/integrated-planning-how-to-activatedeactivate-data-slice-at-runtime/ 9/9