Quantcast
Channel: SAP BusinessObjects Design Studio
Viewing all 662 articles
Browse latest View live

Baby Steps - Creating an HTML5 Chart Wrapper with Design Studio 1.2 SDK

$
0
0

I decided to see how easy it would be to create an HTML5 Chart Wrapper component Addon using the new Design Studio SDK.

 

 

I have a pretty good background on writing several Xcelsius addons both in Flex 2 and Flex 3.1 APIs, and it was a very painful experience due to how juggling PropertySheet values from one SWF to another SWF behaved.  I had high hopes that this was much improved in DS, and have not been disappointed.

 

 

I picked ChartJS (http://chartjs.devexpress.com/) but any other HTML5 charting API such as FusionCharts etc would work, I suppose.  This was a proof-of-concept so you'd also want to consider 3rd party chart engine licensing for production usages of course, but that was beyond the scope of my small test.

 

 

The first thing I did was attend the ASUG webinar hosted yesterday (11/26/2013) which gave an excellent overview of some sample addons and how to get started.  Everything I needed was also in the Developer Guide and SDK Templates located at http://help.sap.com/boad on SAP Help.

 

 

My goal was simply to see a chart show up and make a few chart configuration properties made available and evaluate how feasible it would be at that point, and then at a later stage, bind real data to the chart, based on results.  I may post a subsequent blog post later with those results, but probably most people familiar with JSON will find this a trivial exercise.

 

 

I began with the ColoredBox template project available on SAP Help's site (http://help.sap.com/boad) and imported into Eclipse.  Next, I downloaded the ChartJS files and copied the JS files into this project.  In order to have DS pull those in, I had to modify contribution.xml by adding a few extra jsInclude entries:

 

<jsInclude>res/js/component.js</jsInclude>

<jsInclude>res/js/dx.chartjs.js</jsInclude>

<jsInclude>res/js/knockout-2.2.1.js</jsInclude>

<jsInclude>res/js/globalize.min.js</jsInclude>

 

I also included a few new properties, as again, I was curious to see this work better than in Xcelsius days of addon SDK work:

 

<property id="title" type="String" title="Chart Title" group="Display" />

<property id="rotated" type="boolean" title="Rotate Chart" group="Display" />

<property id="animated" type="boolean" title="Animated" group="Display" />

<property id="legendVisible" type="boolean" title="Legend Visible" group="Display" />

 

Finally, the meat of the code to pass the parameters from the component to the underlying sample chart occurred in component.js:

 

sap.designstudio.sdk.Component.subclass("com.ipaper.sample.charts.StackedBar", function() {

 

  var that = this;

  var _title = "Example Chart";

  var _chart = null;

 

  this.animated = function(value){

  if(value!=undefined){

  var c = this.$().dxChart("instance");

  c.option({

  animation : {enabled : value}

  });

  }

  return this;

  };

 

  this.legendVisible = function(value){

  if(value!=undefined){

  var c = this.$().dxChart("instance");

  c.option({

  legend : {visible : value}

  });

  }

  return this;

  };

 

  this.rotated = function(value){

  if(value!=undefined){

  var c = this.$().dxChart("instance");

  c.option({

  rotated : value

  });

  }

  return this;

  };

 

  this.title = function(value) {

  if(value!=undefined) {

  _title = value;

  var c = this.$().dxChart("instance");

  c.beginUpdate();

  c.option({title : _title});

  c.render({

  animate : false

  });

  c.endUpdate();

  }

  return this;

  };

 

    this.afterUpdate = function() {

    // alert("after update");

    };

  this.init = function() {

  // alert("init");

  var dataSource = [

                   { state: "Germany", young: 6.7, middle: 28.6, older: 5.1 },

                   { state: "Japan", young: 9.6, middle: 43.4, older: 9},

                   { state: "Russia", young: 13.5, middle: 49, older: 5.8 },

                   { state: "USA", young: 30, middle: 90.3, older: 14.5 }

                   ];

  this.$().dxChart({

     dataSource: dataSource,

     commonSeriesSettings: {

         argumentField: "state",

         type: "stackedBar"

     },

     series: [

         { valueField: "young", name: "0-14" },

         { valueField: "middle", name: "15-64" },

         { valueField: "older", name: "65 and older" }

     ],

     legend: {

         verticalAlignment: "bottom",

         horizontalAlignment: "center"

     },

     valueAxis: {

         title: {

             text: "millions"

         },

         position: "right"

     },

     title: _title,

     tooltip: {

         enabled: true,

         customizeText: function () {

             return this.seriesName + " years: " + this.valueText;

         }

     }

  });

 

  };

 

 

  this.color = function(value) {

  if (value === undefined) {

  return this.$().css("background-color");

  } else {

  this.$().css("background-color", value);

  return this;

  }

  };

});

 

Again, I didn't worry too much about the data binding from a datasource perspective (baby steps!), however the final product was a configurable Stacked Bar chart with a few properties that just worked!

 

Chart Exampled - DS SDK.png

My impression is that this is really easy!

 

The hardest thing for me was to figure out enough jQuery syntax to make things work, as I'm more of a pure JavaScript DOM manipulation guy, so that was really the toughest part of any of this probably will be super easy for jQuery gurus.  I can see charting API gurus flocking to this SDK!  I foresee some really awesome addons coming from the community in the near future!


DS 1.2 SDK Example - Embedding Xcelsius SWFs (not for Mobile, of course)

$
0
0

I decided to see what kind of a Frankenstein creation I could make work by parameterizing a DS Addon to drive an embedded SWF (Xcelsius, even) for fun.  This of course will fail miserably for mobile use cases, but maybe someone who had a very specific reason to embed a SWF in some sort of crazy way may find this useful.

 

Was this a bad idea?  Probably.  Was it funny to see work?  Yes.

 

Basically, my intent was to see if I could add a few sample parameters to a DS addon that would carry over to a SWF via Flash Variables.  Probably a better way to do this for more fluid or interactive interactions would have been implementing some of this using External Interface to the Flash runtime, but seeing as I'll personally never use this addon for any productive use, I didn't fully build that out, but anyone who uses the ExternalInterface connectivity for Xcelsius already knows enough JavaScript to figure that out, but I digress...

 

Similar to my last blog entry, I made some changes mostly to the contribution.xml and contribution.js files to implement this.  I chose the jQuery Tools framework to implement the Flash object embedding, but you could also use SWFTools or others, I'm sure.  This was the only JS Include I had to add to the contribution.xml file.  I did however also add a few properties, such as SWF URL, Chart Title, Chart Values, and Chart Labels:

 

<?xml version="1.0" encoding="UTF-8"?><sdkExtension xmlns="http://www.sap.com/bi/zen/sdk"          id="com.ipaper.sample.xcelsiuswrapper"          title="ChartJS Example"          version="1.0"          vendor="Mike Howles"          >          <component id="XcelsiusWrapper"                    title="Xcelsius Wrapper"                    icon="res/icon.png"                    handlerType="div"                    propertySheetPath="res/additional_properties_sheet/additional_properties_sheet.html">                    <jsInclude>res/js/component.js</jsInclude>                    <jsInclude>res/js/jquery.tools.min.js</jsInclude>                    <cssInclude>res/css/component.css</cssInclude>                    <property id="color" type="Color" title="Color" group="Display" />                    <property id="swf" type="String" title="SWF URL" group="Display" />                    <property id="title" type="String" title="Chart Title" group="Display" />                    <property id="chartVals" type="String" title="Chart Values" group="Display" />                    <property id="chartLabels" type="String" title="Chart Labels" group="Display" />                    <initialization>                              <defaultValue property="WIDTH">400</defaultValue>                              <defaultValue property="HEIGHT">300</defaultValue>                              <defaultValue property="title">Xcelsius Title</defaultValue>                              <defaultValue property="chartVals">10,20,30,20,10</defaultValue>                              <defaultValue property="chartLabels">Widgets, Gizmos, Cogs, Wheels, Spokes</defaultValue>                    </initialization>          </component></sdkExtension>

 

Next, I made some of these properties available to the pseudo JS language in the contribution.ztl file:

 

class com.ipaper.sample.xcelsiuswrapper.XcelsiusWrapper extends Component {          /* Returns the current color of the box */          String getTitle() {*                    return this.title;          *}          /* Sets the chart title */          void setTitle(/* the new title */ String newTitle) {*                    this.title = newTitle;          *}            /* Returns the chart labels */          String getLabels() {*                    return this.chartLabels;          *}            /* Sets the chart labels */          void setLabels(/* new chart labels */ String newLabels) {*                    this.chartLabels = newLabels;          *}            /* Returns the chart values */          String getValues() {*                    return this.chartVals;          *}            /* Sets the chart values */          void setValues(/* new chart values */ String newValues) {*                    this.chartVals = newValues;          *}
}

 

And finally, I implemented the JavaScript code to make all this work.  I did have to rely on some global declarations to track multiple SWF instances, and also due to the way that Xcelsius fires a setSWFISReady JS callback.  There's probably a better way, but whatever.  It worked for this exercise.

 

// Global Xcelsius callback function
function setSWFIsReady(xlcID) {          var ref = swfStatus.getInstanceById(xlcID);          if(!ref) return;          ref.loaded = true;          // Issue callback notifying DS that Xcelsius SWF is loaded.          ref.dsRef.swfLoaded();
}


// Singleton-type registry for Xcelsius callback tracking
var swfStatus = swfStatus || {
                    instances : [],                    registerInstance : function(dsRef){                              for(var i=0;i<this.instances.length;i++){                                        if(this.instances[i].dsRef==dsRef) return this.instances[i];                              }                              var newRef = {                                        dsRef : dsRef,                                        id : "xlcsWrapper" + this.instances.length                              };                              this.instances.push(newRef);                              return newRef;                    },                    getInstance : function(dsRef){                              for(var i=0;i<this.instances.length;i++){                                        if(this.instances[i].dsRef==dsRef) return this.instances[i];                              }                              return null;                    },                    getInstanceById : function(id){                              for(var i=0;i<this.instances.length;i++){                                        if(this.instances[i].id==id) return this.instances[i];                              }                              return null;                    },                    loaded:false,                    id:null,                    dsRef:null
};




sap.designstudio.sdk.Component.subclass("com.ipaper.sample.xcelsiuswrapper.XcelsiusWrapper", function() {


          var that = this;          this.swfAPI = null;          this._title = "";          this._swf = "";          this._chartVals = "";          this._chartLabels = "";            this.chartVals = function(value){                    if(value!=undefined) {                              this._chartVals = value;                              this.redraw();                    }                    return this;          };            this.chartLabels = function(value){                    if(value!=undefined) {                              this._chartLabels = value;                              this.redraw();                    }                    return this;          };            this.swf = function(value) {                    if(value!=undefined) {                              this._swf = value;                              this.redraw();                    }                    return this;          };          this.title = function(value) {                    if(value!=undefined) {                              this._title = value;                              this.redraw();                    }                    return this;          };      this.afterUpdate = function() {              // alert("after update");    };          this.redraw = function(){                    var regRef = swfStatus.registerInstance(this);                    regRef.loaded = false;                    this.swfAPI = this.$().flashembed({                              src : this._swf,                              id : regRef.id                    },{                              title : this._title,                              chartVals : this._chartVals,                              chartLabels : this._chartLabels                    });           };    this.init = function() {                    this.$().css("padding","5px");                    this.redraw();          };          this.swfLoaded = function(){                    // Xcelsius Loaded Callback                    var swfID = swfStatus.getInstance(this).id;                    var movie = document.getElementById(swfID);                    // Insert Xcelsius External Interface API calls at this point, if I wanted.          };          this.color = function(value) {                    if (value === undefined) {                              return this.$().css("background-color");                    } else {                              this.$().css("background-color", value);                              return this;                    }          };
});

 

The end-result was a configurable, and questionably-useful component that you can configure programatically in DS and the Properties pane:

 

x1.png

As you can see, after dropping in the wrapper, setting a SWF URL, and a few example properties mentioned above, you have an example of a SWF you can manipulate using Flash Vars.  Next, I added two buttons that just populate the component with different "datasets"

x2.png

And, at runtime, this is the result of clicking:

 

x3.png

For those of you who enjoy seeing the strange marriage between DS and Xcelsius, enjoy! 

SAP Design Studio Tips & Tricks #4 – Collapsible panels for richer user experience

$
0
0

SAP Design Studio Tips & Tricks Series


Traditional dashboards tend to have selection panel(s) on the left or on the top. However with mobile dashboards every pixel is a luxury, and jQuery-like collapsible (or sliding) panels turn out to be an attractive option.

 

SAP Design Studio supports collapsible selectors that could be controlled through BIAL (BI Action Language) scripting. Consider the following application:


SAP Design Studio Tips & Tricks #4 - Collapsible panels for richer user experience

 

When the filter icon on the top-left is clicked, the selection panel slides in, and other controls resize to accommodate the pane. Clicking the filter icon again causes the panel to slide out.

 

SAP Design Studio Tips & Tricks #4 - Collapsible panels for richer user experience


If you are considering migration from SAP Dashboards to SAP Design Studio, you should review the design principles rather than replicating the design used in SAP Dashboards. For example, it is not possible to design exactly similar collapsible panels in SAP Dashboards. This demonstrates that what worked for one tool (SAP Dashboards) may not work for another (SAP Design Studio).

 

Click herefor a detailed document.

 

Also visit

SAP Design Studio Tips and Tricks #1: Swapping charts into focus on-demand             
SAP Design Studio Tips and Tricks #2: Dynamic Thumbnails for better performance and usability
SAP Design Studio Tips and Tricks #3: Resizable charts for better usability and experience

 

Source: http://www.visualbis.com/blogs/design-studio/2013/10/16/sap-design-studio-tips-tricks-4/



Review of updates to Design Studio Book for 1.2

$
0
0

SAP Mentor Ingo Hilgeforthas updated his Design Studio eBook to include 1.2 - he mentioned this Updated eBook for SAP BusinessObjects Design Studio 1.2

 

In addition to covering updates, he includes installation instructions - and not just for new installations but updates as well.  If you have followed the SCN forums you will know that some people performed the full installation when they just needed to include updates and there have been some issues with this.  The installation instructions also include the NetWeaver installation instructions and the Enterprise Portal. 

 

The book also covers user security on the BI Platform.  What authorization objects are needed if you are deploying this on NetWeaver?  Single sign-on?  This is covered in the book.  For better performance, should you use BEx queries or BEx query views?  You can follow along with the examples by activating SAP NetWeaver Business Warehouse Demo Model on your system.

 

What is the benefit of the eBook?  It contains color pictures.  Any links in the book are also clickable and take you to the desired location.

 

Do you need an actual Kindle to read the book?  No, I am reading it using the Kindle Cloud Reader.

kindle.PNG

He has a chapter dedicated to 1.2 features and step-by-step instructions on how to use the new features in 1.2.  He also has an updated chapter on product roadmap and outlook for 1.3.

 

If you haven't already purchased the book, I recommend you check it out and at least try the sample chapter provided.  If you are an Amazon Prime member, "With your Prime membership, you can borrow this book for free on your Kindle device." per Amazon.

 

I look forward to the next chapter covering SDK's, specifically the Graphomate plug-in that Ingo demonstrated at Reporting 2013 last week.  I should also add that the estimated page count before the 1.2 update was 432; now the estimated number of pages per Amazon is 536.

 

Related Links:

Mastering SAP BusinessObjects Design Studio with SAP NetWeaver BW – Book Report

Updated eBook for SAP BusinessObjects Design Studio 1.2

Optimize the performance of your SAP BusinessObjects Design Studio solutions – tips and tricks

$
0
0

  Optimize the performance of your

SAP BusinessObjects Design Studio solutions – tips and tricks

 

 

     SAP BusinessObjects Design Studio allows you to build solutions on SAP Netweaver, SAP HANA and with the new version 1.2 on BusinessObjects Universes. With the technical possibility to create very advanced dashboards, one of the main criteria driving the End User adoption is performance: whatever you may bring into these dashboards in terms of content and nice design, you will get the buy-in you are looking for only with a very high interactivity, there is no time to wait !

 

     After a first blog on Design Tips and Tricks, here is a second article that specifically deals with performance. Based on our experience with real implementations (SAP Runs SAP), we have collected and documented a list of things to do to make sure our Design Studio Apps are optimized to offer the highest responsiveness!

 

      Note: for each item in the list below, we have made an assessment on the potential performance improvement. This potential is an indicator, it does not mean it systematically brings the same percentage of speed growth, as there are many parameters entering into the overall results.

 

     Disclaimer: all information below are the result of investigation made by myself and some other colleagues from the team. There is no commitment from SAP regarding the points below. We just want to share our point of view, our investigations about how we have improved our performance.

 

 

          1. PageBooks and Tabs – management of the initial view 

               –>  Performance improvement potential : very high

 

     This is the most important of all of the aspects! With a careful handling of such design configurations, you can drastically influence the perception at each navigation step.

  pagebook.png

     tab.png

 

     When your app includes Tabs or Pagebooks, this means that there are several “screens” where only one is active and visible. Therefore, only the data sources on this active screen (page or tab) should be processed.

- When leaving this active view, “Resetting” the corresponding data sources should not be done (the screen it not visible anyway). 

- All the data sources of the other inactive views should not be the object of any action as long as these views are not visible.

 

The code in this event handler must be structured in a way that only the data sources related to the displayed view are processed:

 

if ((PAGEBOOK_1.getSelectedPageIndex() == 0)) {

    // Touch data sources relevant for your first page

  // ...

} elseif ((PAGEBOOK_1.getSelectedPageIndex() == 1)) {

   // Touch data sources relevant for your second page

   // ...

} elseif ((PAGEBOOK_1.getSelectedPageIndex() == 2)) {

   // Touch data sources relevant for your third page

   // ...

}

 

 

         2. Carefully select the data sources that are loaded at startup

               –>  Performance improvement potential : very high

 

     By default, all data sources are loaded in Design Studio at start up. For simple dashboards, this does not alter the perception of the end user and the data show up in a few seconds – with the advantage that they are now included.

 

     For multi-page applications, the number of data sources and of components to be loaded will have a more significant impact and the end user may need to wait for an approximate 30s to 1 minute if nothing is settled to change this. 

 

     Solution: since only the data sources for the first screen are needed at startup, all other data sources should set the “Load In Script” to “true”.

 

load_in_script.png These other data sources must be loaded afterward within the script making the related components visible:      

     DS_1.loadDataSource();

 

 

     Note: when a startup script is used (for example in the case of multiple views, to handle the fact only one view is visible), not only “Load in Script” must be properly set as described above, but also you need to pay attention for the “loadDataSource()” in the script to avoid to load Datasources unnecessarily with a performance impact. To make it simpler:

 

 

Load in scriptloadDatasourceConsequence on processingConsequence on Performance
FalseNot calledKPI is visible – the datasource is loaded

Positive impact - Expected setting for visible KPIs on startup
performance depends on the datasource, and will impact the opening time

FalseCalledDataSource loaded twiceNegative impact
TrueCalledKPI is not visible on startup – however you load the Datasource

Positive impact- Expected setting for KPIs not visible on startup – performance depends on the datasource, and will impact the time to switch to the KPI

TrueNot calledError: you try to display a KPI while the datasource is not loadedNegative impact

 

 

          3. Initialize data sources in “background processing” (available since 1.2)

               –>  Performance improvement potential : very high

 

     This feature can help if: 

- Multiple data sources per screen are really needed

- The components relying on these data sources are visible at the same time.

 

     With “background processing”, the “most important” data sources can be initialized first (and these components show the data right away) and the other components are initialized shortly after in the“On Background Processing” script of the application.

 

 

     Example:

Supposing when you open your dashboard, you have several datasources/charts to show in the first page, and other datasources/charts in other pages. 

What the background processing will allow you to do is:

  • Show data, chart after chart for the first page (You have to define which chart you want to load/show first, then the second one, third one, …)
  • As soon as all charts from page 1 are loaded, load charts for the other pages with the background processing mode. This will improve your opening time, and the load of datasources from page 2, 3, … will be transparent for end-users.

 

 

     In Design Studio:

  • For datasources/charts that you need first, keep “Load in script = false”
  • For all other datasources, please select “Load In Script = true”. Then in the “On Startup” script this line must be added:

                APPLICATION.doBackgroundProcessing();

 

     This will trigger the “On Background Processing” script after the rendering has finished. Inside the “On Background Processing” script, the other data sources can be initialized with line calls like:

               DS_XX.loadDataSource();

 

 

Note that this concept is not limited to two levels (“main” data sources vs. other data sources), but it is also easily possible to create a sequence-chain of data sources to be initialized.

 

Note: the “On Background Processing” concept is not limited to the application startup. On newly displayed pages of a pagebook or tabstrip the most important data can also be shown first and the other data sources can be initialized subsequently.

 

 

Taking an example:

     To use a tile effect, in which datasources are loaded one-by-one, the application designer can use the recursive functionality.

 

     If 6 different DSs are used within the application, and they show their data one after the other, a script like this one could be used:

 

tiles.png

 

On the “On Startup” script, please add 

      APPLICATION.doBackgroundProcessing();

 

Create a variable Variable1, initialize it to 0

 

Then, on the background processing function, add:

if(Variable1 == 0){

DS_1.loadDataSource();

//the chart linked to DS_1 will appear

}

if(Variable1 == 1){

DS_2.loadDataSource();

//the chart linked to DS_2 will appear

}

if(Variable1 == 2){

DS_3.loadDataSource();

//the chart linked to DS_3 will appear

}

if(Variable1 == 3){

DS_4.loadDataSource();

//the chart linked to DS_4 will appear

}

Variable1 = Variable1 +1;

if(Variable1 < 7){

APPLICATION.doBackgroundProcessing();

}

 

     Following this code, tiles will appear one after the other one. During the time you will load DS_2, DS_3, etc… end-users will be able to read/play with DS_1, and the loading time of DS_2, DS_3, etc… will be transparent for end-users. So, the perception of the loading time will be completely different.

 

 

          4. Upgrade to version 1.2 SP1

               –> Performance improvement potential : very high

 

     In this release, a number of changes have been introduced in the Designer and in the BIP Add-on. In particular, SAP BusinessObjects Design Studio uses a SAP library (BICS - Business Intelligence Consumer Services) to access the data – enhanced with additional enhancement of the memory consumption leading to significant improvement.

 

 

          5. SetVariableValue/setFilter/setDataSelection

               –> Performance improvement potential : very high

 

     Depending on the definition of the source BW Queries, you may have to create some filters in Design Studio especially in case end-users have required drop down lists, list boxes, etc…

 

     To achieve this, there are various possibilities with different costs on the performance. In particular, it is preferable to use a “setFilter” instead of  setVariableValue” wherever possible. “setVariableValue” impacts the VariableContainer and therefore refreshes all the datasources embedded in this container. This may significantly impact the performance, executing more data refresh than needed.

 

     To summarize, here is a general impact of the different types of filters on the performance:

          Highest: “setVariable”: BW roundtrips for multiple data sources

          Medium: “setFilter”: BW roundtrip for one data source

          Lowest: “setDataSelection”: no BW roundtrip

 

 

          6. Use one datasource for multiple charts (available since 1.2)

               –> Performance improvement potential : medium / high

 

     If several chartsshow the result set of the same query in different ways in your application,this requires any version until 1.1 to create distinct data sources for each chart. Each of the data sources used a different “Initial View” setting to display the different data.

 

     Design Studio 1.2 offers the possibility to use a single data source in multiple charts. The data source has an Initial View that contains the superset of all needed data. The chart itself has a new property “Data Selection” which allows filtering only the relevant data for the specific chart.

 

data_selection.png

 

     The “Data Selection” can be exposed via a “picking tool” in the property sheet or by editing the “Data Selection” manually. In most cases the picking tool should be enough. The syntax for manual data edition is not yet fully documented. 

 

     As data sources are the most significant performance driver in Design Studio applications, minimizing the number of data sources is always a significant performance gain.

 

 

          7. Care of issues on the “Error log”

               –> Performance improvement potential : small / medium

 

     When the application is running, you should check carefully “Message View” or in the Designer’s “Error Log” view. Sometimes these entries indicate programming errors/issues. Some programming errors could impact performance.

 

     For example, if the data source is asked for data that does not exist (warning message: There is a problem with the measure or dimension that you wanted to select using getData or getDataAsString), the tool will check for a non-existence, with high cost (generally via a backend-roundtrip).

 

 

          8. Use “Global Script Variables” instead of “hidden text fields”

               –> Performance improvement potential : small / medium

 

     In the past, Global Script Variables were not available in Design Studio; therefore, you had to use “Hidden text fields” or Dropdown lists to simulate variables.

 

     This has changed since version 1.1. Global variables are available and use far less resources than a hidden text field as it overall reduces the number of components. It also cleans up the “Outline View” of the application.

 

 

          9. Use CSS classes in one text field instead of two text fields

               –> Performance improvement potential : small / medium

 

     On your app, if you need:

  • to increase size when an item is selected
  • to put a text when an item is selected
  • show values in red or green depending of the value (for e.g. up or down to 0)

 

     You should leverage the dynamic javascript code (setCSSClass), instead of:

  • overlapping two texts (one in bold and one without bold) and play with dynamic visibility
  • overlapping two texts (one in red and one in green) and play with dynamic visibility

 

     Doing this, the number of text fields is reduced and performance improved. The reduced number of components will save resources and make the complex tree in the “Outline” view more usable.

 

 

          10. Summary : parameters influencing the performance

 

ParameterPossible cases
Load In Script

When multiple tabs/pagebooks:

- true: make KPI not visible at startup

- false: only for the KPIs that are visible at startup

“DS”.loadDatasource()When called: datasource is loaded – used in scripts when the datasource is linked to a visible component
APPLICATION.doBackgroundProcessing()When called, for complex dashboards: allowing to delay the processing of non-visible KPIs in the background while first KPIs have been processed

 

      Then, the choice between SetVariableValue/setFilter/setDataSelection could have a huge impact of performance.

 

 

Conclusion

 

     Following all of these recommendations with a careful management of your javascript, your queries, and your components, you can expect to have a dashboard running very fast.

 

     Design Studio offers a smart way of data management, processing the right minimum of sources (only information that your business can view). In parallel, the background processing helps to load the data for other KPIs, other views, in a transparent way for the end user. With this, data are already there when the user switches to another view and information comes up instantaneously.

 

 

Have a good time on Design Studio!!

BEx Quo Vadis? ASUG Webcast Part 2, Focusing on Design Studio

$
0
0

Today ASUG had a BEx Quo Vadis webcast, with 57 questions in the question and answer.  Interest was quite high.

 

Part 1 is BEx Quo Vadis? BI Client Recommendations for BEx Customers ASUG Webcast Part 1

 

Future items are subject to change and any forward looking statements are subject to the disclaimer (no commitment).

2fig

Figure 1: Source: SAP

 

We are in the middle stage here as shown in Figure 1

 

SAP has enabled the SDK in Design Studio 1.2

 

For the agnostic space they have added.UNX support

 

Look to the future – 1.3 planned to ship in Q2 next year

 

SAP plans to offer a Lumira SDK for Design Studio to build components for both

3fig

Figure 2: Source: SAP

 

Analysis Edition for Office/OLAP and Design Studio are recommended

 

Reporting use case – Crystal and Web Intelligence

 

5fig

Figure 3: Source: SAP

 

Figure 3 was not directly covered in the webcast, but was included in the slides.  Future plans are subject to change.  Questions during the webcast include bookmarking and BW-IP.

 

1dsfig

Figure 4: Source: SAP

 

Figure 4 was not discussed in the webcast but was included in the slides.  This deployment option has been discussed before during other conferences.

 

4dsfig

Figure 5: Source: SAP

 

During the webcast SAP demonstrated an integration with Google Maps.  Figure 5 shows an SDK option by SAP Partner CubeServ

 

 

Subset of Question & Answer

________________________________________________________________

Q:  Can we consider the Design Studio as revised version of WAD tool?

A:  officially, it is a premium "alternative" of it - we target to cover all essential WAD scenarios with Design Studio. 

 

________________________________________________________________

Q:  Is there any limitation on max no of output results(cells) in design studio 1.2 ?

A:  No limitation on the data output itself. 

________________________________________________________________

 

 

Q:  If I were to use SAP Lumira with Bex query(as data source) along with Non SAP systems, it it possible ?

A:  Lumira does not support BEx Queries at this time - only BW BI4 universes 

________________________________________________________________

 

 

Q:  How long MDX statements are supported ?

A:  we don't do MDX in Analysis Office or Design Studio. use queries or HANA models instead 

________________________________________________________________

Q:  Any plans for drag-and-drop functionality with the Analysis grid item similar to what is in BEx 7.x?

A:  drag and drop is possible in Analysis grid, e.g. adding/removing new dimensions/measures, sorting, filtering etc. 

________________________________________________________________

 

 

Q:  If we use Bex queries, we can simulate using RSRT for any specific calculations to be verified/checked. How Can I simulate Design Studio using Bex as data source assuming that built-in custom code within Design studio?

A:  you can use ALL Bex queries in Design Studio ...  

________________________________________________________________

Q:  Is Design Studio a replacement BeX Query Designer?

A:  No it is not - there is no replacement for BEx Query Designer 

________________________________________________________________

Q:  Which mobile devices(Apple/Adroid/windows) versions are supported for Design Studio ?

A:  iOS devices 

________________________________________________________________

 

 

Q:  What is 'Idea Place'?

A:  Go to ideas.sap.com - a place to recommend enhancement requests 

________________________________________________________________

 

 

Q:  Are future enhancements planned for BEx Query Designer?

A:  An eclipse version is coming with 7.40 

________________________________________________________________

 

 

Q:  Does that mean Bex Query Designer is not going away?

A:  It is not going away 

________________________________________________________________

 

 

Q:  is it possible to save a design studio dashboard display to PDF format?

A:  not a native PDF generator yet, we have printing on the roadmap. 

________________________________________________________________

Design Studio Tips and Tricks: Measuring Performance

$
0
0

Why is this blog posted NOW?


Recently Design Studio 1.2 has been released. This new version brings a whole lot of new cool things. Especially the performance of Design Studio applications has been improved significantly. In addition version 1.2 brings many new features that allow application developers to tune the performance of their applications. E.g. the new “On Background Processing” event of the application or the “setDataSelection” method of the chart component. You can find a good overview on how to use these performance features in my colleague’s blog:

 

http://scn.sap.com/community/businessobjects-design-studio/blog/2013/11/29/optimize-the-performance-of-your-sap-businessobjects-design-studio-solutions-tips-and-tricks

 


Why should you use Design Studio's profiling capabilities?


After you have applied your performance optimizations, you should of course measure if you have really improved the performance of your Design Studio application. Or even better – before you tune the performance you should first measure where the runtime of your applications is spent. In most cases measuring performance can be simply be done by looking at the second hand of your watch. But with Design Studio there’s a way that will give you more insight.

 

To measure the runtime of Design Studio applications the URL parameter “&PROFILING=X” can be added to the application’s startup URL.

 

Start your application via the “Execute Locally” action then go to the started browser’s URL edit field and append “&PROFILING=X”:

 

ExecuteLocally.jpg

 

LocalURL.jpg

 

This will re-start the application and you will see the “Statistics” window on top of your application's UI:

Statistics.jpg

 

When you are running your apps on the BI Platform (BIP) or on NetWeaver you can start the profiling via the following three steps:

 

First select the “Send to Mobile Device” menu item:

 

SendToMobileBIP.jpg

Then click on the “Copy URL to clipboard” button:

QRCodeDialog.jpg

 

 

Now the application URL is in the clipboard. Paste this URL to your browser’s URL field but before hitting the return key append “&PROFILING=X”.

BOEUrl.png

 

 

 

What can you do with the Scripting window?

 

First let’s look at the upper part of the window.

UpperPart.png

 

 

The most important information is on the first tab “Java Statistics”.
The Design Studio runtime is implemented in Java running either on BIP or NetWeaver. So the most performance critical algorithms run there. The “Java Statistics Raw” contains the same information as “Java Statistics”, but in a more “technically readable” form” (JSON). This tab is typically used when sending information to the SAP support.

The third tab contains the JavaScript “Rendering Statistics”. After the Java Runtime of Design Studio has performed its heavy duty work, it sends the data to be rendered to the browser and there JavaScript code createsthe user interface. In my experience the JavaScript code almost never was a performance bottleneck - therefore I will focus on the “Java Statistics” only (at least in this blog - I’ll post some more on this later).

 

 

The lower part consists of four buttons:

 

LowerPart.jpg

 

 

The first button downloads the “Java Statistics” to a CSV file that can be opened in Excel. This is cool for Excel Gurus. I personally prefer the next option that downloads the same information into a text file.

 

The third button is the “Refresh” button”. This button is needed because due to timing issues the rendering of the data shown in the Statistics window has been rendered too fast ;-) This means not all of the performance information is visible. Pressing the “Refresh” button ensures that you see the very latest data. Note that this affects only the information directly in the “Statistics” window. If you press one of the “Download” buttons, then all relevant data is contained in the downloaded files.

 

The “Close” button (guess what) closes the Statistics window. However, to continue working with the application you don’t need to close the window. By dragging on the “title bar” you can simply move it to a place where it does not bother too much. The window is modeless so you can still click on the application area. You can even resize the window by dragging the lower right edge of the window. If you have closed the window, it will re-appear after you have triggered a server-roundtrip.

 

 

What can you do with the statistics information?

 

After we have downloaded the relevant information as a text file – we’ll get a lot of strange looking information:


Step 0: UID: null
  Runtime: 1360 ms, Java: 332 ms, remote: 1028 ms
  Java events: 1360 ms
    1360 ms: Application step ZEN (12500)
      1360/16 ms: Process request ZMK_TEST_02 (12600)
        1032 ms: Process page command SET_TEMPLATE (12608)
          1032/50 ms: Initialize item main_template (14100)
            0 ms: Create system service TEMPLATE for local [MASTER SYSTEM]
            967 ms: Process page command CREATE_DATA_PROVIDER (12608)
              0 ms: Create service PAGE_OBJECT
              967 ms: Initialize data provider DS_1 (13100)
                967 ms: Create system service BICS_QUERY_VIEW for Q93 [PUBLIC]
                  47 ms: Get connection
                  78 ms: Create system service MASTER_SYSTEM_SETTINGS for Q93 [PUBLIC]
                  795 ms: Setup initial state (13001)
                    795 ms: Create system service BICS_PROVIDER_QUERY_VIEW for Q93 [PUBLIC]
                      249 ms: RFC BICS_PROV_OPEN (10000)
                      47 ms: Create system service BICS_DATA_AREA for Q93 [PUBLIC]
                      499 ms: RFC BICS_PROV_GET_INITIAL_STATE (10000)
                        499 ms:  BICS_PROV_GET_INITIAL_STATE:  (-2)

 

 

At the top of each “Step” we can already see some useful information:

 

          Step 0: UID: null

            Runtime: 1360 ms, Java: 332 ms, remote: 1028 ms

 

 

This tells us that this “Step 0” (i.e. the application startup) took 1360 ms. But only 332 ms have been spent in Design Studio’s Java code. The majority of the time (1028 ms) has been spent “remote”. This means that the time was spent by waiting for remote systems of the data sources. That could be BW systems, HANA systems or BIP Universes.

 

 

After the top-level runtime information we get a hierarchical view on the execution of a step. Each line starts with the time (in milliseconds) that was used. Some of these numbers are followed by a second number separated by slash:

 

          1032/50 ms: Initialize item main_template (14100)

 

The second number (here: 50) means that out of the 1032 overall milliseconds there are 50 ms that cannot be assigned  to any of the sub-steps of this set. I.e. if you sum up all milliseconds of the sub-steps you will get 982 (1032 – 50) milliseconds. The rest of the time is consumed in the “flow” between these steps. So these times after the “/” should typically by quite low (less than 100). If you find times that are over 100, open a bug ticket to the Design Studio team and tell them that they should add a specific entry in the statistic for such a significant amount of time.

 

Note that the granularity of times on Windows operating systems is 15.6 milliseconds. So an entry with “0 ms” does not necessarily mean “almost no time” but just “below 15.6”. This also explains why the “below 100” entries often have values like “16 ms”, “31 ms” or “47 ms”.

 

 

What should I look for in this data?

 

 

In most cases bad performance is caused by accessing data sources. Accessing data sources requires accessing the “remote” system that contains the analytical data. The statistics data varies between the remote-system types (BW, HANA, Universe).

 

As a first example we take a look at BW data sources. BW systems are accessed via the “Business Intelligence Consumer Services” (BICS). These services access the BW system using “Remote Function Calls” (RFC). RFC calls are typically the items that take a significant amount of time.

 

In this example one of the long-running calls is “BICS_PROV_OPEN”. By going up the hierarchy we can see that this was triggered by “Initialize data provider DS_1”:

 

842 ms: Initialize data provider DS_1 (13100)

  842/1 ms: Create system service BICS_QUERY_VIEW for Q93 [PUBLIC]

    36 ms: Get connection

    56/55 ms: Create system service MASTER_SYSTEM_SETTINGS for Q93 [PUBLIC]

      1 ms: Create system service SYSTEM_CAPABILITIES for Q93 [PUBLIC]

    699 ms: Setup initial state (13001)

      699/3 ms: Create system service BICS_PROVIDER_QUERY_VIEW for Q93 [PUBLIC]

        550 ms: RFC BICS_PROV_OPEN (10000)

 

 

If you see several of these “Initialize” entries in the statistics you should check if you really need them within this step. Especially in the startup step there are often too many data sources initialized, but in fact they only needed in later steps (or not at all if the user does not click thru all tabs). You should check the blog mentioned at the beginning to find ways how to change this.

 

Another important call is “BICS_PROV_GET_RESULT_SET”.

 

247/5 ms, 80: Get result set (13004)

  240/3 ms, 80: Get provider result set (13040)

    237 ms: RFC BICS_PROV_GET_RESULT_SET (10000)


The “Get result set” entry indicates that the complete result of a data source is fetched from the remote system. If you see these entries you should check whether the number of retrieved result sets matches the UI that is displayed. E.g. if a user interaction brings up a crosstab and a chart, there should at most be two “Get result set” entries. Even better there should be only one because a crosstab and a chart can share one date source in most cases.

 

Result sets are retrieved when they are needed for the first time:

  • A data bound component (crosstab, chart, dimension filter, filter panel) renders information contained in the data source
  • A script call (e.g. DS_1.getDataAsString) retrieves data from the data source


After that the result set is re-used as long as the data source state does not change. Scripting calls that trigger “Get result set” to be called again are for example:

  • DS_1.setFilter(...);
  • DS_1.activateHierarchy(...);
  • APPLICATION.setVariableValue(...);


If the number of “Get result set” entries is higher than you would expect, then you should check your script code for calls that change the data source state.

 

On the other data source platforms (HANA, Universes) the “BICS_” RFC calls won’t be there. There will be other platform specific entries. E.g. SQL calls for HANA:


15 ms: Get result set(13004)

  15 ms, 3: Get result set (13004)

    15 ms, 3: Get provider result set (13040)

      15 ms: Execute SQL: GET_CROSSTAB_DATA



This means that you should look for the “generic” texts like “Get result set” or "Initialize data provider" if you are analyzing data sources to Non-BW data sources. If you are a BW junkie (like me) and you have used BW performance analysis tools like “RSTT” (RS Trace Tool) you might like “BICS” calls more because you have seen them very often (probably too often) in RSTT ;-)



