Let us consider a scenario where we have data slice based on any characteristic selection.
This data slice is activated, but in some cases you want key user to be able to deactivate data slice, repair some locked data and activate it again.
To achieve this functionality we will create function module that activates/deactivates data slice by updating RSPLS_DS table.
This function module will be called from simple FOX formula within IP.
Final product will be page (web or workbook based) for key user with 2 buttons (activate and deactivate data slice).
Create function module for activation/deactivation:
1. Goto SE37 and create function module (Z_DATA_SLICE_CHANGE_STATUS)
2. Navigate to tab “Import” (parameters imported to your FM) and enter the following parameters:
This function module gets the next parameters:
- 1. InfoProvider technical name.
- 2. Data slice number.
- 3. Indicator for activation or deactivation of data slice.
3. Navigate to tab “Source code” and enter the next code:
This code activate data slice if I_STATUS=1 and deactivate if 2 (1 or 2, technical name of InfoProvider and data slice number passed from FOX Formula).
4. Activate this function module.
I assume you already created data slice in IP Modeler in InfoProvider tab.
Create planning function for data slice deactivation in Integrated Planning
- Run TC RSPLS.
- Goto “Planning Functions” tab and create new function type of Formula.
- Add next FOX code:
In FOX formula use statement CALL FUNCTION with function module Z_DATA_SLICE_CHANGE_STATUS and pass to the function InfoProvider name, data slice number and deactivation flag (I_STATUS = 2).
Create planning function for data slice activation in Integrated Planning
Process the same steps as above, but pass to the function module another value of activation flag (I_STATUS = 1).
To use this function module in FOX formula it is necessary to add the technical name of the function module in transaction SM30 to RSPLF_FDIR table.
Now, according to your user interface type (WAD or workbooks), create 2 buttons (one for activation and other for deactivation) and attach planning functions (or planning sequences if needed) to these buttons accordingly.
The next blog will describe how to activate/deactivate data slice at runtime of planning function/sequence execution.