Debugging in BPC 10(在BPC 10.0中如何调试代码)
Author: Daniel settanni
Debugging in BPC 10
In my opinion the ability to debug is one of the biggest advantages in the BPC for NetWeaver platform. It has proven to be a huge asset when writing custom logic (BAdi’s and custom integration scenarios) in addition to general troubleshooting tasks.
The good news is that the latest release of BPC for NetWeaver (BPC 10) also allows you to debug the BW tier but there have been a couple of changes that you need to be aware of:
- The .NET tier has been removed from the 10.0 release of BPC for NetWeaver. This means you don’t have to map accounts on the .NET tier to enable debugging anymore.
- The entry point for debugging has changed
After reading this (short) blog you will be prepared to debug BPC 10 for NetWeaver to your heart’s content.
Let’s get started…
Setting up your debug user
The only thing you need to start debugging BPC 10 is a valid BW user account with the same access as the BPC BW System Account. You can find the required roles in section 4.1 of the Installation guide.
Once that is complete, grant the user the appropriate rights to the environment / model (application set / application) and set your breakpoints.
Where do I set my breakpoints?
There has been a pretty good amount of rework in the UJ package for BPC 10 and this has also impacted where you need to set your breakpoints. I’ll cover two different scenarios below, debugging EPM Add-In and Administration functions and debugging data manager packages.
Debugging EPM Add-In and Administration functions
- Log into the BPC client you want to debug (EPM Add-In or Web Administration console) with your BW debug user account.
- Go to the portion of the use case you want to debug, but don’t execute the action yet.
- Log into SAPGUI with your BW debug user.
- Go to transaction SE80
- Navigate to the class CL_BPC_REST_RES (under package UJX, embedded package UJX0).
- Go to line 56 of the HANDLE_REQUEST method and set an external breakpoint.
- Note – If you know the specific location you want to debug you can set the externalbreakpoint there and skip the breakpoint mentioned above.
- Switch to the BPC client and execute the action you want to debug.
- This will launch a SAPGUI debugging session
- The case statement on line 60 will get you to the code you need to evaluate.
![image](https://weblogs.sdn.sap.com/weblogs/images/251873348/debug_dm_ujxd.png)
Debugging Data Manager Packages
- Log into SAPGUI with your BW debug user.
- Go to transaction SE80
- Navigate to the class CL_UJXD_PACKAGES_RES (under package UJX, embedded package UJXD).
- Go to line 179 of the DO_POST method and set an external breakpoint.
- Switch to the BPC client and execute the data manager package you want to debug.
- This will launch a SAPGUI debugger
- Double click on the ‘ls_package_run-if_debug’ exporting parameter and set its value to true (represented by the character X).
- You can then continue to any downstream external breakpoints you already set (for instance, in your BAdi) or can step through the code line by line.
Happy Debugging!