Apr 29, 2014

Useful ways to format Bex results in Webi


Running webi reports off of Bex queries can present interesting results due to the nature of using a relational tool to consume OLAP results. Here are some useful formulas/tips to help present Bex results in a cleaner manner.


Remove Values using SUBSTR():
A SUBSTR() formula in Webi is used to strip out unnecessary details from a particular field. A classic example is when dealing with compounded infoobjects. For example when there are reports created for financial and accou nting information a report user is interested in seeing the G/L Account number. However G/L Account Number is compounded with the company code that is configured in the backend. The account number is shows up in the following format CODE/number.

Lets say the G/L Account Number is COMP/13550563 but the user is only interested in seeing 13550563. We can use the substr formula.

=Substr([FIELD];6;8)

Substitute [FIELD] with your object. This formula says we will begin our field at the 6th character by ignoring t he first 5 which is COMP/ and the 8 in the formula says G/L account numbers are always 8 characters long and we need to display all 8. It is recommended you look at the actual Infoobject data length to determine the length of the object.

Remove/Replace Values using REPLACE():
We could have removed the company code from the above example using a REPLACE() formula as well if we are sure that our company code will always be the same. If the G/L account number shows up as COMP/13550563 we can write the replace formula as follows:

=Replace([FIELD];" COMP/";"")

This formula now strips out the unwanted COMP/ value from our G/L account number. This formula is also useful to remove additional details from timestamps and any details from an address field. This can also be used to replace existing data with data that might make more semantic sense to the user. For example changing a meaningless 'X' flag value to either YES or NO.

Create Custom Number Formats:
Different clients have different needs on how they view numbers and dollars on their reports. Custom number formats can easily be created in Webi. When yo u go into format for a number you can define your 'custom' format. Here is a sample for a standard accounting format where thousands are separated by a comma, null values are treated as zeroes and negative values are treated in RED and contained in parenthesis. All numbers follow a 2 decimal notation.

POSITIVE = 0,.00
NEGATIVE = (0,.00)[RED]
EQUAL TO ZERO = 0.00
UNDEFINED = 0.00

The comma allows us to seprate the thousands indicators. To apply to integers remove the decimal.

Use system variables to provide additional meta-data
There are a variety of formulas that are available that call the system specific fields. For example you may want to display the last date the report was executed. You can achieve it using  LastExecutionDate(). CurrentUser() gives you the username of the person accessing the report currently. These become more powerful when you use it along with CurrentDate() and CurrentTime()

Calculate Days between two dates:
It takes a significant amount of work to calculate the number of days between two date ranges in Bex but Webi makes it very easy for us to acco mplish the same. Suppose we want to find the number of days between our Transaction Date and our Posting date simply create a new variable of type Detail and use the DaysBetween() formula to calculate the number of days between the range.

=DaysBetween([Activity_Date];[Posting_Date])

Counting Members:
Webi also makes it very easy to create different counters. Suppose we want to compare number of business partners and the number of contract accounts it is very easy to accomplish by using the Count() formula. Create a variable of type measure and use the formulas as such:

=Count([Business Partner])

You can count different dimensions for a good comparative analysis.

Nest Concatenation() to present free text:
Webi contains a Concatenation() formula to join two strings however it is limited to only joining two strings at a time. This formula becomes really useful if you can nest them inside each other. For example lets say we want to display a free text from CRM on the Webi report but the free text is split into 4 fields due to BW's limit of 60 characters per infoobject of type CHAR. The free text is split into FIELD1, FIELD2, FIELD3, and FIELD4. In order to proper nest the concatenations remember this quick formula. If you wish to join 'N' number of fields then you need to use a total of 'N-1' Concatenation() formulas. In this case beause we want to join 4 fields we will need to use the Concatenation() 3 times.

=Concatenation(Concatenation(FIELD1;FIELD2);(Concatenation("FIELD3";"FIELD4")))

Apr 22, 2014

Authorization in BI 7 - Part 1


This blog will give the information related to Authorization concept available in SAP BW. Also, steps are given to maintain report related authorization.

Why is Authorization required in SAP BW?
  • To avoid the unwanted access to various objects as well as data in SAP BW system.
  • To assign restricted access of data to report users.

Authorization in SAP BW 3.x 
  • BW 3.x required Infoprovider Check to activate or deactivate authorization on the given reports.

What's new in SAP BI  7 for Authorization?

Prerequisites for authorization
  • Decide for which all reports an authorization is required.
  • Make list of infoobjects which will act as authorization specific infoobjects in reports.
  • Check whether all the required infoobjects are Authorization Relevant or not, if not marked then activate the flag.
  • Auth flag.JPG
  • Now check the Authorization Mode in SPRO
    • For SAP BW 3.x - Obsolete concept with RSR authorization objects.
    • For SAP BI 7 or above - Current procedure with analysis authorizations.
    • Auth_Mode.JPG
    • SPRO path
      • SAP Customizing Implementation Guide
        • SAP NetWeaver
          • Business Intelligence
            • Settings for Reporting and Analysis
              • General Settings for Reporting and Analysis
                • Analysis Authorizations: Select Concept
  • If you want to use any navigational attribute in authorization then it has to be authorization relevant in master data infoobject as shown in following screen.
  • Nav_attribute.JPG

