In Use debugger scripts to list component/view enhancement information, We have introduced a debugger script using which we can list component enhancement information. We also described how to use the debugger script when displaying a service request. It is the same when we navigate to menus like ‘Sales cycles’, ‘service operations’, ‘Inbox’, ‘Knowledge Search’ … from navigation bars, when going to the document details from result lists, etc.
However, when the WebUI page is loaded initially, there are some differences:
- Method CL_BSP_WD_COMPONENT_DESCRIPTOR-> constructor will be called not only from method CL_BSP_WD_VIEW_MANAGER->DO_REQUEST, but also from method CL_BSP_WD_APPL_CONTROLLER->DO_INIT. Thus we need to set breakpoints in both of these two methods.
- There will be two debug sessions during debugging. CRM WebUI will be loaded after both of these two debug sessions have been finished.
In this article, I will show you where to set breakpoints, how to run debugger script ZSCRIPT_ENH_LIST in less breakpoint stops.
Select a business role, it will stop in default page like ‘Identify Account’.
- Set breakpoint in line 18 in method CL_BSP_WD_APPL_CONTROLLER->DO_INIT.
- Set breakpoint in line 296 in method CL_BSP_WD_VIEW_MANAGER->DO_REQUEST.
- From WebUI, select a business role.
- Now we can see two debug sessions up. In both of them, the breakpoints stop at line 18 in method CL_BSP_WD_APPL_CONTROLLER->DO_INIT.
- We can start from any one of them, go to ‘Script’ tab, select the ‘ZSCRIPT_ENH_LIST’. Then click ‘Start Script’ button.
- Wait for a while, the breakpoint will stop at line 296 of method CL_BSP_WD_VIEW_MANAGER-> DO_REQUEST. Now we click ‘Exit Script’ button.
- Then we go to ‘standard’ tab, we can see where the breakpoint is now. Click ‘F8’ or ‘Continue’ to finish the current debug session.
- Now only one debug session is left.
- The same, go to ‘Script’ tab, select script ‘ZSCRIPT_ENH_LIST’, and click ‘Start Script’ button.
- The script stops again. Click ‘Exit Script’ also.
- If we go to ‘standard’ tab, we can see where the breakpoint is. Click ‘F8’ or ‘Continue’.
- Page is loaded.
- Now go to T-code SAS, we can see two traces instead of one because we have executed the script twice since we had two debug sessions.
- Two traces have different content.
If the script has been executed and ended, we can click ‘F8’ or ‘continue’ directly to finish all the left executions. We can save one step and don’t need to navigate to ‘standard’ tab. For example:
- The script has been executed. We click ‘Exit Script’ button.
- In the next screen, we click on F8 or Continue directly.
- A dialog will pops up asking if we want to run the ‘script’ again or ‘continue’ the debug. We select the 2nd button ‘Continue(F8)’. This operation is the same as we navigate to ‘standard’ tab and click ‘Continue’ button.