Sei sulla pagina 1di 26

SAP BPC 10 NW MEGA ELITE ENABLEMENT

BPC Troubleshooting and Root Cause Analysis


Exercise 2a Part I – Debugging a BPC Back End Action
Exercise 2a Part II – Debugging a REST Web Service Call
Exercise 2a Part III – Debugging a Data Manager Package
Overview of the Business Case
In this exercise we will show you several ways of debugging the BPC Application Logic.

Part I – Debugging a BPC Front End Action


In this section we will debug the BPC Application Logic for a given Front End Action.

1. Log on to the SAP GUI (user: BPC_XX, pwd: Welcome!)

2. Go to transaction SE80:
3. Make sure you have entered the following selections: (select "Package" and enter the Package Name "UJ"):

4. Expand the Embedded Package UJO, which is used for Reading and Writing Data within BPC. In this exercise
section, we will debug the actual BPC Write Back code so you can see the records before they are written to the
Database:

5. Expand the Class Library->Classes Folder:


6. Find the Class named CL_UJO_WRITE_BACK and expand the Methods folder underneath it as shown below:

7. Scroll towards the bottom of the Method list and double click on the WRITE method (the source code should pop
up in the window on the right hand side:

8. Now we are ready to set our breakpoint for debugging. Click on line 12 in the source code where you see the
statement: check ct_data is not initial

NOTE: We have only chosen this method for the purposes of showing you the records written back to the
Infocube. In your particular situation, you could really choose to set the breakpoint in whichever method you
need to step through at a detailed debug level.
9. After you have placed the cursor on line 12 by clicking on it (as described in the previous step), click on the
button which creates an External Breakpoint as shown in the screenshot below (looks like a stop sign with a
person in front of it):

NOTE: You should see the External Breakpoint Icon on line 12 as shown in the screenshot

10. Now that we have set the External Breakpoint under the BPC_XX user, we can proceed to the EPM Add-In and
write a few records for debug analysis. Open the Microsoft Excel link on the desktop and logon to the
BPCP_XX/Planning Environment/Model.

Click on the “Open” button. Choose “Open Server Input Form Folder…”:

11. Select the file named “Example Input Form” and click the “Open” button.
12. Your Input Form should look like the below image

13. Change the value in cell C7. Change the value from 2000 to 9999.

14. From the EPM tab, click on the down arrow on the “Save Data” button. Choose “Save and Refresh Worksheet
Data”.

15. One record should be selected to be sent, click “Yes”.

6
16. Pay attention to the Windows Taskbar at the bottom of your screen. You should see the SAP GUI Icon flashing,
which indicates that it is waiting for some action from you. Click on it – Notice that it has stopped in the exact
location where you set your External Breakpoint in the previous steps.

17. Double click on the variable in the code named "CT_DATA" as shown below, (You should see it show up in the
Variables Tab on the bottom of the Debugger):

NOTE: There is 1 record in CT_DATA (it says 1 x 53 which means 1 rows by 53 columns). This table holds the
actual data being written back to the Infocube. In our case, we had changed 1 record in the Input Form.
18. Double click on the variable name to see the contents of the table (you should see another screen with the actual
data in it like so):

19. We still can’t see the actual Signed Data (Column /CPMB/SDATA) because it is in column position 51 (and the
Debugger can only show a certain number of columns at one time). Let’s jump to it so we can see the actual
data. Enter in column 45 and hit return as shown below so we can see the last few columns of the table:

At the end of this section we can note two important findings.


1) The values are Deltas. If you recall looking at the Input Form, the value before we changed it was +2000
and the value after we changed it was +9999. In the debugger screen we see a value of -7999, which
means we are writing the difference to the Database (Note the Negative/Positive switch here – see the next
finding).
2) The Database value must be a negative due to the Account Type we are using. The Database value is
stored as a negative (the Accounts are of type Income). If these Accounts were of type Expense for
example, then the Database value would be positive. The BPC Shared Query Engine handles this sign
reversal and display for you so in most cases you do not have to worry about this reversal yourself.
IMPORTANT NOTE: At the end of this section you should go back to where you set the breakpoint and delete it
(unless you want the debugger to stop here again in the next section). Put your cursor on the codeline and click
the External Session Breakpoint Icon again to remove it:
Part II – Debugging a REST Web Service Call
In this section we will debug the REST Web Service Call which is triggered by the BPC Front End.

