Tuesday, October 5, 2010

Top 10 Mistakes in BI 7

Keep in mind that the BI 7.0 upgraded system allows configuration running in the 3.x method of modeling (with InfoSources, transfer rules, and update rules). This means that any existing configuration in the 3.x system will continue to work in the BI 7.0 system. For this reason many projects opt for a technical upgrade, moving the configuration to the new release, but the data model does not take advantage of the new loading methodology, java functions, etc. This allows for a quicker and less risky upgrade because there are less changes to the application.
Listed are some of the typical challenges in the 3.x to BI 7.0 projects. This list includes some of the common issues I or some colleagues have experienced during upgrade projects, this list is not exclusive, but does help to highlight some of the areas that are particularly challenging.
There are a lot of SAP Notes. This release is a very extensive and complex release, this leaves a potential for substantial software issues. SAP is releasing a large number of SAP notes for each support stack. The team needs to keep the system updated as often as possible. Regression testing needs to be planned after each support stack upgrade.
The Java analysis queries need to be planned properly. The Java analysis queries can sometimes gather huge volumes of data, depending on their design. In some cases this can monopolize the Java server causing performance issues for everyone. This can be compensated for by good user training and intelligent query design. The query design element forces the user to utilize jump queries in order to get detailed data. This can keep the users from running very large queries and taking a large volume of the Java server.
Common access tools either go away or are no longer supported. Those projects that use the 3.x BEx Browser and/or the Web menu item is not included in the current version of BI 7.0. This may mean that the upgrade requires a new way for the users to launch queries to be developed. This can pose a rather difficult change management issue
SAP no longer supports the 3.x method of authorizations. It is highly recommended that quickly after the upgrade, project teams migrate the authorization security to the BI 7.0 Analysis Authorization security functionality. This can involve a rather large effort depending on the complexity the 3.x security model. In most cases this should be managed as a separate project because of the effort involved.
The security migration tool does not always convert everything. SAP has provided a tool to convert existing 3.x security to the BI 7.0 model. This program is RSEC_MIGRATION. It does not always convert all security; most customers report that it is converting about 80-85% of security. This means some of the migration needs to happen manually. All security requires a regression test to ensure the migration was successful.
Regression Testing for Analysis Authorizations are time consuming – The only way to really understand any issues that may result from the transition from the 3.x authorizations is to fully regression test. This is a rather labor-intensive process involving creating many userids and manually testing the BI functionality to verify that the authorizations are set up correctly.
Integration with the Portal is much more vital in the BI 7.0 release. There are many more touch points between the BI application team and the Portals team. The BI team needs to determine what strategy is to be used for publishing queries to the portal, the portal team needs to develop a clear strategy in conjunction with the BI and ECC or R/3 transactional teams to provide clear content to the end user. In the 3.x version, the SAP Enterprise Portal (EP) was not as tightly integrated with BI, in the BI 7.0 version the integration is more dramatic.

Monday, October 4, 2010

SAP BW Query User exit RSR00001 to populate query authorisation object dynamically


Please note this article has been written from an ABAPers point of view and some knowledge of creating BW queries will be required.

In-order to implement the SAP BW user exit RSR00001 you first need to create an authorisation object which references a $Variable. In this example I am using $ZGMGRANT, which has been linked to the users authorisation profile via transaction PFCG.

Now Within the BW query you have created via Bex Analyser you need to create and authorisation field with the processing type of 'customer exit'.


The next step is to activate the customer exit 'EXIT_SAPLRRS0_001'. To do this create a project in the CMOD transaction, select the SAP enhancement RSR00001 and assign it to the enhancement project. Activate the project.

The enhancement RSR00001 (BW: Enhancements for Global Variables in Reporting) is called up several times during execution of the report. Here, the parameter I_STEP specifies when the enhancement is called.

I_STEP = 1
Call takes place directly before variable entry. Can be used to pre populate selection variables

I_STEP = 2
Call takes place directly after variable entry. This step is only started up when the same variable is not input ready and could not be filled at I_STEP=1.

I_STEP = 3 In this call, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.

I_STEP = 0
The enhancement is not called from the variable screen. The call can come from the authorization check or from the Monitor. This is where you want to put the mod for populating the authorization object. code for this is as follows:

case i_vnam.
  WHEN 'ZGMGRANT'.  "Query field name
    if i_step = 0.
      BREAK-POINT.
      clear wa_ETRANGE.