What's next?

 

I will post some more “Design Studio Tips and Tricks” in the future.

Stay tuned and please share your comments and feedback.


Learning Path with HR Dashboards

$
0
0
Hi Everyone,
As you can see in my bio, I'm a former BusinessObjects employee and I have been working for Global IT for 7 years with a key leitmotiv:
    
“Change how the business is dealing with numbers to move from an operational reporting to a decision tool”
In the past years, I have worked with the SAP HR Organization to empower managers by providing insights on their workforce, to understand their Headcount to steer, meet financial targets, and ensure optimal performance of their organizations.
You will see that we have implemented multiple solutions based on different SAP technologies – I tried to consolidate my findings in a kind of Pros & Cons tables which have to be taken in the SAP context and at the time of the implementation. Today, with the improvement of connectivities and the delivery of new releases, the technical limitations and issues would be probably fixed and technology positioning should be reassessed.

Focus on business expectations

people.jpg
The main requirement was to deliver main KPIs around the headcount area in a very intuitive interface – What is easy with HR is the fact that those KPIs are quite simple and comprehensive as they deal with employees (and we are all employees):
  • Actuals (Headcount Relevant/Non-HC Relevant / C-users),
  • Terminations (Employee or employer initiated)
  • External Hires (direct or Acquisition related)
  • Current Vacant Positions,
  • Committed Headcount,
  • Budget, Forecast
  • Span of Control (average number of direct reports per manager)