1. Staying logged in to SAP GUI with your BPC_XX user, go to transaction SE80:

2. Make sure you have entered the following selections: (select "Package" and enter the Package Name "UJ"):

3. Expand the Embedded Package UJX, which is used for managing the BPC RESTful Web Services.
4. Now Expand the Embedded Package UJX0, which is the packaged used to manage the BPC REST Core
Services. In this exercise we will be debugging the REST interface after writing data from the EPM Add-In.

5. Expand the Class Library->Classes Folder:

6. Find the Class named CL_BPC_REST_RES and expand the Methods folder underneath it as shown below:
7. Scroll down the Method list and double click on the HANDLE_REQUEST method (the source code should pop
up in the window on the right hand side:

8. Now we are ready to set our breakpoint for debugging. Click on line 56 in the source code where you see the
statement: if lf_ret = abap_true. "Process Request
NOTE: We have only chosen this method for the purposes of showing you the REST API. In your particular
situation, you could really choose to set the breakpoint in whichever method you need to step through at a
detailed debug level.

9. After you have placed the cursor on line 56 by clicking on it (as described in the previous step), click on the
button which creates an External Breakpoint as shown in the screenshot below (looks like a stop sign with a
person in front of it):

NOTE: You should see the External Breakpoint Icon on line 56 as shown in the screenshot

10. Now that we have set the External Breakpoint under the BPC_XX user, we can proceed to the EPM Add-In and
write a few records for debug analysis. Use the same Input Form you used in the previous section:
11. Change the value in cell C7. You will notice that this is the same intersection that you changed in Part 2 of this
exercise. Change the value from 9999 to 2000.

12. From the EPM tab, click on the down arrow on the “Save Data” button. Choose “Save and Refresh Worksheet
Data”.

13. Pay attention to the Windows Taskbar at the bottom of your screen. You should see the SAP GUI Icon flashing,
which indicates that it is waiting for some action from you. Click on it – Notice that it has stopped in the exact
location where you set your External Breakpoint in the previous steps.
14. Double click on the variable in the code named "REQUEST_METHOD" as shown below, (You should see it
show up in the Variables Tab on the bottom of the Debugger):

Notice that it has the value "PUT". This variable holds the type of action coming from the Front End. The case
statement used on the variable determines where the code will go from here, and you can evaluate the next call
to see what the Application Logic does next.

15. Double click on the variable names "LO_REQ" and "LO_RESP" to see the actual Request and Response
Objects of the REST Web Service Call:
Note that for the RESPONSE object you will need to run through the logic completely so that it stops again at the
same breakpoint before sending the RESPONSE back.

At the end of this section we can note at least one important finding about the REST call.
1) The value of the REQUEST_METHOD variable is the action of the REST call. Notice that there are only a
few different types of actions executed within the REST interface (GET, PUT, POST, DELETE, HEAD, and
OPTIONS). These represent the rather simple but effective REST interface calls.

IMPORTANT NOTE: At the end of this section you should go back to where you set the breakpoint and delete it
(unless you want the debugger to stop here again in the next section). Put your cursor on the codeline and click
the External Session Breakpoint Icon again to remove it:
Part III – Debugging a BPC Data Manager Package
In this section we will debug a Data Manager Package which has been triggered by the BPC Front End.
Debugging Data Manager Packages are slightly different, since they are executed in the Background on the
Application Server. You cannot debug Background processes directly without some special actions. In this
section we will show you how you can debug the Data Manager Package successfully in the Foreground.

1. Staying logged in to SAP GUI with your BPC_XX user, go to transaction SE80:

2. Make sure you have entered the following selections: (select "Package" and enter the Package Name "UJ"):

3. Expand the Embedded Package UJX, which is used for managing the BPC RESTful Web Services.
4. Now Expand the Embedded Package UJXD, which is the package used to manage BPC REST Web Services for
Data Manager. In this exercise we will debug the REST interface after running Data Manager from the EPM
Add-In.

5. Expand the Class Library->Classes Folder:

6. Find the Class named CL_UJXD_PACKAGES_RES and expand the Methods folder then the Redefinitions folder
underneath it as shown below:
7. Double click on the DO_POST method (the source code should pop up in the window on the right hand side:

8. Now we are ready to set our breakpoint for debugging. Click on line 179 in the source code where you see the
statement beginning with: lo_package->run_package(

NOTE: We have only chosen this method for the purposes of showing you the REST API. In your particular
situation, you could really choose to set the breakpoint in whichever method you need to step through at a
detailed debug level.
9. After you have placed the cursor on line 179 by clicking on it (as described in the previous step), click on the
button which creates an External Breakpoint as shown in the screenshot below (looks like a stop sign with a
person in front of it):

NOTE: You should see the External Breakpoint Icon on line 179 as shown in the screenshot

10. Now that we have set the External Breakpoint under the BPC_XX user, we can proceed to the EPM Add-In and
run a Data Manager Package for debug analysis. Use the same Environment/Model Combination you used in
the previous section (BPCP_XX/Planning).
In Excel, navigate to the Data Manager tab, and click on the Run Package button and choose “Run Package”:

11. Select the “Copy” package and click “Run”:


12. Select the “Merge” option, and click “Next”:

13. Select “No”, and click “Next”:

14. Select “No”, and click “Next”:

21
15. In this next dialog, use the same values as shown below, making sure you are copying all 2010 periods to 2011:

16. Click “Next”.

17. Click “Finish”.

22
18. Pay attention to the Windows Taskbar at the bottom of your screen. You should see the SAP GUI Icon flashing,
which indicates that it is waiting for some action from you. Click on it – Notice that it has stopped in the exact
location where you set your External Breakpoint in the previous steps.

19. Double click on the variable in the code named "LS_PACKAGE_RUN-IF_DEBUG" as shown below, (You should
see it show up in the Variables Tab on the bottom of the Debugger):
Notice that it does not have a value set (it is blank). This variable holds a flag for the Data Manager engine that
can control whether the Data Manager Package is run in the foreground (for debugging) or the background. A
blank value means to run the package normally (in the Background). A value of ‘X’ means to run the package in
debug mode (in the Foreground).

20. Click the pencil icon next to the value column so that you can edit the value inside the debugger:

21. In the value column enter a capital X as shown in the screenshot, and hit Enter on your keyboard:

22. Your debugger Variables 1 tab should now look like the following:

23. At this point, you can let the Debugger continue through the code by hitting either F8 or clicking the continue icon
as shown below:

24. Since we don’t have any other downstream breakpoints, the code will continue on to completion and you should
be able to see the following screen in the EPM Add-In:

24
25. If you wanted to debug this particular Data Manager Package, you would first need to set a breakpoint in the
Data Manager Package code that handles the Copy process. This code is located in the UJD package:

Important NOTE: You must first figure out which step of the Data Manager Copy process you are debugging,
since there are several classes used in every Data Manager Package (see transaction RSPC and look for the
appropriate BPC Process Chain handling the package). Inside each one of these process chains are multiple
steps, and each step is controlled by its own specific UJD Class.

At the end of this section we can note at two important finding about the debugging Data Manager Packages.
1) The Data Manager Packages always run in Background mode, unless you catch the REST call as shown in
this exercise and tell BPC to run it in “debug” mode (or the Foreground).
2) Debugging Data Manager Packages can get very complex, due to the number of BPC Classes which are
used during a single Data Manager Package execution. To find the right package to debug you must
analyze the process chain behind the Data Manager Package itself and determine which UJD Class is used
for the Process Type (Step) that you wish to debug. Then you can set another breakpoint in the appropriate
method of this class so that the debugger will stop there during execution.

IMPORTANT NOTE: At the end of this section you should go back to where you set the breakpoint and delete it
(unless you want the debugger to stop here again in the next section). Put your cursor on the codeline and click
the External Session Breakpoint Icon again to remove it:
© 2010 by SAP AG.
All rights reserved. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services
mentioned herein as well as their respective logos are trademarks or registered tradem arks of SAP AG in Germany and other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other
Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered tradem arks of Business
Objects S.A. in the United States and in other countries. Business Objects is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves
informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for
informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to
the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

26

Potrebbero piacerti anche