*     Gets all grants a user is able to see from ZTable,
*     which is populated elsewhere  
      select grant_nbr
        from ZGMUSERGRANTS
        into corresponding fields of table it_ZGMUSERGRANTS
       where UNAME eq sy-uname.

*     Populate Authorisation Object. In i_step 0
*     E_T_RANGE is used to populate the authorisation object
      loop at it_ZGMUSERGRANTS into wa_ZGMUSERGRANTS.
        wa_ETRANGE-sign = 'I'.
        wa_ETRANGE-opt = 'EQ'.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT         = wa_ZGMUSERGRANTS-grant_nbr
         IMPORTING
           OUTPUT        = wa_ZGMUSERGRANTS-grant_nbr.
        wa_ETRANGE-low  = wa_ZGMUSERGRANTS-grant_nbr.
        append wa_ETRANGE to E_T_RANGE.
      endloop.
    endif.
  ENDCASE.


Display Cube Dimension Percentage Used

To display, per dimension, the percentage used with regard to the number of entries in the fact table(s), function module RSDEW_INFOCUBE_DESIGNS can be used.
Enter the name of the cube for input parameter I_INFOCUBE and execute the function module.
Export parameter E_T_TABLSIZE will provide you the desired result as shown in the attached picture.

Debug Start Routine In BI 7

Within BI 3.x it was quite easy to debug your startroutine. Pressing the sequence F7 -> F6 -> F5 brought you directly to the startroutine (code). Within BI 7.0 the "F7->F6->F5" trick doesn't work anymore.
To debug a startroutine in BI 7.0, the following steps need to be executed:

1) Go to Display Generated Program within the transformation

2) Jump all the way down to find some startroutine coding you recognize :-) and place a break-point.

3) Find the load you want to debug within the DTP monitor

4) Press the debugging button

5) Execute the debugging request and the execution will stop at the break-point which has been created/set at step 2.

Replacement Path In Variable Reporting

What is the exact functionality of replacement path in Variable reporting.  What exactly it replaces?
Replacement path processing type is used in a variable when you wish to get a value from attributes of another character or from a query.
 
Example:- if you wish to display the age of a customer in your report which will not be in the cube. I mean Age is attribute of customer and not part of the cube. But each transaction record in the cube is assigned with a customer field. So ..if we want to get this value into our report .. we create a variable on customer with replacement path and use its attribute AGE . So when you use this variable in your query for any thing you get the age of the customer associated with that transaction data
  
You can find one more example:
  
Lets assume we are using a text variable in the Query description (-->Query properties) description is : 'Sales Qty report'
Suppose we have Fiscal year/Period in our Query and variable on it(characteristic).
Now your requirement is to display Fiscal year/period along with description of the Query.  For that you need to create a text variable and use it...
While creating text variable, you have to choose processing type as 'replacement path' and characteristic as 'fiscal year/period' and replace variable with as 'key or text'....
and place this text variable into Query description (from Query properties)...
Suppose user selects some value for fiscal year period, same period will be displayed along with description.

Troubleshooting in Inventory Management

1.    The extractor 2LIS_03_BX is not visible in Logistic cockpit?
       This wont be visible as the extract structure of this is not changeable. Don't worry this wont impact anything.
 2.    The BX extractor setup run is not available thru the SBIW path?
         Use T-code MCNB
 3.    The fields like BWGEO,BWMNG,BWAPPLNM,BWART are not getting populated after the setup table run?
         Please check if the below setting are done in R/3 side.
         A.   Table TBE11 : Maintain Entry 'NDI' with text 'New Dimension Integration' and activate the flag(Note 315880)
         B.   Table TPS01 : Entry should be as below(Note 315880)
                PROCS - 01010001
                INTERFACE  - SAMPLE_PROCESS_01010001
               TEXT1 - NDI Exits Active
         C.   Table TPS31 : Entry should be as below(Note 315880)
                PROCS - 01010001
               APPLK  - NDI
               FUNCT - NDI_SET_EXISTS_ACTIVE
         D.   Tcode -   MCB_  
               In most cases you need to set the industry sector as 'standard'. For more info please see Note 353042
         E.   Tcode -  BF11
               Set the indicator to active for the Business warehouse application entry. This entry may needs to be transported to the production system. (Note 315880)
4.    If the inventory extractors are set in Unsterilized V3 update mode the delta entries for material movements are not shown in Extraction queue (LBWQ)?
       Please check the delta entries in Update records menu (sm13).
5.    Issue with staging the BX extractor data with DSO?
       No DSO possible for BX data. This data directly needs to be loaded to the non cumulative cube.