In term of dimensions, we have the following ones:
  • Gender for diversity estimation
  • Management level
  • Age and Tenure
  • Education level
  • Functional areas (Sales, Services, …)
With specificities for the following dimensions with mandatory hierarchies:
  • Profit Centers (Management view)
  • Board Areas / Lobs
  • Regional views
We always tried to provide time visibility to allow managers to distinguish the trends and cycles in order to validate that they will reach their target. To allow this, it is not possible to plug the analytical solution on top of the ERP which provides only the current state of an organization. In BW we are able to take snapshots to freeze the headcount picture and implement special aggregation to display average on a given period, or projection at the end of the period.

1st implementation with Xcelsius and Database (LO + Webi)

After the integration of BusinessObjects by SAP, the connectivity between BW and BusinessObjects products was too limited to address the complex BW implementation on HR (support of complex hierarchies and variables, perfomance ...). In addition, the BW HR area didn't contain the right structure to fit business expectations et that time. It was decided to extract the data from BW, enrich it by the business and load it in a transactional database with Data Services. With Xcelsius, BusinessObjects Universe, Webi and Live Office, we were able to provide a desktop solution to HR business partners around the world.
HRBP.png
ProsCons
• Ability to enrich data (excel file)
• Power of Xcelsius with interactivity
• No possibility to support complex authorization concept
• Limitation with Hierarchies
• Limitation with OLAP aggregation (end of period, average)
• High TCO

