Friday, January 13, 2017

Debugging FOX: Part 2


 

In this second post on ways to debug FOX code in SAP BPC Embedded/BI-IP, I will focus on the debugging of the generated ABAP code.

Two methods exists:
1 - Debug the fox code itself as FOX script, covered here, and
2 - Debug the generated ABAP code, covered in this post.

Debug FOX Code ABAP


This method of debugging is very helpful if you know some ABAP, of course, as it shows you on source code level the statements that are being executed. Once you get to grips with the way the statements work, it becomes a lot easier and it is my preferred way of debugging.

To start off, go the transaction RSPLAN and select the FOX code you want to debug. In the code at the point you want the breakpoint, simply add the statement BREAK-POINT.



Execute the code with Trace Mode and you will step into the  ABAP Debugger. Some this to look out for in the debugging of FOX:

Key Figure Value assignment, for example:

REF_AMOUNT = {0AMOUNT, # }.

Is generated in ABAP as:

G_OPER = '0AMOUNT'.

GS_OPER-0FISCPER = '0000000'.

A further ABAP statement is generated that reads the reference data table to get the value:

PERFORM GET_OPER USING XT_REF_DATA GS_OPER CHANGING XT_MESG _E00001 .

Stepping into this statement and the assignment takes place here:

READ TABLE ith_data ASSIGNING <s_data> WITH TABLE KEY s_chas is_oper.
 IF sy-subrc 0.

is_oper contains the values of the block characteristics and the fields to be changed and is used a the key for the table read against the reference data. This is why, when the fields to be changed contains more than one characteristic value, a foreach loop is required, else the io_oper structure will be incomplete. This is further supported by the fact that a READ statement is executed, rather than a LOOP... WHERE

sy-subrc of course gives the indication whether a record has been found or not. 


FOREACH Loops

The generated code for the FOREACH loop is generated as follows:
PERFORM SET_CURSOR TABLES LT_CUR_00001
                   USING LT_CUR_FIELDS_00001 XT_REF_DATA
                   CHANGING L_CUR_00001_CNT.
LOOP AT LT_CUR_00001.


It is quite convenient to view the data in the reference table and to get the record of the current iteration. From here, everything follows the same pattern of Key Figure Value assignment and then the table read.

Happy debugging and let me know what your thoughts are on this post.

I will also be making a video, and will update this entry as soon as it is done.


Thursday, January 12, 2017

Trend of SAP BPC around the world.


Google Trends gives a nice view of the interest of SAP BPC over time as well as interest around the globe. The global view in particular is interesting. It is not surprising to me that the largest interest in from India, however, I would have expected some interest from Australia and Brazil.



The time view shows that SAP BPC as a search term has remained pretty consistent since 2011.



Do these statistics agree with your perceptions of SAP BPC in the market?

Wednesday, January 11, 2017

Debugging FOX: Part 1





In this first post I want to address the two ways to debug FOX code in SAP BPC Embedded/BI-IP. 

Two methods exists:
1 - Debug the fox code itself as FOX script, covered in this post
2 - Debug the generated ABAP code, covered in part 2.


Debug FOX Code as Script
This method allows you to trace the values in the script. And you will be able to see the block characteristics as well as the fields to be changed and trace the values quite easily. To debug using this method follow the steps below:


In Transaction SE80, select class CL_RSPLFR_CONTROLLER




Expand Methods and Select the Method execute_service and double click.




Go to line 105 and set a break-point




Once set, go to transaction RSA1, and select the planning sequence and the step you want to test.







Add the variables you need and then select 'Execute step with trace'. The ABAP debugger 
will pop up and stop at line 105 where we set the breakpoint. Select the script tab:



And select Load Script. Keep the Script Source Database and under script name, select or enter RSPLFC_DEBUGGING_SCRIPT_FOX






Click on the Start Script Button 


You should now see the debugging screen with your FOX Script:



To start the debugging process, press the Start Debugging button or F8.

The following features are available:

Block Values: Display the block characteristic values
Show Messages: Display any messages
Choose Variables for Display: This will allow you to display the values of all fields to be changed.
Toggle Variables for Display: Switches the variable display on and off.
Toggle Ref-Data Display: Switches the display of the reference data tables on and off.
Toggle Block Value Display: Switches the display of the block data tables on and off.





Saturday, January 7, 2017

Sneak Preview: My next SAP HANA Course on udemy


This is a sneak preview of a lecture from my new course that I am creating for udemy. The course will cover predictive analytics on SAP HANA, but instead of going through each of the algorithms, I will focus on a few algorithms and rather cover how we can use them in SAP BW, SAP BPC, HANA Native apps, Lumera and so forth.

You can access the video on the page Video: Exponential Smoothing

Let me know what you think of the video. Everyone who comments will get a coupon to access the course on udemy for only $10!


BW FOX Function to read characteristic value and store in local variable.




Here is a link to a solution I assisted one of my udemy students with. if you have any questions or issues with SAP BPC Embedded, or even BPS, let me know.

It has been a while since I worked with SEM BPS (over 8 years) so i was kinda surprise that I was able to help so quickly. 


BPC Salaries






The median salaries for SAP BPC consultants in the UK has increased by 14.28% (at time of this post) over the same period last year according to itjobswatch

What I really would like to know is what the split in demand is between Classic and Embedded. 

A quick and informal scan at the job postings shows that all the jobs require BW, HANA and to some extent S4 skills. Is this an indication of market demand moving towards BPC Embedded and SAP BPC on S/4HANA and away from Classic?

Free training videos loaded.


Free udemy training lectures

I have added some of my udemy training videos. You can access them by selecting the lecture under the 'Pages' section. In all, I have published four lectures:

  • BPC Embedded Fundamentals
  • Aggregation Levels and Filters
  • Our first planning function and 
  • SAP BusinessObjects Analysis, Edition for Microsoft Office
Each page contains a link to access the udemy course at a huge discount.

Let me know what you think

Thursday, January 5, 2017

Could HANA native apps replace SAP BPC Embedded?



Just wondering...

This is just a quick though on HANA native apps and SAP BPC. I am at a customer today where (surprise, surprise) planning is performed on a spreadsheet. Now typically, this is where BPC comes in, as we can replace all spreadsheet based planning with BPC. 


However, what frustrates me and most of my clients with BPC is the fact that it is not easy to change an existing record's characteristic values in the cube without a package (for example, using a MOVE planning function).


A prime example of this is shipment planning. Exports shipments are planned per vessel. The (truncated) record will look something like this:


Customer Vessel ETA Ordered Tons
Export Cust 1 Maersk Lavras 167B 16-11-16 40
Export Cust 2 Maersk Kampala 146SSE 16-11-17 25
Export Cust 3 Msc Charleston 648R 16-11-22 4

All these fields are changed on the fly as new information comes in due to vessel delay, adjustment of inventory allocation to customers etc. In BPC, this would require a move package between characteristic values, while in Excel it is simply an overwrite of an existing value.


As a native HTML5 application in HANA, I could achieve exactly the same and perform the same calculations as planning functions (FOX) in BPC. Through hybrid providers and Open DS Views the information in the table is available in BPC/BW in real-time.


This leaves me with the question: 

Apart from Excel, what is the value proposition of BPC over HANA native apps?

I'll post more on this as I delve deeper into this topic, but I'd like to know your thoughts.


Click on this link to get access to my BPC Embedded course at a significant discount:






Oh, and by the way, the book below is really good...

 


Tuesday, January 3, 2017

Relentless cube switching ( or BW Undo )

Here is a quick time saving tip if you need to continuously adjust code (or planning functions/loads etc.) along a planning process. 

For example, we are effecting major changes to one of our price planning processes. The process is roughly as follows (there are many more steps but this is just a quick overview):

  • Load data from CO-PA
  • Retro-engineer pricing conditions and compare to actual pricing conditions,
  • Calculate aggregated prices based on complex business rules,
  • Some manual planning steps
  • Copy aggregated prices to detail using more complex business rules,
  • Calculate new price net of rebates
  • Valuate planned sales volumes using a large amount of pricing procedures.
The changes made to the data models has an impact on each of these steps and each of the steps have several planning functions containing FOX, SQL, ABAP that are impacted. Due to data volumes and the complexity of the process, errors in step 5 may only be detected at step 12 and so on, which means we have to revert back to the final state of step 4 for testing purposes. 

After each planning step, we 'switch' the cube from plan mode to load mode 


and back, writing the open request to the cube. 


This discrete package of data now represents all the data records written in that step. 

Deleting the subsequent steps' requests will put us back to the desired state. No need to re-perform all the steps from step 1 to 4.


For more tips and training on BPC, use this coupon for training on BPC


Monday, January 2, 2017

Udemy training


Over the course of my career as a BPS, BI-IP and BPC Consultant, many consultants have approached me and asked where they can find BPC Embedded/BI-IP training. Generally, the only source available for SAP BPC training is through SAP themselves, which costs quite a lot. Last time I checked a week's worth of training at SAP South Africa is in the vicinity of ZAR 24,000, which is unaffordable for the average consultant.

In addition, we are having a hard time getting skills in this area, and I expect a significant uptake in BPC Embedded/BPC4HANA in the near future. The signals are there as some customers are reevaluating their decision to go BPC Classic for Embedded/BPC4HANA as they embark on the HANA journey for their ERP systems.

To address the request for training and the lack of supply, I have created an udemy course on BPC Embedded. You can access the course at a significant discount by clicking on the image below:




Three reasons why SAP BPC Embedded on HANA rocks


In this post I would like to share three reasons why I think BPC Embedded is an incredibly powerful tool for creating planning applications.
Don’t get me wrong, I am a big fan of the classic version as well, both planning tools have their strengths and weaknesses and both have their place in the planning, budgeting and forecasting landscape. This post is purely stating three features of the Embedded version that I think helps to build enterprise strength planning applications.

Application Architecture

Embedded generally sits on top of a Real-Time Info-Cube, which means that it is easier to address larger numbers of Characteristics (dimensions in Classic terms) than Classic and we can also use multiple Key Figures. For example, at one customer our Sales Planning application contains more than 30 Characteristic (or again, dimensions) and more than 20 Key Figures. This allowed for quite a bit more sophistication in application design that could be achieved in the Classic Model. In Embedded, we can also have a larger range of Objects to plan on, for example, planning enabled DSO's, Local Providers and Composite Providers, which adds flexibility to the design.

Integration

Embedded uses the SAP Namespace and the same infoObjects as ‘Standard’ BW. This reduces redundancy and in fact increases flexibility in application design.

Speed

Yes, HANA does offer a significant boost to performance. We are able to calculate production costs by exploding the Bills-of-Material for thousands of products, (BoMs that are up to 15 levels deep and contain recursive processes), in a matter of minutes (most of which is the data transfer time of the data from the server to the front-end). 
All this adds to the capability to not only create the sophisticated planning applications in their own right, but also to model scenarios to determine the impact of, for example: 
  • Shifting of factory shut dates on the factory's ability to meet customer demand,
  • Changes in input costs, exchanges rates and material substitutions on the Product Cost and,
  • Various sales scenarios on demand and inventory levels from the Finished Goods all the way down to the Raw Materials.
Do you agree or differ with my points? I look forward to hearing your opinion.
Look out for my next post, which will cover the integration SAP's Predictive Analytics Library with BPC Embedded.
To learn SAP BPC Embedded, access my udemy BPC Embedded course at a discount here: