How to change characteristic values using Integrated Planning
Purpose – There is one Input Ready Query which is used inside WAD. Using this IRQ users will update one column called “Segregation of Duties(SoD)”. Maximum time we have seen IRQ for updating keyfigure/Formula and we can get help as well incase we stuck somewhere. However it may possible that there is a requirement of updating characteristic values. This excercise will explain you what necessary adjustment require to update chars value. using this report basically users can update three fields – SoD, Change By, Changed On
Objects Impacted –
There are various objects which get impacted –
3. Aggregation Level
4. Planning Function
5. Function Module
6. Planning Function Type
7. Bex Query
8. Bex Query Variable
Detailed Steps –
There will be one Input Ready Query (IRQ) built on aggregation level “ZGRC_AL01”. This aggregation level is built on top of multiprovider “ZGRC_M001”.
As there is a requirement to flexible change the characteristic value for infoobject “Action to SoD”, thus there is a need to create a generic planning function type which will repost the characteristic value.
Under Planning Function, use three characteristics under “To Characteristic Usage”. These three characteristics to be used as Target for repost are –
Basically values of these three characters will get change using repost function.
Planning function type “Z_VAR_REPOST” uses class “ZCL_VAR_REPOST”. In this class we have overwritten method “IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE”. This method is generic in nature and capable of changing any characteristic value for selected rows.
So here, we are covering four important steps –
1. Create New Planning Function Type
2. Create Real-time cube, Aggregation Level & Planning Function
3. Create Bex Web Application
4. Modify the ABAP Exit for Changing the Selection
Step 1 – Create new Planning Function Type
Using SE80, create new plannign function type “Z_VAR_REPOST” using class “ZCL_VAR_REPOST”. In this class we will overwrite one method
Post this code to the empty method –
l_r_data TYPE REF TO data,
l_r_param_data_sel type ref to IF_RSPLFA_PARAM_DATA_SEL,
l_t_sel type RSPLF_T_CHARSEL,
l_t_sel_2 type RSPLF_T_CHARSEL,
l_s_sel type RSPLF_S_CHARSEL,
l_s_sel_2 type RSPLF_S_CHARSEL,
l_last_iobjnm type RSIOBJNM,
l_tabix type i.
<f> TYPE ANY,
<l_s_data> TYPE ANY,
<l_th_data> TYPE ANY TABLE.
* create the work areas
CREATE DATA l_r_data LIKE LINE OF c_th_data.
ASSIGN l_r_data->* TO <l_s_data>.
CREATE DATA l_r_data LIKE c_th_data.
ASSIGN l_r_data->* TO <l_th_data>.
CALL METHOD I_R_PARAM_SET->GET_PARAM_DATA_SEL
I_PARAM_NAME = ‘TARGETS’
R_R_PARAM_DATA_SEL = l_r_param_data_sel.
CALL METHOD L_r_PARAM_DATA_SEL->GET_T_SEL
R_T_SEL = l_t_sel.
*check whether we have new SINGLE ENTRIES and delete other entries
loop at l_t_sel into l_s_sel.
* if we have a new iobjnm
check l_s_sel-iobjnm <> l_last_iobjnm.
* check whether the next entry is for the same characteristic
l_tabix = sy-tabix + 1.
read table l_t_sel index l_tabix into l_s_sel_2.
if sy-subrc <> 0 or ( sy-subrc = 0 and l_s_sel_2-iobjnm <> l_s_sel-iobjnm ).
* no next of the same characteristic.
if l_s_sel-sign = ‘I’ and l_s_sel-opt = ‘EQ’.
insert l_s_sel into table l_t_sel_2.
l_last_iobjnm = l_s_sel-iobjnm.
l_t_sel = l_t_sel_2.
How to Flexibly Change Characteristic Values and Comments in BI Integrated Planning in BI IP
November 2009 20
LOOP AT c_th_data INTO <l_s_data>.
loop at l_t_sel into l_s_sel.
assign component l_s_sel-iobjnm of structure <l_s_data> to <f>.
<f> = l_s_sel-low.
Collect <l_s_data> INTO <l_th_data>.
c_th_data = <l_th_data>.
So now after this we will create planning function type using t-code rsplf1.
Click on “Create” button, there in Property tab specify the class ZCL_VAR_REPOST. So we finish with creating planning function type.
Step 2 – Create Real-time Cube, Aggregation Level and Planning Function
In order to get the Input Ready work, Infocube should be Real-Time. One more thing as there is a requirement of Input Ready, so we need one Input Ready Query. This query can not built on simply Infocube. Either my query should built on Multiprovider or Aggregation Level. Here in this case I created IRQ on Aggregation Level.
IRQ can be built on –
1. Aggregation Level
This cube has three main characteristics whose values we would like to change using IRQ. These three chars are – Action to SoD, Change By, Change On. Action to SoD is master data/texts type.
Use RSPLAN t-code to create Aggregation Level, Planning Function. While creating planning function use the planning function type created in Step 1. We have to create three variables as well under tab “Planning Function”. Select these three charcaters as part of Target for Repost.
While creating IRQ, please make sure that this option in Bex Query Designer is checked –
Step 3 – Create Bex Web Application
The Web Template “ZTEST_WT001”using following controls –
• Analysis Grid (ANALYSIS_ITEM_1)
• DropDown Box(DROPDOWN_ITEM_1)
• Button Group (BUTTON_GROUP_ITEM_1)
Here I have created three data providers inside web template –
• DP_TABLE (source for this provider is IRQ itself ZIRQ_GRC_M001_IRQ01)
• DP_SELECTION (source for this provider is IRQ itself ZIRQ_GRC_M001_IRQ01)
• DP_ACTION (source for this dropdown is Z_ACTION infoobject)
Source for Analysis Grid is DP_TABLE data provider. Row Selection behavior should be multiple.
Source for Dropdown Box is DP_ACTION. This dropdown will display all Action to SoD data stored as Master Data for infoobject Z_ACTION.
Under Data Binding section, select DP_ACTION as the Data Provider and characteristic should be Z_ACTION.
For Button Group, use the caption as Save and under Action section, chose Command via Wizard . Click on button next to Commands row.
Sequence of command to be executed are –
Command – SET_SELECTION_STATE_BY_BINDING
Under data provider affected section, select DP_SELECTION
Press Next button. Provide infoobject names displayed in the query under Data Binding section.
Command 2 – EXEC_PLANNING_FUNCTION_SIMPLE
Under this command, select DP_SELCTION for Reference to Data Provider of Type Filter section. Also provider planning function created in previous step “ZGRC_PF01”.
Using this Web Template, we are trying to change three parameters –
• Action to SoD
• Reviewers ID
• Changed On
Under this command, we need to provide the variable name which we have created during planning function ZGRC_PF01.
Variable = ACTION_TO_SoD
For variable ACTION_TO_SoD, select variable type as Binding Type (SELECTION_BINDING), Binding Type should be Data Provider Selection. Under Data Provider Selection, chose Data Provider as DP_ACTION and Characteristic should be Action to SoD infoobject Z_ACTION.
Variable = VAR_UNAME
Chose variable as “VAR_UNAME”. As this variable is a customer exit and brings the sy-uname thus under variable type chose Value Set Variables .
Variable = VAR_CDATE
This covers the development of WAD Template.
Step 4 – Customer Exit
Goto SE80/SE37 and create function module, let say in this case Z_DEL_SEL. This function module basically takes user input and tries to modify with value entered/selection by user. In this case user chooses Action to SoD from dropdown and when he clicks on button group repost, then this exit gets called.
Remember one thing, you need to register this function module using report “SAP_RSADMIN_MAINTAIN”. To get the code template you can also refer –