2nd implementation: Xcelsius on top of BW

We started 4 years ago with a first integrated solution based on Xcelsius using Crystal Reports and Live Office to extract data from BW system. It allowed us to tackle the hierarchy topics. Then we replaced the Crystal piece by BICS connectivity, and with some technical workarounds,  we were able to deliver multiple Xcelsius dashboards integrated in an HTML framework as shown below.
people_scorecard.png
Pros Cons
• Xcelsius calculation with Excel formulas
• Interactivity with multiple components
• Hierarchies not fully supported
• Performance – split dashboard in multiple sub-dashboards
• Not compatible on Mobile (IPAD - swf)

3rd implementation: Bi Mobile with Webintelligence

After the launch of the first iPad by Apple, it was decided within SAP Global IT to focus on mobile solutions. As a result, an analytical solution should be first delivered on Mobile; Desktop would become optional. We were asked to implement a solution for Top Management based on SAP BI Mobile and WebIntelligence reports.
BI Mobile offers a specific way to interpret Webi structure so we decided to define a unique screen structure to deliver different KPis : header, one graphical representation and a table.
 
04-11-2013 18-26-30.png
With links based on opendocument, we were able to offer a workflow with hierarchy and KPI selection and navigation through multiple levels. Nevertheless, performance was not good due to the complexity of the backend requests and the absence of a report cache on the BI Mobile side.
Picture1.png
ProsCons
• Quick Mobile solution
• Possibility to have Webi calculation (ratio, alerter)
• Not able to offer the same kind of interactivity as Xcelsius
• Performance issue with no cache – refresh every time
• Limitation with type of graphics and hierarchies
• Mobile OR desktop / different styles

4th implementation: BI Mobile with Design Studio

At the beginning of 2013, we decided to evaluate Design Studio 1.0 integrated with BI Mobile to improve the usability of the BI solution implemented previously with WebIntelligence. We implemented a navigation framework based on Tiles to copy the LAVA style and Windows 8.
Design Studio allows the use of existing BW queries and quick implementation. It requires a small javascript knowledge as script editor is quite intuitive and SDK model is quite limited. The first version with DS 1.0 was based on more than 23 Data sources and took more than 45 seconds to open and refresh. With a rework of the workflow, we were able to reduce the number of data sources to 8 and the refresh to 15 seconds. To achieve this, we leverage 2 data sources across all the detailed pages and apply changes on the structure on the fly when we access the detail view. With new features in DS 1.2 (background process and selection of KPIs in graphical components) we were able to improve the usability and the user experience.
Cloud.png
ProsCons
• Desktop and Mobile solution
• Support BW authorization concept
• Fully support BW Query (KPI aggregation, hierarchies, variables, filters)
• First releases of Design Studio with limited javascript model (SDK)
• 1 Component (table/graph) = 1 data Source (query)
• No possibility to create additional KPIs on top of data sources
• Limited Graphical displays
• Usability of certain components like Filter panel

5th implementation with Business In Focus

In the context of the implementation of SAP Business In Focus for the board members of SAP, it was requested that we implement a people section with the main HR KPis.
Business In Focus is a Cloud solution with a predefined mobile app. This platform contains a database, an OLAP engine and a Web modelization interface.In the SAP context with all the data consolidated already on a corporate BW system, we decided to extract the data into csv files and push it via an https webservice into the cloud. The data extraction is done via ABAP functions on top of Bex queries and is automated on an hourly basis. Some mappings are done on BW to translate BW keys into Cloud keys to bypass some length limitations. The mapping is maintainable in custom tables.
This solution also contains forecast and revenues pages and is used by the top management for forecast calls and latest estimate calls.
BTA.png
ProsCons
• Quick mobile implementation with Tile approach – no interface development
• Performance with pre-aggregation of data on the Cloud DB
• Excel upload available
• Simple authorization concept limits the deployment – only Top management with Full view
• Dimension Mapping on the cloud
• Support of hierarchies limited
• BW Extraction in csv with ABAP functions – no standard connector
• Only Mobile solution / No desktop solution
Conclusion
I tried to demonstrate via those multiple implementations the different possibilities that technologies enable. The goal was not to position today those different tools as the limitations faced 3 years ago would been gone with new releases or product roadmaps have changed, but more to present different displays of HR KPIs in different contexts.
I hope the read of the blog gives you some ideas and opens some doors to empower the managers of your organization.
What is not covered in this article is the last phase of a BI project which is coming after the implementation and validation: the change management or how to roll-out a solution to a maximum numbers of users with a proper adoption. This is another challenge perhaps more complex in big organizations !!!
Thomas

How to reduce the number of Data sources in Design Studio

$
0
0

Hi colleagues,

 

As explained in a previous blog, we have worked with students on the implementation of a solution for HR organization using BW and Design Studio 1.1 and 1.2.


You can find below the general workflow with a main page with different tiles and each tile allows a navigation on a detailed page with mainly one graph and one table.

BTA_01.png

 

In the current version of Design Studio (1.0 and 1.1), one component has to be implemented on top of one data source and one data source cannot be consumned by multiple components.

 

To deliver the first version of our solution, we created more than 20 Data sources and the initial refresh time was around 45 seconds.

  • 2 Data sources for the Kpis displayed in the tiles
  • 2 data sources for the graphics in the tiles

  • 18 data sources for the dtailed pages (one per component - graph or tables)


The purpose of this article is to explain how we reduce the number of the data sources from 20 to 8 by leveraging 2 data sources for mainly all the detailed pages.

  • 2 Data sources for the Kpis displayed in the tiles
  • 2 data sources for the graphics in the tiles
  • 4 data sources for the detailed pages (max number of component in one page - graph or tables)

 

You can see below that in the initial implementation we had one data source per element and in the optimized solution we leverage the same data source for multiple elements. How is it possible to acheave this?

 

BTA_03.png

 

Everytime the end-user select a tile to access the detailed view, Design studio calls a javascript function with a parameter to make adjustements on the data source.The first step is to remove the previous filters applied on and to remove the potential dimensions available. In the second step we design the data source as expected for the new view. It is quite complex to manage this with javascript and with the data model expectially the filters on the Kpis, but it is much more faster than loading a new data source.

 

BTA_04.png

 

With Design Studio 1.2, we have leveraging a new feature named background processing to allow the solution to free idle reources between the multiple actions (refresh, visibility management, …). With this feature we are able to reduce the end-user waiting perception and the display of components when data is available.  This give the priority for the user interaction.

 

BTA_05.png

 

The background processing is accessible via the properties section of the design studio project and is a javascript function. This javascript can be called multiple times and allows an idle time before beeing executed.

 

BTA_06.png

It has to be combined with global variables to be well used. Instead of refreshing multiple data sources in one call and have an update of the display at the end of the function, we can split the refresh in multiple loops and have an update of the display after each loop. For a user perception, the waiting time is reduced with intermediate updates.


BTA_07.png


I hope this short blog gives you some tips and tricks to be implemented in your dashboards. Don't hesitate to contact me if you have questions.

 

Regards,

 

Thomas

How to install Design studio add-on in a Distributed Landscape

$
0
0

Purpose:

The purpose of this document is to give a high level understanding of how the Design studio add-on should be installed in a Distributed BusinessObjects Enterprise (BOE) or BI Platform (BIP) landscape.


Overview of the landscape:

 

BOE/BIP can be installed in a number of different ways to distribute the different parts of the BOE platform install in order to scale up the Platform capability. Therefore in this document it should be noted that we are just describing one scenario.


In the below distributed landscape BOE/BIP is installed on 3 different systems:

 

  1. CMS only
  2. Processing Tier (APS & other processing servers)
  3. Web Tier

 

Image1.jpeg

 

 

Installing Design studio (DS) add-on in a Distributed landscape

 

DS add-on comes with three features:

  • Analysis Application Web components
  • Analysis Application Service
  • Analysis Application support for Mobile Services

 

Here “Analysis Application Service” is a part of APS (Analysis Processing Server) running on Processing tier and “Analysis
Application Web components” & “Analysis Application support for Mobile Services” are part of Web tier.

 

In the above distributed landscape, DS add-on needs to be installed on all three systems but there is a sequence to be followed in order to install DS add-on on these systems.

 

CMS -> Processing Tier -> Web Tier

 

DS add-on should first be installed on all the CMS systems in the landscape, then on all the Processing Tiers which have APS running Analysis Application Service and lastly on all the Web Tier systems.

 

The DS add-on installer automatically picks up what is installed on the system and it will select the parameters required for that
system.

                                 CMS                                                                                 Web Tier                                                   

Image2.1.jpeg   Image2.2.jpeg

 

                      Processing Tier

Image2.3.jpeg

 

NOTE: If the above mentioned sequence is not followed when installing DS add-on, the error stated below will pop-up when you try to connect to BOE/BIP from a Design studio client.

 

Image3.jpeg

First try in SDK, building a bar chart with benchmark option in D3

$
0
0

Gaining experience with the SDK. I thought about addressing something that is being asked by customers quite often. A benchmark chart. Usually Dashboards of larger organizations show a lot of benchmark results. Often with the restriction that the other results are anonymous.

 

The idea is to have a bar chart where 'your' results are shown in a different color than the rest. Additionally the results are being sorted to have the highest result on the left. Until now I had to go back to BW or HANA to set up a way that I could separate them. But it is much easier to do this in Design Studio without the need to go back to a source system.

 

Using this kind of graph shows how your results are doing in comparison to others. Not only do you get a ranking, but you also have an indication how far ahead/behind you are in relation to the others.

 

the resulting graph looks like this :

 

barchartexample_picture1.jpg

As you can see the results of our entity are ranked third and is at some distance from second place, but also far ahead of third place.

 


To be able to use the graph to  set benchmarks at runtime i've introduced two methods to set and get the current benchmark.

You can set these properties  at design time in the properties view of the  component, but also in script so you can change them at runtime based on user interaction.

Script_setbenchmark_picture2.jpg

 

You can now set the benchmark using for example a global variable that holds the value of the department that is tied to the user looking at the dashboard

 

It is also possible to get the current benchmark from the graph :

Script_getbenchmark_picture3.jpg

 

 

 

Highlights of the code :

 

 

To achieve separate colors i have created two css classes :

.benchmarkbar_benchmark {  fill: steelblue;  fill-opacity: .9;
}
.benchmarkbar_other {  fill: steelblue;  fill-opacity: .6;
}

In the actual code to build the graph there is an evaulation of value in the x-axis to the benchmark property. If they are equal the css class .benchmarkbar_benchmark is used. Otherwise the class .benchmarkbar_other is added.

 

.attr("class", function(d) { if (benchmarkcompany == d.letter) {return BENCHMARKBAR;} else {return OTHERBAR;}})

note that BENCHMARKBAR and OTHERBAR are two string variables that hold the class names.

 

setting and getting the benchmark value is standard. This can be directly copied from the .setColor example of the coloredbox

 

this code was added in the component.js

var benchmarkcompany = null;  this.benchmark = function(value) {  if (value === undefined) {  return benchmarkcompany;  } else {  benchmarkcompany = value;  return this;  }  };

 

and this in the contribution.ztl

/* Returns the current Benchmarkee of the benchmark */
String getBenchmark() {*
return this.benchmark;
*}
/* Sets the current Benchmarkee of the box */
void setBenchmark(/* the new benchmark */ String newBenchmark) {*
this.benchmark = newBenchmark;
*}
}

 

Using D3

D3 is a very powerful JavaScript library that has been added to the SDK. if you look at sites such as D3js.org you see many examples of what you can do. Also you will find tutorials on how to build these graphs.

 

the D3 library can be found in the SDK as wel as in the OPENUI5 / SAPUI5 library that resides on HANA. I think it is really worthwile to go through the tutorials.I especially recommend the tutorials on youtube by d3vienno, he uploaded 20 tutorials that help you to get started on the subject :  http://www.youtube.com/user/d3Vienno

 

For people who want to see the entire code I’ve listed the code in all the files in a separate document

here :  http://scn.sap.com/docs/DOC-50139

My first impression on Design Studio 1.2 vs WAD vs Dashboard

$
0
0

Hi Guys,

 

I have started working with design studio 1.2 after been working with previous version of Design Studio-1.0/1.1  & WAD & Dashboards(Xcelsius)and went live for production with Design studio 1.1,WAD,Dashboards ...

 

Version 1.2 really starts to look and feel for me  like a product you can work with that allows you more complex functionality then just viewing reports.

I really like the dimension filter & filter panel functionality .I am also happy to see tab strip, pagebook, panel &  more graphs, the new option of  working over BO Universe is awesome

.

I can tell you that designing a Dashboard with Design Studio is very fast, and it can support mobile iOS.

 

When you are looking at Design Studio you can see the extreme resemblance to Bex Web Application Designer(at least for me)  , I worked with WAD in the past 8-10 years and have done some amazing web application stuff with it, I have extended the application with xml and java script coding and it was fun and doing the work.

 

When SAP  got into SAP Dashboard , suddenly everything started to be much easy, more sexy and lots of lots amazing functionality ( sometimes with the help of excel  ) it is an amazing and simple tool to work with, and lots of cool ad-on's ,I don't understand why SAP stops fixing him to HTML5

 

When I see Dashboard vs Design Studio, vs WAD, some of my current pain points are those:

 

1. If you want to have complex functionality you must use coding, you need to have developer skills, unlike Dashboards that doesn't require development skills, why not developing those capabilities as Design Studio objects (like excel export etc.)

 

2. At least the users I am working with, has got used to the sexy 3d layout and functionality, which Design Studio do not have yet

 

3. The current version of Design Studio takes you back couple of years from BI perspective on the functionality side (like easy way to export, broadcast, and drill down,        dimension replacement etc.)

 

4. I am missing the "right click" functionality that was in the Bex WAD (I am sure in the future it will be)

 

5. Where is the basic data text information of when was the last time that the information has been refreshed, changed ,etc like WAD has.

 

5. Why in end of 2013 ,SAP still uses a local installation, why can't it be a web application with no local installation (like webi, Analysis etc)

 

Design Studio supposed to be the tool that replaced WAD & Dashboard, it is a substantial task to do, there are lots of work yet to be done in the tool from development, functionality & capabilities side , I do not understand why SAP saying in all of their presentation that this is the tool for Dashboards while it is not ready to the market(from my point of view)

 

I will love hearing what you guys have to say, maybe I am wrong and need to see a different picture

P.S I attach simple Design Studio Dashboard I have created

Cheers,

Adir

Internationalize DesignStudio Applications by reusing RSBEXTEXTS table from BEx WAD

$
0
0

Hi community,

 

in my last DesignStudio customer training my participants were discussing about possibilities to internationalize a DesignStudio application. Here is a way that seems to be a good one even if it is still a workaround for a missing native functionality coming hopefully soon.

 

If you have used BEx Web Application Designer you know that there is a table in BW called RSBEXTEXTS with the following structure...

rsbextexts.jpg

 

Step 1:

Create a generic datasource for that table in your BW system

 

Step 2:

Create a new characteristic having only the minimum elements key and language dependent text

 

Step 3:

Create a dataflow from your datasource to the text table with all needed elements using the following mapping. I don't want to explain all the details which elements are involved, I think all BW people know that :-)

mapping_rsbextexts.jpg

 

Step 4:

In your Application create a new datasource directly on your new infoobject (step 2). No need for a query or something like that. Go to the "Initial View" editor so that your Initial View looks like that...

intial view.jpg

 

Step 5:

Add a dropdownbox to your application and make it not visible in the properties. This element will be used later on for getting the right text.

 

Step 6:

Fill the dropdownbox with the elements from your datasource e.g. in the Application OnStartup event with the code
DROPDOWN_1.SetItems(DS_1.getMemberList(<<name of your infoobject>>, MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, <<maxnumber of elements in your infoobject>>));

 

Step 7:

Now you can fill your TextBoxes with the language dependend texts assigned to your TextKeys you know from BexWAD with code like that:

DROPDOWN_1.SetSelectedValue("<<id of your element>>");

TEXT_1.SetText("DROPDOWN_1.GetSelectedText()");

 

That's all :-) Hope you like it.

 

Dirk

DS 1.2 SDK - Rapid Prototyping Addon HTML/JS Templating

$
0
0

Update:

 

Since there was enough interest, here's the source code available on GitHub (Hey, SCN, since you killed Code Exchange, you got a better place for me to stick it? (No pun intended.)

 

entmike/com.ipaper.sample.htmltemplate · GitHub

 

Original Post:

 

I have been having fun writing a few toy addons for Design Studio, but I wanted to see if I could write something a bit more useful.  I am still learning the ins and outs of the Eclipse SDK, but one part of my workflow that I've noticed could be improved is the amount of time I spend in the Eclipse SDK to tweak a line of HTML or JS, and then hop back to re-launch Design Studio to see the results (or in my case a lot of times, unintended, self-inflicted bugs )

 

As a result, I thought that if I created an HTML and JavaScript templating Addon, I could work native within Design Studio to create one-off visualization proof-of-concepts, as well as some rudimentary data binding as well.  The result is an HTML Template component:

 

htmladdon.png

 