Steps to create authorization object for SAP BI 7
  • Go to t-code RSECADMIN
  • Select Maintenance button 
RSECADMIN.JPG
  • Maintain Authorization : Initial Screen will appear.
  • Enter the technical name of authorization object to be created.
  • Click on Create Authorization (F5)
  • Auth_ini_scrn.bmp
  • Maintain Authorizations : Create screen will appear with message in status bar 'Special Characteristics Missing'.
  • spl_char_msg.JPG
  • Why these special char s are required, see what SAP has to say about it
  • spl_char_msg1.JPG
  • Fill up short, medium & long text fields.
  • Click on the button 'Insert Special Charact.' as shown below.spl_char_ins1.JPG
  • Following objects with default selection will get added.
  • Further, get the list of all the 'Infoproviders' you want to add in this authorization object.
  • Each infoprovider has set of 'Authorization Relevant Infoobjects', all of them have to be added.
  • Check one by one infoprovider for the 'Authorization Relevant Infoobjects' as shown below.
  • chk_info.JPG
  • New window will pop-up for Infocube Authorizations.
  • You can specify required infoprovider's name directly or can use F4 help to get the name of infoprovider from the list.
  • As per the reporting requirement user either
    • Insert Aggregation Authorizations: For the Totals in report, aggregation authorization ':' is used.
    • Insert Full Authorizations: It will assign '*'.
  • Once you specify the name of infoprovider and hit enter, list of all authorization relevant infoobjects, from the given cube/DSO will appear.
  • list.JPG
  • Select all the infoobjects from the list using Select All (F7) and hit enter.
  • All the selected objects will get added as shown below.
  • list1.JPG
  • Repeat the procedure for all the infoproviders.
  • As shown in the above screen shot, all infoobjects have value (*) in the intervals field. If you want to change value for any of the infoobjects, use following steps.
    • Use Details button to go to the maintenance screen OR
    • Double click the infoobject to reach the maintenance screen.
  • In the maintenance screen, 2 options are given.
    • Value Authorizations: You can specify single, multiple single or range of values.
    • Hie rarchy Authorizations: Hierarchy node values can be assigned.
  • options.JPG
  • Value Authrozations.
    • 1st column - Including/Excluding : Specify either I or E to include of exclude the assigned value.
    • 2nd column - Operator : Specify value from the given list as per your requirement.
  • comp_op.JPG
    • 3rd & 4th column - Technical Character : Here you have to mention values which are required for the authorizati on.
      • Value (*) can be mentioned to assign Full Authorization.
      • Use Add/ Delete Rows option to add more single values.
      • Whenever single, multiple single or range values are maintained add ( : ) as 1 more row to avoid the summary calculation related errors at runtime. 
  • Once you are done by assigning all the required values, click on Save button and exit.
  • If you make changes in the existing authorization object, on saving it pops up following message
  • savemsg.JPG
  • Select Yes and new changes with old definition will be saved.

  • Hierarchy Based Authorization
    • To assign hierarchy node go to Hierarchy Authorizations in details of particular infoobject.
    • Click on Create button to assign hierarchy node.
    • Following window will pop up where you can select the required hierarchy and particular node.
    • hierarchy.JPG
    • Click on Select Hierarchy button to open the hierarchy variant screen.
    • New window will show the available variants of hierarchy.
    • hier_var.JPG
    • Double click on the required variant and Hierarchy variant name will get populated.
    • Now, detail node needs to be selected. Click on Select Node option.
    • detailnode.JPG
    • Select the required node from the list given
    • Once the values for Hierarchy & Nodes are selected, you have to set Type of Authorization.
    • For Type of Authorization following 4 options are given
      • 0 - Only the selected nodes
      • 1 - Subtree below nodes
      • 2 - Subtree below nodes to Level ( Incl. )

  • 3 - Complete hierarchy
  • 4 - Subtree below nodes to ( and Incl. ) Level ( Relative )
  • Now hit enter and main screen will appear where you can see Hierarchy Node value with type of authorization maintained.
  • When you are maintaining hierarchy node value then in the Value Authorizations only ( : ) value needs to be maintained to avoid the error at runtime.
  • Save the authorization object.
  • Apr 15, 2014

    How to manage Error Free Transports


    Introduction
                      This blog is going to explain you about "Managing Transports by using common sense". I am not going to talk about standard Steps to be carried out.

    Common Mistakes :

    1. We tend to collect multiple(too many) objects in a single TR
    2. We collect our objects in other's transport requests via separate tasks without our/their knowledge
    3. We collect different types of objects in a single TR. Eg: Transformations and DTPs together
    4. We overlook dependent objects while collecting our objects
    5. We do not know whether RSLOGSYSMAP table has got right entries in Target systems or not.
    6. We don't bother about dependent objects are active in Target Systems or not

    How to use our common sense while managing transports

    Scenario : In our projects, we use some standard infoobjects like 0plant, 0Division, 0material etc., Please observe all these standard infoobjects belongs to their respective standard Infoareas and Application Components.

    How to handle above scenario?

    We need not to collect their respective Infoareas and Application Components every time. Because these standard Infoareas and Application Comps will be already available in target systems.

    How to transport DSOs/Infocubes first time to the target systems?

    As we might have already moved our infoobjects, we just need to collect only DSOs/Infocubes and move to target systems. We need not to collect any underlying infoobjects it is pointing  to, like below. The infoobjects which has Expand icon can be collected with "Do not Transport Any below". This will reduce the burden on the TR. Note : It's better to use "Only Necessary Objects" and Collect Automatically".
    DSO Collection.JPG

    What to do when DSOs/Infocubes becomes inactive target systems?

    Just collect the active version of DSOs/Infocubes and move to target systems. You need not to collect anything below.
    DSO Active status.JPG

    How to transport Transformations and DTPs first time to the target systems?

    We all are aware that Transformations are between Source and Target. That's exactly is the reason to collect Source and Target along with Transformation like below. We need not to collect all infoobjects of our Cubes and DSOs, because those objects have already been moved. Same explanation applies to DTPs also.
    Trans collection.JPG

    How to transport Transformations and DTPs after the first time to the target systems?

    We just need to collect the active version of Transformation and DTP. It's not required to collect Source and Target as they are already actively available in Target systems. This procedure can avoid running RDG_TRFN_ACTIVATE program directly in Target systems. You can run this program if you want to activate Transformations/DTPs in mass.
    Trans collection1.JPG

    Tips to consider while managing Transports

    We tend to collect multiple(too many) objects in a single TR

    We should not collect too many objects under one TR. Eg: 1) 30+ Queries 2) 10+ Process Chains etc., We will not be able to have a control on all objects. If you collect few and make them successful in Target systems, it gives you a great idea on our transports.

    We collect our objects in other's transport requests via separate tasks without our/their knowledge

    This is not really a big mistake. But there is a dependency here. Unless all the tasks of different users gets finished, you cannot release the main Request No. This will delay your work. To avoid all this mess, you should create your own TR and collect all your objects under it and release it.

    Sometimes the other developer would have developed some objects and saved in his task. When you take up that work and start working on them, all your changes will get merged with the existing request and task. You will be confused finally, what is your changes and their's ? That's why you have to collect freshly just before you are ready to transport all your objects. Never trans port the older requests, as you don't know exactly what are all changes have been done.

    We collect different types of objects in a single TR. Eg: Transformations and DTPs together

    This is a biggest mistake we generally do. When we start our developments in our BW Dev system, we might create one TR in the beginning and start saving all our work in that. Finally we land up in multiple errors while importing in target systems. Eg : (1 Infopackage, 1 DTP, 2 Transformations, 3 DSOs ) All in one TR.

    My tip here is, you can still work on single TR, but finally unlock all your objects with the help of my other blog http://scn.sap.com /docs/DOC-31394. Collect again freshly object wise from RSA1-->Object types in individual requests. Be clear on object wise here. Eg: Cubes- 1 TR, DSOs- 1 TR, Chains- 1 TR, Transformations- 1 TR, DTPs- 1 TR

    We overlook dependent objects while collecting our objects

    We should always cross check in target systems (before transporting our objects), whether dependent objects are active in Target systems or not. Eg : Datasource Replicas, Transformations, DSO/Cubes etc..

    We do not know whether RSLOGSYSMAP table has got right entries in Target systems or not

    Logical system conversions are must to be maintained in target systems , while transporting Transfer rules, Infosources, D atasource Replicas,Transformations etc. They basically check "Source System Reference" in target systems.

    You can maintain them with my other blog http://scn.sap.com/community/data-warehousing/netweaver-bw/blog/2013/09/29/clients-and-logical-systems

    How to collect Data flow Migration work

    This is a very sensitive task while collecting. All your sequence of steps have to be collected on the spot. Treat these TRs with special care. Don't allow any other changes to get saved under it other than migration activities. It is not as easy as unlo cking from the old request and collect again in new Request from RSA1-->Object Types.

    How to collect a BEx Query

    You have to select the tick boxes like below and cross check whether all the query elements have been collected or not. You need to select the Infoproviders, as they will be already available in Target systems.
    Query collec.JPG
    How to set your system Transport Request settings

    Goto RSA1-->Transports Tab-->Follow below image


    TR Type.JPG

    If you switch on standard, then every activity will ask you for transport request through a pop up instantly.

    If youSwitch -off standard, then all your activities will get saved in to local objects. Finally you will have to collect from RSA1-->Transprt tab-->Object types

    Object Changeability

    You can observe this functionality in above image. This can be used to provide a privilege for us to edit the objects directly in Target Systems. Eg: Queries, Web Templates, DTPs, Infopackages etc. This setting has to be done in Target systems

    Conclusion

    Transporting is an easy task if you organize things properly in a systematic manner. Maintain your own excel sheet with all your Transports. This will help you any time if you want to cross check.

    Apr 8, 2014

    Extraction of Material Classification Data from R/3 to BW


    This document would help to extract Material Classification data for the newly added classification characteristics from R/3 to BW system.

    First I would explain what is classification, class, objects and characteristics.

    Classification:
    R/3 supports many ways for those customising it to store additional data fields. For example, many tables support customer defined
    additions, but there is also the Cross Application Classification System. The Classification System allows R/3 to hold many varied
    additional fields against many different sorts of R/3 "object", for example it might allow you to store a colour against a material. Here
    is some terminology:
     
    Object - a predefined business entity such as vendor, material, equipment or customer.

    Class -  a grouping of Characteristics. To view class definition use t-code: CL03
    Characteristics - a property of the object, this is the new field being added. For example a new characteristic might be the color of the material.
    Characteristic Value - the actual value of the characteristic, for example a material can be colored blue.

    Steps to be followed in SAP ECC side


    1)  Goto TCode SBIW->Settings for Application-Specific DataSources->Cross-Application Components->Maintain DataSources for Classification Data

         f1.png

    2)      In this below screen select DS: 0MATERIAL_ATTR, Class Type: 001(Material Class)
               
              

                f1.png

    In the above screen shot we can see for each data source generated its corresponding Classification Data Source name starting with 1CL_0MAT***(for MATERIAL_ATTR) gets activated.

    3)  Then double click on characteristics on left side. Here we need to maintain the characteristics that we require in BW from the material master.
            Manually enter the characteristics in the screen popping out
      
              f1.png

    In the above screen shot "N" value indicates datasource has been created
                  


    4) Then Click on Generate Data Source         

         R/3 side Configuration is now complete, test the extractor using RSA3.

    Steps in BW side

    Replicate the datasource in BW using t-code: RSDS.

    Oct 21, 2013

    The New Era of SAP NetWeaver BW powered by SAP HANA: Taking Advantage of LSA++

    The New Era of SAP NetWeaver BW powered by SAP HANA: Taking Advantage of LSA++
    Via Content in SCN

    The New Era of SAP NetWeaver Business Warehouse powered by SAP HANA: Taking Advantage of The Power of LSA++

    The SAP® NetWeaver® Business Warehouse (BW) powered by SAP HANA is a new, powerful BW capability built using in-memory technology that can help you address business issues and solve problems in ways not previously possible. You may be technically ready to implement SAP NetWeaver BW powered by SAP HANA, but is your organization ready to optimize the performance and value? Sound planning, including thinking about how you manage and model your data, can help you make the most of your investment.

    The Pre-HANA World
    Before SAP HANA, BW consultants routinely followed a layered, scalable architecture (LSA) methodology for building and structuring the business warehouse. The LSA methodology helped create a standardized approach that organized data by functional area, geography, and other key dimensions. It served as a referenced architecture for comprehensive data warehouse design giving the developers flexible data model layers which allowed for better long term scalability. LSA had several advantages:
    It offered a standardized design and implementation methodology.
    It structured the data into multiple, progressive layers.
    It formed a transparent, service-level-oriented, and scalable base.
    It defined key business indicators , such as net sales, within the data model.

    LSA used years of SAP experience and best practices to create a common terminology built on enterprise data warehouse (EDW) principles. However, much of the LSA modeling was designed to work within the limitations of the Business Warehouse in the pre-SAP HANA world. When the volumes of information were too big to handle in their entirety, the data had to be aggregated and structured around verticals such as suppliers, partners, and customers creating less transparency across the whole organization.

    Life now with SAP HANA
    Leveraging SAP HANA as the underlying database for BW removes many o f these data limitations, making it possible to analyze huge blocks of transactional data without aggregations or layers of complex data modeling. The result: better business visibility and performance – but only if companies take advantage of the new capabilities. The unprecedented power of SAP HANA requires companies to rethink their data modeling methodology. As an evolution of LSA, LSA++ approaches data in a new way to take advantage of in-memory capabilities. We are able to simplify many of the complex data layers and optimize SAP NetWeaver BW which creates direct ROI for the value of your SAP HANA investment.

    LSA++ Highlights
    With LSA++, SAP NetWeaver BW on SAP HANA gives your business more flexibility via a simplified data modelin g approach which supports better decision making decisions and process efficiency. The framework allows for multiple business intelligence (BI) models plus both persistent and virtual data marts. LSA++ structures data by purpose or context with respect to BI requirements, resulting in three categories of data:

    Consistent core. EDW context data includes standardized template-based BI and reporting on harmonized, consistent data.
    Operational extension. Operational and source context data performs real-time BI on source-level data.
    Agile extension. Agile, ad hoc context data includes agile BI on all kinds of data for single use.

    The LSA++ model for SAP NetWeaver BW on SAP HANA gives you increased modeling flexibility, decreased load and activation time, and relaxed volume considerations during design. LSA++ also supports comprehensive data content and direct querying throughout the propagation layer.

    SAP Services: Expert Planning and Implementation Support
    Let SAP Services help you optimize your SAP HANA implementation with the LSA++ methodology. Whether you need initial advisory design or a complete implementation, SAP’s expert planning and installation services can help you streamline and accelerate data modeling.

    To learn more about how SAP can help you deliver maximum business benefits, go to www.sap.com/services.

    What would be the biggest benefits of LSA++ for your organization?

    Oct 16, 2013

    SAP BusinessObjects BI 4.x with SAP BW and SAP BW on HANA - Latest Documents

    SAP BusinessObjects BI 4.x with SAP BW and SAP BW on HANA - Latest Documents
    Via Content in SCN

    I am using this blog post to update people on my latest documents that are available on SCN now:

    Latest update on BEx Query Elements supported in SAP BusinessObjects BI 4.x is available here:
    SAP BusinessObjects BI4 - Supported BEx Query Elements

    Presentation outlining some important Best Practices for integrating SAP BusinesObjects BI 4.x with SAP NetWeaver BW and SAP ERP is available here
    Best Practices for Integrating SAP BusinessObjects BI 4.x with SAP NetWeaver Business Warehouse (BW) and SAP ERP

    and also a slide deck which compares the different data connectivity options and the supported elements of a BEx Query, including the option to create a SAP HANA model based on your SAP NetWeaver BW InfoProvider or query:
    SAP BusinessObjects BI4.x - Comparing interface options to SAP NetWeaver BW & SAP NetWeaver BW on SAP HANA

    I hope people find this information useful and that it helps on the integration of BI4 with BW and ERP and I am looking forward to your comments and feedback.

    Oct 2, 2013

    BEx-Userexits reloaded

    BEx-Userexits reloaded
    Via Content in SCN

    After the initial release of the BI-Tools framework for BEx-Exitvariables in Easy implementation of BEx-Userexit-Variables I got a lot of useful comments and suggestions. And finally, I realized, that I omit a detailed discussion and implementation of the I_STEP 3 ( check after variable-screen ).

    Please read first my first blog, because there are a lot more informations about the process and the variable implemenation. This blog talks mostly about experiences and refactoring.

    Existing experiences

    I have talked to some people, which are using this framework and I have seen some other implementations based on BADI or function modules. 
    When introducing the object-oriented approach, you can obtain some advantages:

    • Traceability: Every Variable is clearly defined and can be relocated very fast ( without scanning a lot of ABAP coding)
    • Self-documenting Implementation: The variable-interface has been defined for an easy use and not for encapsulating the technical customer-exit interface
    • Reusablitiy: Reduce variable code by inheritance and specify only the necessary code within your concrete variable
    • Stability: If one of the variables has a failure, just this coding is not usable. If you have another approach like includes or big function-groups, this is not guaranteed by default.
    • Testability: Using ABAPUnit with ABAP OO-Bex-Variables is very easy and efficient.
    Why reloaded?
    1. The I_STEP = 3 has been implemented as "normal" variable instance and so it has not been very much possiblities to configure and implement this for special queries/infoproviders. This leads to the situation, that all coding has been implemented in one variable-class which handled a lot of different use-cases (and this has not been the original idea of "Separations of concerns").
    1. A spelling mistaked has been slipped into the naming of the methods - so this could lead into a misunderstanded usage when implementing authority-variables.
    Refactoring
    • The existing variable interface - without step 3 ( and renaming method for i_step = 0)
    • A new check-interface handling I_STEP = 3
    Details


    The usage of the BEx-Variables framework has also shown, that an object-oriented approach is easier than plain function modules, if a clear interface is used. I found one example, where even young developers without a lot of development knowledge implemented BEx-Variables.


    The original implementation has two problems:

    So, I enhanced the existing solution and perform a small but effective refactoring. The actual code is checked into code-exchange and can be installed via SAPLink.

    Instead of having one interface, which implement all steps, I decided to split the existing variable-interface into two interfaces:


    A short look into the UML-structure:
    Auswahl_015.png

    As you may notice there is another new class called "ZCL_BIU001_CHECK_COLLECTION". This has been necessary, because a check can be resolved through a infoprovider assignment or a special query. Within the new customizing it is possible, to define checks based upon those two criterias. Not enough: these parameters could be configured as pattern-based parameters, so you can specify a special check for a class of queries / infoproviders.

    In the following, I will show the main changes.

    Variable-Interface (BTW: I love the new corbu design - well done )
    Auswahl_008.png

    Check-Interface
    Auswahl_009.png

    Additional, the variable-include has been enhanced (a little bit ;-) ):

    The customizing has been changed, so that there are two customizing tables: One for the variables and one for the checks.
    Auswahl_013.png

    Auswahl_011.png

    I would suggest to use them together in one view-cluster. And if you defined the views, think about the DDIC capabilities like search-helps, maintenance-views, foreign-keys. Through the usage of ABAP Interfaces, it is possible, to check at customizing time, if a class implements the correct interface!

    I use the described framework intensively and I like the simple usage and the fact, that the original very technical calling has been hidden by two suitable interfaces.

    All the coding and documentation will be found within the code-exchange area "BI-Tools": https://cw.sdn.sap.com/cw/groups/bi-tools. Please do not hesitate to join or ask any questions about implementation details or how to install it. I have attached the current nugget to this blog.

    Have fun!

    Sep 25, 2013

    Tool to check status (active/inactive) of process chain objects


    Scenario:

    It happens sometimes that process chains stop their activity caused by inactive objects. Their are tools that check all objects of a system but this can lead to confusion since not all objects are part of certain process chains.

    The idea behind this tool is to check only the objects of one certain process / meta chain and inform the user about their activity status.

    Let's say that we check the status of DTPs only. Since they are affected by ICs, DSOs, Transformations, etc. they should give us a good overview of the process chain. We will use the following BW tables:

    • Resources: 
      • RSBKDTP - BW: Data Transfer Process Header Data

    FieldDescription
    dtpData Transfer Process ID
    objversObject version
    tgtName of the Data Target for a Data Transfer Process
    srcName of Source Object of a Data Transfer Process
    tstpnmLast changed by
    timestmpUTC Time Stamp in Short Form (YYYYMMDDhhmmss)

      • RSBKDTPSTAT - Status Information on Data Transfer Process 
    FieldDescription
    dtpData Transfer Process ID
    objstatObject Status

      • RSPCCHAIN - Process chain 
    FieldDescription
    chain_idProcess Chain
    objversObject version
    typeProcess type
    varianteProcess variante (name)

     Programm flow:
      1. Tracking down inaktive DTPs in the system environment into a table #1
      2. Identifying all DTPs that belong to a certain Chain / Meta Chain table #2
      3. Removing all DTPs from table #1 that are not part of table #2
      4. Out put of the consolidated table #1
     Solution / Coding:

    *&---------------------------------------------------------------------*
    *& Report  Z_PROCESS_CHAIN_CHECKER
      
    REPORT  Z_PROCESS_CHAIN_CHECKER LINE-SIZE 150 NO STANDARD PAGE HEADING.


    *----------------------------------------------------------------------
    * Declaration area
    *----------------------------------------------------------------------


    TYPE-POOLS: rssm.


    TYPES:      " Structures
                BEGIN OF ls_dtp,
                  dtp      like rsbkdtp-dtp,
                  tgt      LIKE rsbkdtp-tgt,
                  src      LIKE rsbkdtp-src,
                  tstpnm   LIKE rsbkdtp-tstpnm,
                  timestmp LIKE rsbkdtp-timestmp,
                  aedat    LIKE sy-datum,
                  aezeit   LIKE sy-uzeit,
                END OF ls_dtp,


                BEGIN OF ls_pchain,
                  pc_id               TYPE RSPC_CHAIN,
                  pc_typ              TYPE RSPC_TYPE,
                  pc_variante         TYPE RSPC_VARIANT,
                END OF ls_pchain.


    DATA:       " local variables
                lv_index              TYPE i,
                 lv_error(1)           TYPE c,
                lv_timestamp_txt(15)  TYPE n,
                lv_pos                TYPE i,
                lv_maxpos             TYPE i,
                lv_input              TYPE c LENGTH 60,
                lv_mail_title         TYPE string,
                lv_text               TYPE c LENGTH 120,

                " local tables
                lt_dtp       TYPE TABLE OF ls_dtp,
                lt_pchain    TYPE TABLE OF ls_pchain,
                lt_hpc_chain TYPE TABLE OF ls_pchain,

                " workareas
                wa_dtp       LIKE LINE OF lt_dtp,
                wa_pchain    LIKE LINE OF lt_pchain.


    ************************** ********************************************


    PARAMETERS:  p_pc LIKE (lv_input) OBLIGATORY.


    START-OF-SELECTION.


    ******************** track down intactive DTPs ***********************************
    * Step 1

    SELECT r~dtp tgt src tstpnm timestmp
      FROM rsbkdtp AS r
      INNER JOIN rsbkdtpstat AS l
      ON r~dtp = l~dtp
      INTO CORRESPONDING FIELDS OF TABLE lt_dtp
      WHERE objvers = 'A' AND
            l~objstat = 'INA'.


    * splitting field timestmp
        IF sy-subrc = 0.
          LOOP AT lt_dtp INTO wa_dtp.
            lv_index = sy-tabix.
            IF NOT wa_dtp-timestmp IS INITIAL.
              lv_timestamp_txt = wa_dtp-timestmp.
              wa_dtp-aedat   = lv_timestamp_txt+1(8).
              wa_dtp-aezeit  = lv_timestamp_txt+9(6).
             MODIFY lt_dtp FROM wa_dtp INDEX lv_index.
            ENDIF.
          ENDLOOP.
        ENDIF.


    ********************** Indentify objects of a certain chain *****************************
    * Step 2

    SELECT chain_id type variante
      FROM rspcchain
      INTO TABLE lt_pchain
      WHERE chain_id = p_pc AND objvers = 'A'.


    LOOP AT lt_pchain INTO wa_pchain.
      IF wa_pchain-pc_typ = 'CHAIN'.


        SELECT chain_id type variante
          FROM rspcchain
          APPENDING TABLE lt_pchain
          WHERE chain_id = wa_pchain-pc_variante
            AND objvers = 'A'
            AND type = 'DTP_LOAD'.


      ENDIF.
    ENDLOOP.


    DELETE lt_pchain WHERE pc_typ NE 'DTP_LOAD'.




    *********************************************************** ***********
    * Step 3


    LOOP AT lt_dtp INTO wa_dtp.
         lv_index = sy-tabix.
         READ TABLE lt_pchain
            WITH KEY pc_variante = wa_dtp-dtp
            TRANSPORTING NO FIELDS.
              IF sy-subrc <> 0.
                DELETE lt_dtp INDEX lv_index.
              ELSE.
                "Do nothing
              ENDIF.
          ENDLOOP.




    *********************** Table header **************************************


      NEW-PAGE.


      lv_maxpos = 150.


      NEW-LINE. ULINE AT 1(lv_maxpos).


      DATA: lv_outputtext TYPE string.

      CONCATENATE '| Inactive objects in process chain: ' p_pc
        INTO lv_outputtext.

      WRITE: / lv_outputtext, AT 150 '|'.

      NEW-LINE. ULINE AT 1(lv_maxpos).

      WRITE: / '| Object | Technical ID                  | Target                      | Source                        |                 -- last change --           |',
             / '| status |                               |                             |                               | User         | Date          | Time         |'.


      NEW-LINE. ULINE AT 1(lv_maxpos).


    ******************* Table ***********************************************


      IF lt_dtp IS NOT INITIAL.


        LOOP AT lt_dtp INTO wa_dtp.

          ADD 1 TO lv_index.

          NEW-LINE.

          lv_pos = 1.

          WRITE AT lv_pos sy-vline.
            ADD 2 TO lv_pos.
          WRITE AT lv_pos icon_red_light AS ICON.
            ADD 7 TO lv_pos.
              WRITE AT lv_pos sy-vline.
                ADD 2 TO lv_pos.
          WRITE AT lv_pos wa_dtp-dtp.
            ADD 30 to lv_pos.
              WRITE AT lv_pos sy-vline.
                ADD 2 TO lv_pos.
          WRITE AT lv_pos wa_dtp-tgt.
            ADD 28 TO lv_pos.
              WRITE AT lv_pos sy-vline.
                ADD 2 TO lv_pos.
          WRITE AT lv_pos wa_dtp-src.
            ADD 30 TO lv_pos.
              WRITE AT lv_pos sy-vline.
                ADD 2 TO lv_pos.
          WRITE AT lv_pos wa_dtp-tstpnm.
            ADD 13 TO lv_pos.
              WRITE AT lv_pos sy-vline.
                AD D 2 TO lv_pos.
          WRITE AT lv_pos wa_dtp-aedat.
            ADD 14 TO lv_pos.
              WRITE AT lv_pos sy-vline.
                ADD 2 TO lv_pos.
          WRITE AT lv_pos wa_dtp-aezeit.
             ADD 13 TO lv_pos.
              WRITE AT lv_pos sy-vline.
        ENDLOOP.


      ELSE.

          write: / "the process chain is okay".

      ENDIF.


      NEW-LINE. ULINE AT 1(lv_maxpos).



    • Result:

    Input mask
    input.png

    Output table
    output.jpg

    Sep 18, 2013

    BW - Process Chain Analysis

    At one of my clients, we're in the process of "redesigning" their BW environment. Basically we're doing a technical (only) (re)validation of the current system, meaning we just check whether data flows can be improved purely technically (migrate old flows to 7.x, improve coding in start, end and/or expert routines, rearrange characteristics in dimensions, ...).

    In addition, we're creating new process chains and slowly replace the "old" ones (on a functional domain basis) with new ones in the productive "meta" chain.

    In order to make sure we're doing things right, we need to check (from time to time) whether our efforts have the required impact. One of the things to check is to see whether the loads are performing the same (or, ideally, better). Hence, we should check the (meta) process chain.

    Via ST13 I took the data for our "meta" chain (one chain that contains ALL daily loads) for the p ast 2,5 months.

    PC - input.JPG

    To have a "better" (read: nicer & cleaner) view, I decided to process this data with Lumira (actually Predictive Analysis since you can't have both on the same pc and I have Predictive Analysis installed on my laptop - but, the visualization part is exactly the same).

    PC - flow.JPG
    Here I filtered out the "failed" loads (the ones in red) as they create too much distortion on the view and also I filtered on the pas t 1.5 months (instead of the entire data set which contains 2.5 months of data).

    What do we see immediately? The past weeks our daily load time has increased with approx. 10000 seconds (almost 3 hours). Obviously that is NOT the goal of our project. We see that this has been occurring since September 7th (last Saturday). We did transport some changes on Friday (a bit against the rules, but our exception was approved) impacting one flow (concerning PP data).

    I already identified where the "error" is located at, namely: one InfoPackage is extremely bigger than the others (in the past this had been split up into smaller InfoPackages, however they did it directly in the productive environment, so those changes were never made in our development environment).

    This is just a very "practical" way of using Lumira (or Predictive Analysis) to help identifying (possible) issues in your BW loads.

    May 16, 2013

    BEx-Userexits reloaded

    Author : Hendrik Brandes

    After the initial release of the BI-Tools framework for BEx-Exitvariables in Easy implementation of BEx-Userexit-Variables I got a lot of useful comments and suggestions. And finally, I realized, that I omit a detailed discussion and implementation of the I_STEP 3 ( check after variable-screen ).

    Please read first my first blog, because there are a lot more informations about the process and the variable implemenation. This blog talks mostly about experiences and refactoring.

    Existing experiences 
    I have talked to some people, which are using this framework and I have seen some other implementations based on BADI or function modules.


    When introducing the object-oriented approach, you can obtain some advantages:
    • Traceability: Every Variable is clearly defined and can be relocated very fast ( without scanning a lot of ABAP coding)
    • Self-documenting Implementation: The variable-interface has been defined for an easy use and not for encapsulating the technical customer-exit interface
    • Reusablitiy: Reduce variable code by inheritance and specify only the necessary code within your concrete variable
    • Stability: If one of the variables has a failure, just this coding is not usable. If you have another approach like includes or big function-groups, this is not guaranteed by default.
    • Testability: Using ABAPUnit with ABAP OO-Bex-Variables is very easy and efficient.
    The usage of the BEx-Variables framework has also shown, that an object-oriented approach is easier than plain function modules, if a clear interface is used. I found one example, where even young developers without a lot of development knowledge implemented BEx-Variables.

    Why reloaded?
    The original implementation has two problems: 
    The I_STEP = 3 has been implemented as "normal" variable instance and so it has not been very much possiblities to configure and implement this for special queries/infoproviders. This leads to the situation, that all coding has been implemented in one variable-class which handled a lot of different use-cases (and this has not been the original idea of "Separations of concerns").

    A spelling mistaked has been slipped into the naming of the methods - so this could lead into a misunderstanded usage when implementing authority-variables.

    So, I enhanced the existing solution and perform a small but effective refactoring. The actual code is checked into code-exchange and can be installed via SAPLink.


    Refactoring
    Instead of having one interface, which implement all steps, I decided to split the existing variable-interface into two interfaces:

    The existing variable interface - without step 3 ( and renaming method for i_step = 0)
    A new check-interface handling I_STEP = 3

    A short look into the UML-structure:

    As you may notice there is another new class called "ZCL_BIU001_CHECK_COLLECTION". This has been necessary, because a check can be resolved through a infoprovider assignment or a special query. Within the new customizing it is possible, to define checks based upon those two criterias. Not enough: these parameters could be configured as pattern-based parameters, so you can specify a special check for a class of queries / infoproviders.

    Details
    In the following, I will show the main changes.
    Variable-Interface

    Check-Interface

    Additional, the variable-include has been enhanced (a little bit ;-) ):

    Customizing
    The customizing has been changed, so that there are two customizing tables: One for the variables and one for the checks.


    I would suggest to use them together in one view-cluster. And if you defined the views, think about the DDIC capabilities like search-helps, maintenance-views, foreign-keys. Through the usage of ABAP Interfaces, it is possible, to check at customizing time, if a class implements the correct interface!

    Conclusion
    Author use the described framework intensively and like the simple usage and the fact, that the original very technical calling has been hidden by two suitable interfaces.