Recently I got an opportunity to work on a BW TPM project. Compared with pure BW Modeling project I had to explore things related to Planning, Configuration required in BW and CRM and mainly how and where to debug on encountering errors when executing Queries and Planning Functions from Web-UI. Documenting few points which were helpful during the development cycle.
BW Queries and Planning Functions Execution
When BW Queries and Planning Functions (PFs) are called from CRM Web-UI it might encounter errors while executing them. Error description might not help us to identify the root cause because of which we need to debug Class/Method.One of the important Class related to execution of BW Objects is Class *CL_IMP_OBJECT. Below are few of the Methods from the same related to Query and Planning Function execution.
- IF_IMP_OBJECT~EXECUTE_QUERY – This Method will execute BW Query, we can set Break Point before it’s called to check Filters, Variables etc… being passed.
- IF_IMP_OBJECT~HANDLE_EVENT – This Method will identify which Planning Functions (PFs) to be executed for the selected Query and Event_ID triggered.
- EXECUTE_PLANNING_FCT – This Method executes each of the Planning Function configured for Query and Event_ID identified at HANDLE_EVENT Method.
- ENHANCE_QUERY_FILTER & ENHANCE_EVENT_FILTER – These Methods check and update Query Filters and PF Filters respectively which gets called when executing Queries and PFs accordingly.When we create Custom Planning Function and configure it for say Event 3 (After Update Cell) still it might not get executed on changing data if PF related filter code is not maintained in Methods of Class *CL_RSCRM_IMP_EVENT_PF_B4.Similarly for New Queries check Methods of Class *CL_RSCRM_IMP_QUERY_B4 and maintain Query Technical name like data maintained for Standard Queries.
Types of Custom ‘Planning Function Type’ based on Class
We can have Class ‘Without Reference data’ OR ‘With Reference data’.For Class Without Reference data Interface and Methods would be:
For Class With Reference data Interface and Methods would be:
Method ‘GET_REF_DATA_SEL’ is used to apply filter for selecting Reference data.We can create Public-Static Methods to include Custom logic in With / Without Reference data Interface types.
Identifying which BW Query is mapped in CRM Web-UI screen
In CRM Web-UI click on any of the Query Data cell and press Ctrl + Alt + D
Pop-up window appears in which select ‘Show Data Source Picker’
In the next screen select ‘queryinfo’
Click ‘Esc’ on keyboard, List of queries on the screen selected is displayed.
On encountering IMP_CORE and PE Errors
When we encounter these errors check for logs generated in “SM21”. If no logs exist then go to TCode “RSTT” and Activate Trace for your ID, perform the same action to reproduce error. Later De-Activate Trace for your ID. If Traces are generated, then Execute them to check errors being reported.
Based on the information we can identify which Function Module to set Break Point for debugging and identify the root cause.
Best practice while performing calculation of Keyfigure in Class
When populating Keyfigure based on CASE condition, ensure it also has ELSE part to populate.
Eg: CASE WHEN INFOPROV = ‘ZADSOX1’ THEN ZADSOX1.ZKF1 ELSE 0 END AS ZKF_CUSTOMThough “ELSE 0” might not be logically and syntactically required, include it to avoid potential technical issues which may arise due to populating NULL value into Keyfigure.
Hope this information will help Developers working on BW TPM projects to understand better about Class, Method, TCode to check for identifying root cause of errors encountered. Please share your comments and feedback !!