In the screenshot above, you see a few components in the canvas and Outline panel.  (The orange icons under Layout).  The background image, and the two KPI tiles are all the same addon.  I also have a few addons called 'MYCSS' and 'GRADIENTJUNK' that allow me to insert and modify CSS on the fly, but back to the visual components...  Also make note of the HTML and After Init(JS) in the Additional Properties panel which allows you to put in any HTML you wish, as well as a post-initialization block of JavaScript code for further processing.

 

Let's say that you have a very specific, one-off visualization, or a case where you just don't know yet if you'd want your component to be reusable until later.  This would offer a great way to insert arbitrary HTML, JavaScript, CSS, and even Base-64 encoded images (so that you don't have to worry about where to upload the image).  All of these cases including anything else you can accomplish in HTML5 are possible.

 

In order to make these components not just hardcoded, statics fragments, I also created 10 placeholder parameters (See the properties panel). For each Placeholder, there is a corresponding Replacement.  These placeholders and replacements can be maintained directly within the property panel, or even in the Script window:

 

htmladdon2.png

 

In this example, I am setting some text as well as even some image sources at runtime.  (silverMedal and bronzeMedal are global variable strings of type base-64).

 

A simple example of what this would look like at runtime by clicking this button is such:

 

htmladdon3.png

 

This addon could also facilitate things like IFRAMEs, freeform HTML content, etc.  All this without hopping back and forth between Design Studio SDK and Design Studio itself.

 

If there is some interest, I can supply the source files to this addon, however it appears that I will have to find somewhere on SCN that accepts a .ZIP file.  Perhaps creating an SCN Document will allow for this.

 

At the end of the day, this frees me up to focus on the end-form of a potential addon, as well as rapidly create anything I can create in HTML5/CSS/JS within Design Studio before implementing a full blown SDK Addon.

Create chart with completely manual values without SDK component

$
0
0

Hi community,


as you know you can do a lot of calculations in the scripting areas of design_studio. These calculated values can be presented in Text Field components very easily using the "setText" command.

But how to bring the manual calculated values into a chart? I guess it will be possible to create a SDK-Component for that, but not all are able to do the needed coding.

 

So let's assume the following scenario...

 

You calculate 3 values within your script and want to bring these in a chart like this:

result.jpg


In my example I'm able to define all elements (names of series, name of measure and the 3 values) of the chart / table on my own via scripting.

 

What are the steps behind?

 

1. Create a BEx Query

In the query you define 2 structures manually. In the structure in the rows area you create as many objects as you need for your chart as an empty selection object. The description field contains nothing more than a text variable (manual input). I named them label_1, label_2, label_3.

rows.jpg

The structure in the columns is filled with a dummy formula and the description is defined again as a text variable (manual input) which I named label_A.

 

With that you are able to define all visible texts with variables so we can concentrate on "filling in" the values.

 

As you have a query with 2 structures you are able to use the "cell" mode of the query.

cells.jpg

As you can see I added in each cell a formula which contains again nothing more than a formula variable with manual input called value_1, value_2, value_3.

 

2. Test your Query

You should see all the 4 label-variables and the 3 value-variables.

 

var-screen.jpg

 

3. Create your Application

I think you already know what is coming... :-)

  • Create a DataSource against the query you have created
  • Use the Application.SetVariable command to define the labels and values you want to show in your chart
  • Add a Chart and assign the DataSource to it

Use the Application.SetVariable command to fill in your labels and values.

 

*** Attention ***

There seem to be an error in the actual DesignStudio 1.2 SP 0 version. The variables appear in the variable screen but are not available in the script. I informed Development Team already, hopefully it will work in 1.2 SP1. Haven't had the chance to test in other (older) versions so might work there. So keep this as a theoretical approach right now :-)

 

Dirk


DS 1.2 SDK - Use both sides - Double Sided Tiles

$
0
0

Like they said in school.  Use both sides of your paper!  Below is an extension of my HTML Templating example, with some CSS3 flipping goodness.  Inspired by the SCN Reputation Missions tiles that you can flip.  Source can be found at the github repo below.

 

SDK Source:

entmike/com.ipaper.sample.doublesidedtile · GitHub

 

External sources/acknowledgments:

 

As I mentioned, I liked the interactive flipping tiles of SCN's missions, and figured something similar might serve as a contextual drilldown or an in-place tooltip on steroids use.  Imagine wanting to show a KPI title with sales and maybe some other high-level information, but also wanting to pack in some additional information on mouseover.  The Design Studio project is also included in my Github repository mentioned above.

 

Below is a design-time snapshot, and a runtime animated example.

 

Happy Holidays!

 

use both sides.png

 

At runtime (click image below if not animating in blog post):

 

bothsides3.gif

Design Studio dashboard application based on a Universe as a data source - Part 1

$
0
0

Very kindly one of Santa's little helpers gave me a copy of "Mastering SAP Design Studio" by Ingo Hilgefort just before Christmas which encouraged me to use a few of the quiet days over the Christmas break to get started with Design Studio and specifically the Universe connectivity.

 

My personal SAP background is that of someone who has come from the Business Objects perspective specifically focusing on the front end user applications.  I don't consider myself deeply technical and most definitely leave Production BI4 server installs and configuration to my Technical Architecture team and my level of SQL knowledge is let’s say 2 out of 5. So I thought maybe I personally could be a test case to see where I could recommend design studio fitting into Itelligence UK customers BI Strategies and what technical level of developer is needed to create applications.

 

Starting Simple:

Open up the client install of SAP Design Studio, and connect to a BI4.x landscape

 

1.jpg

 

 

Create a new blank application

 

2.jpg

 

Next add a new Data Source and select your objects.

It’s great to see a fully featured query panel here unlike the cut down version in SAP Dashboards (Xcelsius)

 

3.jpg

 

After clicking OK, as O have a prompt on YEAR the following popups will appear.

 

4.jpg

 

5.jpg

 

Don’t worry here as I did the first time, the OK button stays greyed out even after selecting a prompt value, you need to click BACK on the top left before the OK becomes available.

 

6.jpg

 

Let the “Drag and Drop” layout design begin

 

After dropping the CROSSTAB component on the canvas is appears only to show the Measures you have selected in the Query Panel.  You need to right click on the data source and edit the initial view an add in the columns you want visible.

 

7.jpg

 

8.jpg

 

Now to add a chart

 

9.jpg

 

Initially this chart doesn't look great as what I really want is just Country, Resort and Revenue.  Easy you’d think?

 

Firstly select the chart component and in the properties pane on the left find the DATA SELECTION field under DATA BINDING.

 

You will now go through the workflow of selecting multiple rows or columns from the result set. But, as I have a prompt in my query I get prompted again for the value, which forces a query refresh.  Not too troublesome in this example but what if the query takes many minutes to refresh?

 

10.jpg

 

 

I personally find this window not yet optimised for a UNX data source, I just can’t get it to select the 3 columns I want. All you can do is select individual rows, maybe I'm missing something, any suggestions ?

 

The only way I got my desired results was to add a second data source, select the 3 columns I need and bind the chart component to this new data source with a reduced number of columns. I then set the data series to my companies corporate colour scheme in the additional Properties pane, some nice formatting options in there.

 

11.jpg

 

The next logical thing was to want to build a component to activate the prompt and select a different year.  This is where I had to do some trial and error development.  More errors then success I'm afraid ! 

 

I tried a few different ways and I still don’t have really what I want yet, but this give me an excuse to write a follow on blog.

 

Attempt 1

 

If you just execute the Design Studio application locally using the toolbar button you are prompted for the prompt value.  Nice and easy, but I don’t want to have to exit and re-enter the application just to change them prompts.

 

Attempt 2

 

So the next easiest way I found was to drag onto the canvas the Filter Panel.  A great multifunctional component which I’d love to see in SAP Dashboards (Xcelsius). This filter component allows the end user during run time the ability to apply many different selection criteria. Sadly the Filter Panel appears to bind to only one Data Source so in my scenario the crosstab table will have the data restricted based on the users selection but alas not the chart.

 

12.jpg

 

13.jpg

 

Additionally when I try to change my selection on YEAR which is my prompted object the List of Values is empty.  There must be a good reason for this in the application but alas this solution doesn’t give me what I want.

 

14.jpg

 

Attempt 3

 

I think this is where I will have to seek a solution using different components and Java code.  This I will have to research further and share my findings in a second part to this blog.

 

If any of my steps are incorrect or I have missed something in the workflow please comment below so we can all learn from shared best practice.

 

Some Ideas for quick wins:

 

  • Until there is parity of functionality in the use of components between BEx and a Universe as a data source could SAP clearly identify the data source in all learning materials to stop you trying to something new only to realise yourself it will not work with your particular data-source, a Universe  for example.

 

  • Some example Design Studio applications over eFashion or Island Resorts would be great to show the art of the possible inside working examples

 

My personal conclusions so far:

 

  • Design Studio is the first reporting tool I have used since Crystal Reports where I have needed to read a manual not just for the harder bits but even to get started with the tool, I think maybe there is a similarity in the user persona in both of them. I would go so far as to suggest that authoring content in both Design Studio and Crystal Reports should be delivered by traditional BI technical developer sitting within a BI team or BICC and any Design Studio Applications are build as part of a structured project delivery.  I don’t see Design Studio application authoring being widely adopted by the mythical “Self Service End User”

 

  • It still feels you would get the most out of Design Studio if you are using SAP BW and particularly BEx Queries or SAP BusinessObjects Analysis edition for Microsoft Office as a data source at this time.   I hoping this will change in the futire in line with the Dashboard Statement Of Direction

DS 1.2 SDK - Building a SAPUI5 Toolbar

$
0
0

While you can use the BI Action Language (BIAL) in Design Studio to simulate a toolbar, and even play with toggling of states and repositioning hidden buttons, it is a lot of overhead and math to do things like compute margins, etc.  Also, I prefer to have all my click events in one place and not buried in many different buttons.  (Some may prefer the other way, admittedly.)  I wanted to see if I could implement the SAPUI5 Toolbar component with any success.  My main goals were to have a horizontally arranged stack of buttons with the ability to programmatically (as well as one can today using the DS script window) set some properties for the buttons such as enabled, visible, icon, text, and tooltip.  These properties can mostly be done using the script window with the standard buttons, however it's painful when you must reposition them or dynamically switch visibility to simulate toggle buttons, etc.  In a later post, I'll probably implement a true toggle button, but maybe someone may find this toolbar interesting.

 