6.    After BX data load the data is not visible in cub?
       This data won't be visible in cube. After compression this data can be viewed thru reports only.
7.    The inventory data is not matching with R/3 with reference to time period?
        A.    Check if compression is done for the initialization requests properly in cube. The program SAP_REFPOINT_COMPLETE can be used for this.
        B.    If you have not staged UM extractor data then check if material revaluation occurs in your company. If does then load also UM data to cube.
        C.    If the stock amount is showing fine in plant and material level but giving wrong results in more drill down level like storage level or batch, then the stock values are not maintained properly for inter plant movements. For those scenarios we can calculate the stock values in BI from quantity and stock price.
8.    Data mismatch after reloading of non cumulative cube?
       The below process should be followed strictly for data reload.
       A.  Load the BX data. Compress the request with stock marker (uncheck the marker option).
       B.  Load the BF and UM init data. Compress the loads without the stock maker (Check the marker option).
       C.  The future delta loads from BF and UM should be compressed with Stock marker (uncheck the marker option).
9.    Data inconsistency with reference to time characteristics although all the material movements are loaded to cube?
       Check if the validity table is updating correctly. Use T-code RSDV.
10.  How to check the stock data in R/3?
        The below T-code can be used.
        MB5B: Opening and Closing Stock on a posting period
        MB51: Material movement transaction
        MB52: Stock on hand by material, batch, storage location and plant.

Use of APD(Analysis Process and Designer)

Everyone who worked with BI 7.0 knows that Analysis Process Designer (APD) is a workbench for creating, executing, and monitoring analysis processes. The analysis process is primarily based on data that was consolidated in the Data Warehouse and that exists in InfoProviders. One of the applications of APDs from a technical point of view would be feeding query results into a DataStore object or an attribute of a characteristic. In this post I review a few examples on how consultants may use APDs for addressing particular analysis tasks.



Analysis Process Designer allows you to set up a model where you move data from source to target and do some transformations on the way. As a source we can use any InfoProvider in the data model. The following types of data target are available in the Analysis Process Designer:

● Attributes of a characteristic

● DataStore objects

● Files

● CRM attributes

● Target groups for SAP CRM

● Data mining models:

○ Training the decision tree

○ Training the clustering model

○ Training the scoring model (regression)

○ Training data mining models from third parties

○ Creating association analysis models


1. Examples of business applications
1.1. ABC classification for customers

In ABC classification we assign customers to certain categories based on business rules. For example, you can classify your customers into three classes A, B and C according to the sales revenue or profit they generate. When you choose ABC classification in APD you have to specify the characteristic for which the classification is to be performed, its attribute, key figure, appropriate query, and threshold values for the individual ABC classes.
1.2. Scoring (traffic light) model

In a number of BI scenarios we may have a requirement for generating scoring or traffic light indicators for a certain set of KPIs. We may want to know, for example, how close the actual value is to the budgeted one. A range of traffic lights (red/yellow/green) needs to be displayed by geography, product group, profit center, etc.



Traffic light indicators need to be assigned to each report line based on a complex logic. For example, if one or two countries in the region are underperforming, region’s indicator is set to yellow. If more then two countries are underperforming region’s indicator for the analyzed period should be set to red.



As values for traffic light indicators are not cumulative they have to be calculated separately for each level of granularity. Knowing indicators at the lowest level of granularity does not help much in deriving them for upper levels, as there is a business rule defined for each level separately. Therefore, we have to build a set of queries for each level of data model where traffic light indicators need to be displayed. APD would help us feeding query results into the cube reporting on scoring results.


2. Example of data flow for scoring model

The following data flow model can be used for calculating scoring results. The infocube contains measures (KPIs) used for scoring, such as sales volume and sales budget. It also has a set of traffic light KPIs that need to be populated with indicators for each granularity level.


3. Why using APD in the scoring model

It is important to note that in the scoring model instead of APD/Query approach one can use a transformation (formerly known as an update rule) connecting cube to itself. In the start/end routine we can build business logic required for scoring results calculations:

image011.jpg

However, this approach requires complex development in ABAP. Specific scoring requirements have to be documented by a business user in advance, which usually makes development cycle longer. Any adjustments to the scoring logic require ABAP code modifications.



Alternatively, when we use Query/APD approach, analysts are able to define scoring requirements in the queries, test and modify them whenever it is needed. They can also run queries and check preliminary results. Needless to say, it is usually easier to modify and test queries rather than transformations with ABAP code.