What’s simple and easy way to debug ESS and MSS Web Dynpro Java applications?
How do we
read the context values at runtime from Web Dynpro FPM applications?
How to
determine the actual content of a certain context node or attribute?
We have a
simple way to debug and determine the values of the context variables by
switching on the debug mode by passing application parameters to the ESS and
MSS Web Dynpro Java based applications. We have to pass the *sap.xss.debug *as application
parameters to the Web Dynpro FPM applications so that the context display is
activated.
This is how the
debug information is displayed.
!https://weblogs.sdn.sap.com/weblogs/images/251732588/WD_With_Debug_Context.jpg|height=390|alt=Web Dynpro Application with Debug Context|width=656|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/WD_With_Debug_Context.jpg!
We have to
pass the URL parameter sap.xss.debug=t or sap.xss.debug=yes when we start the ESS
& MSS Web Dynpro applications for switching on the framework’s context debugger
on.
Note: The parameter sap.xss.debug
is a case sensitive. It should always be used in the lower case to switch on
the debug mode.
Let’s take the
Personal Data ESS application of China as an example and see the
various ways to switch on the debug mode. The Web Dynpro for this is sap.com/esscnpdata/Per_Personal_CN
/webdynpro/dispatcher/sap.com/esscnpdata/Per_Personal_CN/webdynpro/dispatcher/sap.com/esscnpdata/Per_Personal_CN?sap.xss.debug=t
Note: Launching the WD
Application directly by URL is the preferred choice for enabling context display.
*
*
We can enable
debugging option by passing sap.xss.debug=t as Application Parameters in the iView
properties.
Note: If we add it to the iView
properties, all the users accessing this iView will be seeing additional debug
information.
!https://weblogs.sdn.sap.com/weblogs/images/251732588/WebDynpro_iView_paramaters.jpg|height=449|alt=i... parameters for switching on the debug context|width=700|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/WebDynpro_iView_paramaters.jpg!
Let’s see
the output after enabling debug option.
!https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_App.jpg|height=500|alt= Personl Data application with debug option on|width=700|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_App.jpg!
*
*
!https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalDataOverview_DebugInfo_0_0.jpg|height=4... Data Overview with debug option on img1|width=680|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalDataOverview_DebugInfo_0_0.jpg!
!https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalDataOverview_DebugInfo_2_0.jpg|height=4... Data Overview with debug option on img3|width=680|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalDataOverview_DebugInfo_2_0.jpg!
*
*
!https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_Edit_DebugInfo_0_0.jpg|height=499|... Data Edit View with debug option on img0|width=471|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_Edit_DebugInfo_0_0.jpg!
!https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_Edit_DebugInfo_1_0.jpg|height=500|... Data Edit View with debug option on img1|width=471|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_Edit_DebugInfo_1_0.jpg!!https://we... Data Edit View with debug option on img2|width=471|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_Edit_DebugInfo_2_0.jpg!!https://we... Data Edit View with debug option on img3|width=471|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/PersonalData_Edit_DebugInfo_3_0.jpg!
What applications support context debugging
All the ESS
and MSS Web Dynpro Java applications using the FPM framework supports the
context debugging. All the custom applications which are built on using the FPM
framework support it.
debugging
We need to
register the context to the FPM so that the context is available for debugging.
For registering the context, we need use the method:
public void registerContext(IWDNode context)
in the method onInit(…) of the component.
Since the method accepts arbitrary nodes of the
context, we can register parts of the context.
The simplest way to perform the registration (outlined
below) is to use the predefined internal field wdContext as a parameter to
register the complete context of the component.
public void
onInit( com.sap.pcuigp.xssfpm.java.IFPM fpm ) {
//@@begin
onInit()
// Register
context for debugging
fpm.registerContext(wdContext);
//
After we have registered your context, the context
display is activated using the URL parameter sap.xss.debug=t when we start the
application. Each registered context appears as a tree control below the
application perspectives.
By switching
on the context debugging, we will be able to see the context values at runtime.
We can see every node, every element and every attribute in the context. In
case of errors, we can use this as a first aid, which will help us in doing the
initial analysis.
Most of the
times in frontend portal, we only show few context variables/attributes, In
case if we want to see the other values in the context we can switch on the
debug mode and find it easily. For instance if we want to see the pernr of ESS
user id with out logging into backend, I would just find it out by enabling the
debug mode on any one of the ESS application and we can find the pernr in the
InitPernr node of the FcPersInfo context.
When ever an
issue is reported, first thing I would do is to run the application in debug
mode, so that I can see all the values in the contexts, values that are getting
passed from backend. From this we will be able to determine if it’s a backend
or a frontend portal issue.
Setting the
value of URL parameter sap.xss.debug to some other value like ‘F’ or ‘no’
etc doesn’t switch off the debug mode. For switching off the debug mode we have
to remove the URL Parameter sap.xss.debug completely from the URL/application
parameters.
ABAP
There is a
very good article/reusable tool at SDN for showing and even editing the
contexts. A useful debug tool. Here is its URL:
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/0d4c303f-0d01-0010-79bc-8b0ae9be5030
debug information
From the
debug context we can come to know the OrgViewGroup, DataViewGroup etc config
used, we can determine the selected record details etc.
!https://weblogs.sdn.sap.com/weblogs/images/251732588/TeamViewerSelectionDetails_part1.jpg|height=500... bottom;|alt=TeamViewer Selection Details Img1|width=700|src= https://weblogs.sdn.sap.com/weblogs/images/251732588/TeamViewerSelectionDetails_part1.jpg!!https://w... top;|alt=TeamViewer Selection Details Img2|width=700|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/TeamViewerSelectionDetails_part2.jpg!
h3. b) ECM Planning Application
Running the
ECM Planning application in debug mode.
!https://weblogs.sdn.sap.com/weblogs/images/251732588/ECMPlanningApp_Debug_info.jpg|height=500|alt=EC... Planning Application in Debug Mode|width=464|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/ECMPlanningApp_Debug_info.jpg!
Planning application
Correlating ECM
Planning view values to the debug context.
!https://weblogs.sdn.sap.com/weblogs/images/251732588/ECMPlanningApp_Debug_Explanation_part1.jpg|heig... Planning Application in Debug Mode Explanation Img1|width=554|src=https://weblogs.sdn.sap.com/weblogs/images/251732588/ECMPlanningApp_Debug_Explanation_part1.jpg!!htt... Planning Application in Debug Mode Explanation Img2|width=553|src= https://weblogs.sdn.sap.com/weblogs/images/251732588/ECMPlanningApp_Debug_Explanation_part2.jpg!