Source: entmike/com.ipaper.sample.menu · GitHub

 

Example Script Window for the OnClick event using Toolbar:

 

tb1.png

Example interactivity at runtime (Click Image for Animated GIF).

 

tb_anim.gif

 

Happy New Year.

How to enable hierachical display of rows/columns in Initial View

$
0
0

Hi all,

 

i'm using DesignStudio since version 1.0 but it took me until today to find out that it is possible to enable the hierarchical display of the elements in the Initial View editor. Sometimes it needs a wrong click to find out something new :-)

 

If you want to activate the "Compact display in Rows" or "Compact display in Columns" feature you need to click to the headline of the field "rows" or "columns" to be able to activate the setting.

 

display.png

 

After you have activate it you can choose how deep the hierarchy should be expanded.

display2.png

 

 

And as all my colleagues in the room did not know either I decided to blog it to you, but might be that I'm the only one who did not know before .

 

Dirk

Design Studio 1.2 SDK - Enhancing the 'Simple Table' SDK Component

$
0
0

I recently saw a question in the SAP BusinessObjects Design Studio space asking how to make a selectable version of the Simple Table example provided with the Design Studio SDK.  Below was my approach that others may find useful.

 

I began by simply copying the 'com.sap.sample.simpletable' project to a new one called 'com.sample.sapui5table'.  I then renamed all the references to the old component in the MANIFEST.MF, component.xml, component.ztl and component.js files.

 

Next, I decided instead of using HTML string fragments and JQuery syntax, that I would use the SAPUI5 table component so that I could utilize the row selection API and JSONModel to build in the data.  Below is the new component.js code

 

sap.designstudio.sdk.Component.subclass("com.sample.sapui5table.SAPUI5Table", function() {  var that = this;  var column1_data = null;  var column2_data = null;  var column3_data = null;  var meta_data = null;  var myUI5Table = null;  var myModel = null;  var concatenatedDimension = "";    // Simple getter/setter    this.rowClicked = function(value){    if(value===undefined) {    // Getter    return concatenatedDimension;    }else{    // Setter (fluent interface)    return this;    }    };     this.rowChanged = function(evt){  concatenatedDimension = "";  var rowContext = evt.getParameters().rowContext;  if(rowContext){  concatenatedDimension = myModel.getProperty(rowContext+"/headingColumn");  }else{  concatenatedDimension = "";  }  that.firePropertiesChanged(["rowClicked"]); // SDK proxies these properties, must inform of change  that.fireEvent("onclick");  };  this.init = function() {  myUI5Table = new sap.ui.table.Table({  selectionMode: sap.ui.table.SelectionMode.Single,  rowSelectionChange : this.rowChanged  });  this.$().css("overflow-y", "scroll");  myUI5Table.placeAt(this.$()); // Until SAP gives us an official way...  };  this.afterUpdate = function() {  try{  var tabularData = [];  if(column1_data){  for (var i = 0; i < column1_data.data.length; i++) {  var newRow = {};  var tuple = column1_data.tuples[i];  var rowHeaderText = "";  for (var j = 0; j < tuple.length; j++) {  if (column1_data.selection[j] == -1) {  rowHeaderText += " " + meta_data.dimensions[j].members[tuple[j]].text;  }  }  rowHeaderText = rowHeaderText.replace("|", " "); // Delimiter used for multiple presentations  newRow.headingColumn = rowHeaderText;  newRow.col1 = formatValue(column1_data.data[i], column1_data.tuples[i]);  if(column2_data) newRow.col2 = formatValue(column2_data.data[i], column2_data.tuples[i]);  if(column3_data) newRow.col3 = formatValue(column3_data.data[i], column3_data.tuples[i]);  tabularData.push(newRow);  }  }  myUI5Table.removeAllColumns();  if(column1_data){  var columnHeaderText = "";  for (var i = 0; i < column1_data.selection.length; i++) {  var selectionIndex = column1_data.selection[i];  if (selectionIndex != -1) columnHeaderText += " " + meta_data.dimensions[i].members[selectionIndex].text;  }  myUI5Table.addColumn(new sap.ui.table.Column({  label: new sap.ui.commons.Label({text : "Concatenated Dimension"}),  template: new sap.ui.commons.TextView().bindProperty("text", "headingColumn"),  sortProperty: "headingColumn",  filterProperty: "headingColumn"  }));  myUI5Table.addColumn(new sap.ui.table.Column({  label: new sap.ui.commons.Label({text : columnHeaderText}),  template: new sap.ui.commons.TextView().bindProperty("text", "col1"),  sortProperty: "col1",  filterProperty: "col1"  }));  if(column2_data){  var columnHeaderText = "";  for (var i = 0; i < column2_data.selection.length; i++) {  var selectionIndex = column2_data.selection[i];  if (selectionIndex != -1) columnHeaderText += " " + meta_data.dimensions[i].members[selectionIndex].text;  }  myUI5Table.addColumn(new sap.ui.table.Column({  label: new sap.ui.commons.Label({text : columnHeaderText}),  template: new sap.ui.commons.TextView().bindProperty("text", "col2"),  sortProperty: "col2",  filterProperty: "col2"  }));  }  if(column3_data){  var columnHeaderText = "";  for (var i = 0; i < column3_data.selection.length; i++) {  var selectionIndex = column3_data.selection[i];  if (selectionIndex != -1) columnHeaderText += " " + meta_data.dimensions[i].members[selectionIndex].text;  }  myUI5Table.addColumn(new sap.ui.table.Column({  label: new sap.ui.commons.Label({text : columnHeaderText}),  template: new sap.ui.commons.TextView().bindProperty("text", "col3"),  sortProperty: "col3",  filterProperty: "col3"  }));  }  myModel = new sap.ui.model.json.JSONModel();  myModel.setData({modelData: tabularData});  myUI5Table.setModel(myModel);  myUI5Table.bindRows("/modelData");  myUI5Table.setVisibleRowCount(column1_data.data.length);  };  }catch(e){  alert(e);  }  };  function formatValue(value, tuple) {  if (value === null) {  return "";  }  if (meta_data) {  for (var i = 0; i < meta_data.dimensions.length; i++) {  var strFormat = meta_data.dimensions[i].members[tuple[i]].formatString;  if (strFormat) {  // use CVOM library to format cell value  sap.common.globalization.NumericFormatManager.setPVL(meta_data.locale);  return sap.common.globalization.NumericFormatManager.format(value, strFormat);  }  }  }  return value;  }  // called from Additional Properties Sheet JavaScript file  this.getMetadataAsString = function() {  return JSON.stringify(this.metadata());  };  // property setter/getter functions  this.column1 = function(value) {  if (value === undefined) {  return column1_data;  } else {  column1_data = value;  return this;  }  };  this.column2 = function(value) {  if (value === undefined) {  return column2_data;  } else {  column2_data = value;  return this;  }  };  this.column3 = function(value) {  if (value === undefined) {  return column3_data;  } else {  column3_data = value;  return this;  }  };  this.metadata = function(value) {  if (value === undefined) {  return meta_data;  } else {  meta_data = value;  return this;  }  };
});

Next, I updated the component.xml file to hold the new properties of onclick and rowSelected:

 

<?xml version="1.0" encoding="UTF-8"?><sdkExtension xmlns="http://www.sap.com/bi/zen/sdk"  title="SAP UI5 Table"  version="1.0"  vendor="SAP"  id="com.sample.sapui5table">  <component id="SAPUI5Table"  title="SAP UI5 Table"  icon="res/icon.png"  handlerType="div"  propertySheetPath="res/additional_properties_sheet/additional_properties_sheet.html"  databound="true">  <stdInclude kind="cvom" />  <jsInclude>res/js/component.js</jsInclude>  <property id="column1" type="ResultCellList" title="Column 1" group="DataBinding"/>  <property id="column2" type="ResultCellList" title="Column 2" group="DataBinding"/>  <property id="column3" type="ResultCellList" title="Column 3" group="DataBinding"/>  <property type="ScriptText" title="On Row Click" id="onclick" group="Events"></property>  <property type="String" title="Row Clicked" id="rowClicked" visible="false"></property>  <initialization>  <defaultValue property="WIDTH">100</defaultValue>  <defaultValue property="HEIGHT">100</defaultValue>  </initialization>  </component></sdkExtension>

Finally, I updated the component.ztl with so that we can access the concatenated dimension in BIAL:

 

class com.sample.sapui5table.SAPUI5Table extends Component {  /**  Use to get Concatenated Dimension of row clicked  */  String getRowClicked() {*  return this.rowClicked;  *}
}

So, now bringing the component into DS, we can see that after binding some data and picking some columns (Column 1 being required, just like SAP's sample), we can see data:

 

ui5table1.png

You also so a 'On Row Click' even that you can write some BIAL script in.  Below is an example that will populate a Text label with the dimension value:

 

ui5table2.png

During runtime, we can see this in action:

 

ui5table3.png

As an added bonus, we can see some other native SAPUI5 Table functionality that you can leverage (rudimentary filtering and sorting):

 

ui5table4.png

As you can see, since DS SDK uses SAPUI5 under the hood, why not go ahead and leverage it instead of manually creating HTML tables by hand?

 

Resources:

 

SAPUI5 SDK - Demo Kit

SAPUI5 SDK - Table API Reference

 

Considerations:

 

DS 1.2 uses SAPUI5 1.12.7, so you'll want to find a copy of the API docs on SAP SWDC since the online API docs are a higher version, but most of the API works as a starting point of reference.

 

SAP has stated that they will offer a more "official" way to use and extend SAPUI5 components, but for now, this seems to work while we patiently wait.

 

Hope this helps!

Viewing all 662 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>