Tips and Tricks while working on BW TPM
While working on TPM BW we faced few issues and I have documented some of them below along with the solutions.
1. Planning Events
RSCRM_EVENTCUST is the transaction code that is used to define the events for the different CRM Web-UI Queries.There are two types of Planning Events:
a. Standard Planning Events
As you can see from the above list Planning Events 1, 2, 3, 4 are all standard planning events.Before Synchronization(1) – This event gets called immediately when you click on any plan.
Before Save(2) – When the user clicks on Save button in the Plan screen, before saving the plan data, the event will get called.
After Update Cell(3) – Whenever any value is changed on the plan screen, the After Update cell event gets called
Before Query Execution(4) – Before the BEx Query is executed, this event gets called.
To debug the exact timing when the events get called, you can put a break point in the class CL_RSCRM_IMP_OBJECT and method HANDLE_EVENT.
You can check the variable iv_event_id and the planning functions will get populated in the table lt_planning_functions based on the definition in RSCRM_EVENTCUST entries.
b. Manual Planning Events
Press the Icon at the right most bottom part of the layout ->Update Plan Scenario
See below SPRO screen in CRM System.
As shown above the description that you see here can be seen on the plan screen, when you click on Update plan scenario.
So, whenever user clicks on let’s say “Copy Previous Year Estimates”, then Manual Event ID 11 is triggered and the planning function corresponding to this Event ID 11 is called based on the definition in RSCRM_EVENTCUST.
2. Debugging Planning Functions
If you have created a Custom Planning Function using a Custom Planning Function Type, the code will be written in a AMDP based Class and method. It will not allow you to debug this method directly from the GUI.
In this scenario, you can put a break-point in the Eclipse in the method code and debug the entire code to check the values at each and every step.
You can right click at any step in the method and Select Toggle Break-point.
And when you execute the Plan from the CRM Web UI screen, the eclipse debugger will stop at this point in.
3. Addition of New Fields to Aggregation Levels
If you add new fields to the aggregation level, then you might start getting PE errors in the Plan.
Remember that this PE Error corresponds to new fields present in the aggregation level, but not being added to the planning functions.All the planning functions that are based on the aggregation level, and the classes related to those planning functions will have to be adjusted. The classes have local or global structures defined which are data types for the tables I_VIEW and E_VIEW. These structures will have to be adjusted with the new fields added to the aggregation level.
You can also check the logs in SM21 and it will show exactly the name of the field which is causing the issue.
As shown above it points to the attribute/keyfigure Z___5077. This number 5077 can be put in the table /BI0/RIOBJNM below to know the exact name of Infoobject which is causing the issue.
If you face any other errors in the CRM Plan layout, you can debug the standard classes and check the exact method/statement when the error is generated. Generally all the methods have a standard message internal table et_messages, which gets populated with a long text of the error message. This can help you to identify the exact root cause of the error message.
4. Promotion Data not getting reflected in the Plan
Its standard functionality for the promotion related data to get rolled up at the Plan level.
There are planning functions that copy the data of the Promotion to the Shadow DSO IPST and from the Shadow DSO to the Latest Estimates(ILOTE) DSO.
But these planning functions are triggered only when you change the status of the promotion from “New” to “In-planning” Status. So change the promotion status to In-Planning and save the promotion. Refresh the plan again to check if the promotion values got rolled up to the Plan.
If you face any issues related to the promotion data getting rolled up to the Plan level, you can put a break-point in the Class /JBPC/CL_CRM_MKTPL_IMP_UTIL, Method POPULATE_CBP_DSOS to debug the scenario.
5. General Errors/Issues
Sometimes there might be inconsistencies between the CRM and the BW System.For eg. Changes in the BW system or customizing related changes are not getting reflected in the CRM Web UI. In such scenarios you can follow few of the steps below:
- Execute Transaction Code SHMM in both CRM and BW Systems and delete all the entries
- Execute Program /UI5/APP_INDEX_CALCULATE in the CRM system, Select full selection and press execute.
Hope these tips are helpful for everyone working on TPM BW requirements.