In the Planning Tool SAP BPS there was the option to enter Plan-Data for Characteristics which were not present in the SAP BW. With SAP IP this is no longer possible and any attempt to enter new Master Data into Planning Queries fails since a background validation of the entered values against the master data tables (/BIC/S*) is performed.
The solution described below shows a way to overcome this limitation by the creation of an own Master Data Read ABAP Class allowing to enter new master data in planning queries.
The idea behind the solution described in this document came up from several posts in SDN Forum.
The business departments want to plan their investments with SAP IP and enter a short description for each Investment. In general this will not work, since the SAP BW does not have master data for the description:
So we have to provide a solution where the End-User can add free text into the field Invest Description.
This requirement can be fulfilled with the help of an own ABAP Class. The steps to achieve this are listed below:
Step 1: Create Master-Data ABAP-Class
a. This really easy. Just go to the transaction SE80 and create an own ABAP Class which is based on the Super class CL_RSMD_RS_BW_SPEC.
b. The next step will be the creation of an additional Attribute for taking the text. Let’s call it G_ALLOWED_CHAR.
c. Create the method “Constructor” which has the following parameter
d. Coding of method constructor
CALL METHOD super->constructor
i_chanm = i_chanm
i_infoprov = i_infoprov
i_langu = sy–langu.
DATA: l_iobjnm TYPE rsd_iobjnm.
l_iobjnm = o_chanm.
CALL FUNCTION ‘RSD_COB_PRO_GET’ “_ALWAYS needed -> ***.BW Reading Module InfoObjs in Cube
i_iobjnm = l_iobjnm
i_infocube = i_infoprov
i_with_atr_nav = rs_c_false
e_s_cob_pro = o_s_cob_pro “Needed by Get Values method
OTHERS = 1.
* Add the entered values of the user to the allowed characteristic values
CALL FUNCTION ‘RSKC_ALLOWED_CHAR_GET’
e_allowed_char = g_allowed_char.
e. Redefine Get Values Method
The next step will be the redefinition of the Get_Values Method:
The coding must be adapted:
DATA: ls_chavlinfo TYPE rsdm_s_chavlinfo,
l_offset TYPE i,
vla TYPE /BIC/SZINV_T1.
"Translate Char Value to Upper Case
TRANSLATE ls_chavlinfo-c_chavl to UPPER CASE.
FIELD-SYMBOLS: <ls_selopt> TYPE rsmd_rs_s_selopt.
CALL METHOD super->if_rsmd_rs_access~get_values
i_t_selopt = i_t_selopt
i_maxrows = i_maxrows
i_t_sorting = i_t_sorting
i_ts_req_attr = i_ts_req_attr
e_t_chavlinfo = e_t_chavlinfo
e_tx_atr = e_tx_atr.
* o_chanm is the InfoObject itself
* If a value does not exist in the SID-Table, the Table
* e_t_chavlinfo is empty.
* The new value will be added manually to the table.
* A SID is not required.
IF e_t_chavlinfo IS INITIAL. " Value not found in SIDs
LOOP AT i_t_selopt ASSIGNING <ls_selopt> WHERE iobjnm = o_chanm
AND sign = ’I’
AND option = rs_c_range_opt-equal.
* <l_s_selopt>-low contain the entry of the User
ls_chavlinfo-c_chavl = <ls_selopt>-low.
* With the Coding below you can stripe out not allowed chars
* WHILE l_s_chavlinfo-c_chavl CN g_allowed_char.
* CLEAR l_s_chavlinfo-c_chavl+sy-fdpos(1).
INSERT ls_chavlinfo INTO TABLE e_t_chavlinfo.
Step 2: Create Info Object
Create an InfoObject type CHAR and allow lowercase letters. The InfoObject should not contain any master data.
Step 3: Create Web Template
Now a Planning Layout must be created allowing to enter new rows (option of Analysis Web Item). Before we can start creating a suitable Web Template we must have a Planning Query. However this is not a part of this How To. If you have questions about creating planning applications with SAP IP you may have a look at SAP Help.
At the end the Users can enter free defined Investment Descriptions into the Planning Query:
Beside the Scenario which is mentioned above, you can use this enhancement to create new master Data in standard Info Objects. For this you can use the entered Value of the User in “<ls_selopt>–low” and use it to generate new Master data Entries in your standard Object with SIDs and other Master Data Information.
With this adaption scenarios like the one below are thinkable:
There is one planning application where the user enter maintain the Product master data and could add new products to the sales planning application. This can be done within the GET_VALUES Method.
But be careful with those functionalities since the danger of contaminating the master data of your original Info Object is present. For this reason it makes sense to mark all ‘planned’ products with a special naming convention and Source System information like illustrated above.
(also published on http://sap-user-blog.com)