reyemsaibot

SAP BI Blog about SAP BW/4HANA, Analysis for Office and SAP HANA - by Tobias Meyer

Schlagwort: analysis for office

  • Analysis Office – The Comprehensive Guide

    It is done. My Analysis for Office book is finished. You can now download the table of content and the release of the book is
    next week. Have fun and if you have feedback send it to me. 

     

    Have a nice weekend.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Using SAPGetVariable with VBA

    At the moment I am working very hard to get my book done, so this is only a short blog post how to use SAPGetVariable with VBA. The Analysis Office help provides no example so here it is:

    1
    2
    Dim ret As Variant
    ret = Application.Run("SAPGetVariable", "DS_1", "0S_CUS", "INPUT_STRING_AS_ARRAY")
    

    So the command need the data source and the variable, in my example DS_1 and 0S_CUS. It is very simple, but at the moment there is no example in the Analysis Office user guide.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Settings for the AnalysisOffice Plug-in

    In Analysis for Office 2.2 SP3 some new interesting parameter for Ao_app.config were delivered. The following parameter are
    interesting and in some case maybe very useful.

    • MaxNumberOfParallelThreads

    Use this setting to define the maximum number of parallel threads that can be used to open the SAP HANA DataSources of a workbook. This only works with SAP HANA.

    Use this setting to specify the mode of the prompting dialog when you open a workbook from the NetWeaver that contains exactly one DataSource.

    In Analysis for Office 2.3, which was released on 23th May also brought some new parameter.

    • ShowSsoLogonDialogBip

    Use this setting to specify whether the logon dialog box should be displayed when using SSO with the BI platform. This maybe is interesting, if you want to change the logon language.

    • CancelPopupDelay

    Since Analysis for Office 2.3 it is possible to cancel a query execution. This parameter defines how long the cancel dialog should be displayed. I think this is a really nice option of
    Analysis for Office.

     

    There are a lot of more settings for Ao_app.config in the Admin Guide of Analysis Office. Like for
    example:

    Some I am testing at the moment and will be review them very soon.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Analysis for Office Infofields, formulas & Dashboard

    Analysis for Office provides own Microsoft Excel formulas to show information
    of your data source. I want to explain some functions and how to use them in a dashboard or a report.

    • SAPGetVariable
    • SAPGetMember
    • SAPGetInfoLabel
    • SAPGetSourceInfo
    • SAPGetWorkbookInfo
    • SAPGetDimensionInfo
    • SAPListOF
    • SAPListOfDimensions
    • SAPListOfEffectiveFilters
    • SAPListOfDynamicFilters
    • SAPSetFilterComponent

    The function SAPGetVariable returns the value for a specific SAP Business Warehouse variable. For example:

    Cell A2: =SAPGetVariable(„DS_1″;“0S_CUS“;“VALUEASKEY“)

     

    This formula returns the key for the variable 0S_CUS. You can use this key to fill another formula to get other information. For example:

     

    Cell A3: =SAPGetMember(„DS_1″;“0SOLD_TO=“&A2;“0NAME“)

     

    If you don’t want to have two formulas you can merge them like this.

     

    Cell A4: =SAPGetMember(„DS_1“;“0SOLD_TO=“&SAPGetVariable(„DS_1″;“0S_CUS“;“VALUEASKEY“);“0NAME“)

     

    The result is still the same.

    Analysis for Office SAPGetMember & SAPGetVariable
    Analysis for Office SAPGetMember & SAPGetVariable

    The formula =SAPGetInfoLabel returns language-dependent label for an info field. This is really nice, if you have colleagues or customers who are not familiar with one language. For
    example:

     

    Cell B5/B6: =SAPGetSourceInfo(„DS_1“; „InfoProviderName“)

    Analysis for Office SAPGetSourceInfo
    Analysis for Office SAPGetSourceInfo

    The information is either workbook or data source related. Which are exactly workbook or data source related can be checked in the user guide of Analysis for Office. For a dashboard these are relevant:

     

    • LastRefreshedAt
    • WorkbookName
    • LastDataUpdate
    • LastDataUpdateMaximum
    • QueryTechName
    • QueryLastRefreshedAt
    • InfoProviderTechName
    • System

     

    To get values for the above-mentioned info fields, you have to use SAPGetWorkbookInfo and SAPGetSourceInfo.

     

    Cell A7: =SAPGetInfoLabel(„QueryTechName“)

    Cell B7: =SAPGetSourceInfo(„DS_1“; „QueryTechName“)

    Analysis for Office SAPGetInfoLabel & SAPGetSourceInfo
    Analysis for Office SAPGetInfoLabel & SAPGetSourceInfo

    Cell A8: =SAPGetInfoLabel(„WorkbookName“)

    Cell B8: =SAPGetWorkbookInfo(„WorkbookName“)

    Analysis for Office SAPGetWorkbookInfo
    Analysis for Office SAPGetWorkbookInfo

    Cell A9/A10: =SAPGetDimensionInfo(„DS_1″;“0SOLD_TO“;“ATTRIBUTE“;“0CITY“)

    Analysis for Office SAPGetDimensionInfo
    Analysis for Office SAPGetDimensionInfo

    As you can see the first entry is in English, the second in German. This is also nice for an international Excel dashboard.

     

    To get an overview of the existing DataSources you can use the formula =SAPListOf.

    Analysis for Office SAPListOf
    Analysis for Office SAPListOf

    As you can see my workbook contains two data sources. When you build a dashboard it is good to see which data source you need for the data.

     

    If you want to display which dimensions are available in this data source you can use =SAPListOFDimensions.

    Analysis for Office SAPListOfDimensions
    Analysis for Office SAPListOfDimensions

    If you only want to see which Dimensions are in rows, you have to use this

     

    Cell A27: =SAPListOfDimensions(„DS_1″;“AXIS“;“ROWS“)

     

    For Columns

    Cell A29: =SAPListOfDimensions(„DS_1″;“AXIS“;“COLUMNS“)

     

    For Filter

    Cell A32: =SAPListOfDimensions(„DS_1″;“AXIS“;“FILTER“)

    Analysis for Office SAPListOfDimension Detail
    Analysis for Office SAPListOfDimension Detail

    If you want to display the filters of your dashboard, you have different formulas. For example:

     

    =SAPListOfEffectiveFilters returns a list of all filters of a data source including dynamic filters defined by a user, static filters in the query and measure filter. If you want either
    dynamic filters or measure filters you also can use =SAPGetListOfDynamicFilters or =SAPGetListOfMeasureFilters.

     

    It depends on what you want to show in a report. If you want to make your dashboard interactive you can use =SAPSetFilterComponent, so the user can decide what to filter on a
    specific data source

     

    For example, this formula shows a filter for 0SOLD_TO and applies to all data sources in this workbook.

     

    Cell A36: =SAPSetFilterComponent(„DS_1″;“0SOLD_TO“;“ALL“;“MULTIPLE“)

    Analysis for Office SAPSetFilterComponent
    Analysis for Office SAPSetFilterComponent

    You also get a little filter icon to select via a dialog box your values.

    So after the technical stuff is done, we can create our dashboard. I want to build a simple dashboard with a chart and a table, where the user can decide which data he wants to see.

    Analysis for Office Dashboard Example
    Analysis for Office Dashboard Example

    For the customer number in cell A1 we use this formula =SAPGetVariable(„DS_1″;“0S_CUS“;“VALUEASKEY“) because the user has to select a customer in the prompt dialog. For the name and
    address I used the following commands:

     

    Name: =SAPGetMember(„DS_1″;“0SOLD_TO=“&A1;“0NAME“)

    Postal Code and City: =SAPGetMember(„DS_1″;“0SOLD_TO=“&A1;“0POSTAL_CD“) & “ “ & SAPGetMember(„DS_1″;“0SOLD_TO=“&A1;“0CITY“)

     

    For the date I use the last refreshed of the query: =SAPGetWorkbookInfo(„LastRefreshedAt“).  To display the last data update I use the formula =SAPGetSourceInfo(„DS_1“;
    „LastDataUpdate“)
    . For the InfoProvider I use =SAPGetSourceInfo(„DS_1“; „InfoProviderTechName“).

     

    For the data of the table I use formulas like =SAPGetData(„DS_1″;“Net price“;“0MATL_GROUP=060″)

     

    As you can see, it is very easy to build a beautiful report without any VBA coding. I hope this post help you to build your own dashboard. If you
    like, you can share some of your ideas either via the comments or just send me a mail.

    Update 21.05.2021:

    As Jim mentioned in the comments I had a mistake that in some formulas the &-symbol was missing to concatenate the string correctly

    author.


    Hi,

    I am Tobias, I write this blog since 2014, you can find me on twitterfacebook and youtube. I work as a Senior Business
    Warehouse Consultant. In 2016 I wrote the first edition of . If you want you can leave me a paypal coffee
    donation. You can also contact me directly if you want.




  • Analysis Office Filter Data by Member

    A feature of Bex Analyzer was the upload of selections, so you haven’t to type the selections all the time. This feature wasn’t available for
    Analysis for Office until version 2.2 SP3. So I looked deeper in this function and want to share my knowledge.

    BEx Analyzer Upload Selection
    BEx Analyzer Upload Selection

    Since I think Analysis for Office 2.1 it is also possible to filter your data by paste your selection from
    a clipboard. In the settings of Analysis for Office you can define the number of members which are displayed in the filter dialog. If a dimension has more members than you defined in the user
    settings, a filter dialog for mass data is opened. In this particular dialog you only see the selected members, but you can add members by using the input help.

     

    Hint: You can also define the number of members by using the admin parameter FetchMemberLimit and you can also disabled the mass data dialog by using the
    parameter EnableMassDataSelector.

     

    In the prompt dialog you have to select the „Add Lines Using Filter By Member“-Button.

    Analysis for Office Prompt Filter by Member
    Analysis for Office Prompt Filter by Member

    Note: You only see this button, if your variable is either a selection option variable or allows several single values.

     

    After you click on this button, a new dialog will popup, where you can filter by members of this dimension. If the number of members are more than the defined number in the user settings, you see
    the filter dialog for mass data.

    Analysis for Office Select Member
    Analysis for Office Select Member

    You are now able to paste your selection to the filter dialog by using the Paste from Clipboard icon at the left bottom of the filter dialog.

     

    Note: The Members have to be displayed as key in the list.

     

    If you want to insert a lot of members that you want to use for filtering, you can use Paste from File. The Paste from File icon is next to the Paste from Clipboard icon if you use an Analysis for Office version which is higher than 2.2 SP3.

     

    If you click on the button a windows open dialog appears and you can select the file which you want to upload.

    Analysis for Office Select Textfile for Upload
    Analysis for Office Select Textfile for Upload

    After you click „OK“ the members are added to the filter.

    Analysis for Office Uploaded Members by Textfile
    Analysis for Office Uploaded Members by Textfile

    By click OK, the filter is applied.

    Analysis for Office Selected Filter Values
    Analysis for Office Selected Filter Values

    By click OK, the filter is applied to the prompt dialog.

    Analysis for Office Prompt with Values
    Analysis for Office Prompt with Values

    Now you can run your query and wait until you see your result. Another possibility is to filter your data by VBA code.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Analysis Office Workbook vs. DataSource Variants

    Analysis for Office has different two kinds of variants. One is a workbook variant and the other is a DataSource variant. So what
    is exactly the difference?

     

    If you have a workbook you can save your variants in the prompt dialog.

    Analysis for Office Save Variant
    Analysis for Office Save Variant

    Enter your required values, a description for the variant and click the save button. This is now a user variant and only for your user available. When you want to use your variant as a global
    variant, you have to change the variant settings. In the variant settings you can also edit and delete a variant.

    Analysis for Office Variant Settings
    Analysis for Office Variant Settings

    If you now change your user variant to a global variant, you have to choose a technical name and confirm the change.

    Analysis for Office Global Variant
    Analysis for Office Global Variant

    In the prompt dialog you see at first the user variants and underneath the global variants.

    Analysis for Office Global vs. User Variant
    Analysis for Office Global vs. User Variant

    If you have only one DataSource in a workbook you can also access the DataSource variant. To access the DataSource variants, you have to change the Ao_app.config and add the parameter
    <ShowDSVariantsForWorkbookWithOneDS>

     

    If you set this parameter to true you can save variants or select a saved variant for this DataSource.

    Analysis for Office Select DataSource Variants
    Analysis for Office Select DataSource Variants

    When you insert the DataSource into a new workbook you can select the variant, but if you add more than one DataSource to the workbook the DataSource variant is not any longer available.

    Analysis for Office Variant no longer available
    Analysis for Office Variant no longer available

    The parameter ShowDSVariantsForWorkbookWithOneDS is nice if you use only one DataSource in a workbook and you want to use predefined variants.

     

    Note: Workbook variants are only available, if you save the workbook on a NetWeaver. If you have only a local workbook, you can’t use variants.

    Analysis for Office Variants needs SAP NetWeaver
    Analysis for Office Variants needs SAP NetWeaver

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Analysis Office Variable Operator Contains Pattern

    Analysis for Office Prompt without Pattern
    Analysis for Office Prompt without Pattern

    Since Analysis for Office 2.0 the administrative settings are moved from the registry to the file system. These settings are now maintained in a XML file. As in my article “Analysis for Office 2.2 SP2
    mentioned the Ao_app.config is repeatedly expanded and sometimes there are new commands available.

     

    In this context the admin guide is always very useful. On this Topic there is also a SAP Note 1920589. To use “Contains Pattern” as it is described in the
    Analysis for Office Help under “Syntax for Entering Values”, it must be activated in the Ao_user_roaming.config file.

    Analysis for Office User Guide
    Analysis for Office User Guide

    The file is located in the user folder AppDataRoamingSAPCof (%AppData%SAPCof).

    AppdataRoamingSAPCof
    AppdataRoamingSAPCof

    In this file you have to add the parameter <OperatorContainsPattern value=“True“ />.

    Ao_user_roaming.config OperatorContainsPattern
    Ao_user_roaming.config OperatorContainsPattern

    If you now use a variable, which supports pattern, your variables prompt should look like this.

    Analysis Office Prompt with Pattern
    Analysis Office Prompt with Pattern

    Note: Until Analysis for Office 2.3 ContainsPattern only works if your variable is in Characteristic Restrictions. If your variable is in Default Values, you don’t see the ContainsPattern
    option.

     

    The problem is described in the SCN.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Error while executing function module BICS_PROV_OPEN

    I just got access to a NetWeaver 7.5 SP2 and I want to test it with Analysis for Office 2.3. So I open Excel and insert a query. And here we go first error: „unable to open data
    source“, so I thought maybe the query is broken and I developed a new query and insert it. Here we go, same error. Maybe queries don’t work, so I insert a InfoCube directly. Same error…

     

    Now I refresh the insert query and got an Analysis for Office message: Error while executing function module: BICS_PROV_OPEN

    In the explanation was one line with the hint „wrong parameter type in an rfc call“, so I looked into st22 and saw a dump which the message: CALL_FUNCTION_ILLEGAL_P_TYPE

    The explanation of this dump is „This error appears if parameters submitted incorrectly in a Remote Function Call.“

     

    I searched but found nothing which should help me. After a longer research I found in the SCN this thread and the simple solution is:

     

    Delete all contents in C:Users<your_user>AppDataRoamingSAP AGSAP BusinessObjects Advanced Analysiscache

     

    After deleting the content, close Analysis for Office and it works. Either the Analysis for Office message or the BW dump explain the solution. But maybe someone has the same issue, this is the solution.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Analysis Office Table Design, API and Design Rules

    Since Analysis for Office 2.0 you have the option Table Design. You can now create new empty rows and columns.

    SAP Analysis for Office Table Design
    SAP Analysis for Office Table Design

    So you were able to use own Excel formulas in a Crosstab. But in Analysis for Office 2.0 the formulas disappeared when you refreshed a query. Since Analysis for Office 2.2 the Excel formulas
    survive a refresh. This is a really nice function. You can read this in the post „Analysis for
    Office: How to work with Excel formulas
    „.

     

    Now in Analysis for Office 2.2 SP3 the Table Design API got new rather advanced features like
    SAPSetText or SAPInsertLine. SAPInsertLine has now two new options for the parameter PositionBy:

    • DimensionGroup
    • Tuple

    With SAPInsertLine you can add a new row or column via VBA. For Example:

    Dim RuleId as String

    RuleId = Application.Run(„SAPInsertLine“, „NewLine1“, „DS_1“, „After“, „Dimension“, „0CALYEAR“)

    With this command you add a new columns after the dimension 0CALYEAR. Be careful the Help file declares lResult as Long but this is wrong! To explain all SAPInsertLine parameter
    I will write an own post.

     

    You can use SAPSetText to add texts to inserted cells. You can also rename measures in the crosstab. At the moment I haven’t got any more information about this function. In Analysis for Office 2.3 you get a new feature, called Design Rules tab. You find the Design Rules on the 4th tab of the
    Design Panel.

    SAP Analysis for Office Design Panel
    SAP Analysis for Office Design Panel

    On the Design Rules tab you can see and edit the rules created with Table Design. The rules are displayed per DataSource and rule type. First you select the DataSource and then the rule type. You
    can actually choose between four rule types:

    • Format
    • Formula
    • Text
    • New Lines

    The accessible rule types are displayed in a Dropdown Box for the selected DataSource. The first column show you if the rule is active or deactivated. If you see a square the rule is active, if
    you see a diamond the rule is deactivated. If you deactivate a NewLine-Ruletype the line disappear from the table design.

    Analysis Office Design Rules Active Rule
    Active Rule
    Analysis Office Design Rules Deactivate Rule
    Deactivate Rule


    The value column show for example the content of a text rule.

    SAP Analysis for Office Design Rules Ruletype Text
    SAP Analysis for Office Design Rules Ruletype Text

    The style is an ID that is unique for each rule. The description is automatically set by the Analysis for Office for formats, formulas and texts. NewLines haven’t got a description.

     

    The priority of a rule can be changed by the arrows above the list. You can easily move the rules up and down.

    SAP Analysis for Office Design Rules Move Rule
    SAP Analysis for Office Design Rules Move Rule

    You can edit only formats and new line-rules directly from the Design Rules tab. The other rules can only be deleted, activate or deactivate in the Design Rules tab.

     

    Note: You can only edit new line rules after you change the height of a new line once manually.

     

    If you have a large report with many design rules you love the feature „Keep selection in synch with crosstab selection“ because if you select a cell in the crosstab, the associated rule is
    highlighted in the text.

     

    Note: It is highlighted only if you are in the right list. For example if you click on a formula, but your list is on new line, nothing happened.

     

    If you want to remove all Table Design modifications, switch to the components tab and choose Reset Data Source in the context menu.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.

  • Analysis Office SAPOpenWorkbook

    A new feature of Analysis for Office 2.3 is a macro called SAPOpenWorkbook. Some of you maybe know
    the old sapbex.xla!SAPBExReadWorkbook or the BExAnalyzer.xla!runWorkbook command.

     

    The user guide explanation for this macro is:

     

    You can use this API method to open an Analysis workbook. The workbook that should be opened can be stored on a SAP NetWeaver server or on a BI platform.

    The workbook is opened in the same Microsoft Excel instance. After the command execution, the opened workbook is active.

     

    As you know the sapbex.xla!SAPBExReadWorkbook respectively BExAnalyzer.xla!runWorkbook command needed either an established connection from the addin or you
    created your own connection with the following code:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    Dim R3 As Object 'Connection Object
    Set R3 = CreateObject("SAP.Functions")
    With R3.Connection .system = "ABC" 'system
      .client = "001" 'client
      .user = "reyemsaibot" 'user
      .Password = "4711" 'password
      .Language = "EN" 'language
      .systemnumber = "00" 'systemnumber
      .hostname = "172.23.13.70" 'hostname
    End With
    
    'Test Connection
    If R3.Connection.logon(0, True) <> True Then
      Exit Function
    End If
    

    In Analysis for Office the macro SAPOpenWorkbook use the connection of an existing DataSource. So you can’t
    define your own connection with a super user or something like that.

     

    Here is an example code:

    1
    2
    3
    4
    Sub OpenWorkbookViaAPI()
      Dim lresult As Long
      lresult = Application.Run("SAPOpenWorkbook", "DEMO_5", "DS_1", "ZCOUNTRY_VAR_02", "AT", "0I_FPER", "001.2011 - 004.2011")
    End Sub
    

    The name Demo_5 is the technical name of the workbook from a SAP NetWeaver server. If you want to use a document, which is
    stored on a BI Platform, you need the CUID.

     

    The connection parameters will be used from the DataSource DS_1. This parameter is mandatory if you have several connections in a workbook. If you have only one connection, it is
    optional. The target workbook will be opened from the referenced connection of DS_1.

     

    The variable parameter for ZCOUNTRY_VAR_02 is optional, but if you have a mandatory variable you have to assign a value, like the 0I_FPER variable.

     

    If you want to refresh your workbook on opening, you have to set the parameter “Refresh Workbook on Opening”. You also need an established connection or you see the logon popup.

    Analysis Office Logon Netweaver
    Analysis Office Logon Netweaver

    New is the feature that you can predefine your variable value for the new workbook. This is nice but it is still not the same as in BEx Analyzer,
    because you have to use the connection from a existing DataSource. I hope SAP will provide us more in the future.

    author.


    I am Tobias, I write this blog since 2014, you can find me on twitter and youtube. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.