Skip to Content

The Comments Technical Component allows users to create and view comments in Lumira documents/applications. Comments can be shared across all applications within a Lumira document. Note that comments are supported on SAP Lumira Documents Mode (.lumx file) and Legacy Mode (.biapp file within a .zip file) but not on Lumira Discovery.

To avail of this functionality, you must add the Comments technical component to the Outline view of the design tool. When the Comments technical component is added to the design tool, the scripting methods associated with the comments functionality will be available in the script editor.

There is a very helpful template available by default in SAP Lumira Designer which contains a very comprehensive comments dialog. Just create a new document in SAP Lumira Documents Mode and select Samples – Feature Samples.

There we can see SAMPLE_APPLICATION_COMPOSITE_COMMENTS_DIALOG together with the COMMENTS_DIALOG composite.

Comments Context Types

Comments can be created with an associated context (CommentContextType):

  1. NONE. The comment has no context. This is default when creating a comment with no context specified. This value is useful if you want to get all the comments without a specific context type.
  2. CONTEXT. This allows the user to specify a custom context to which the comment can be associated. The context can be anything, it’s like an ad-hoc type.
    A very common use of this context type is to apply it in the current filters of a data source.
  3. DATA. Comment applies to a data cell. This is default when creating a comment with a context. The comment icon will be visible depending on the navigation state.
  4. DIMENSION. Comment applies to a dimension. The comment icon will be visible as far as the dimension is visible.
  5. MEMBER. Comment applies to a member. The comment icon will be visible as far as the member is visible.

DATA, DIMENSION and MEMBER comments are the only ones which can be seen in a crosstab. In order for a comment to be visible in a crosstab datacell the navigation state is important. This is better explained in the section ‘Create Comments on a Crosstab’.

Also note that in an SAP Document, the lumx file may contain comments from all the composites. Composites don’t have self-contained comments, they’re all part of the same lumx document.

A composite in one lumx document can be used across many applications in other lumx documents. So a composite can be used in applications from different lumx documents but the “owner” of the comment is the document where the application is in.

Create Comments

Create a basic comment for the dashboard:

var commentId = COMMENTS.create("See my comment here");

Create a comment with the application name as context for the application:

COMMENTS.create(“See my comment here”),
       {
             "contextType": CommentContextType.CONTEXT, 
             "context": "{appname: " + APPLICATION.getInfo().name + "}"
       }
);

Application comment with other properties:

var commentId = COMMENTS.create("See my comment here and properties", {
    "context": {"sales":"2017"},
    "contextType": CommentContextType.CONTEXT,
    "isPublic": true,
    "dataSource": DS_1
});

We can even add a context menu in order to create comments on the data cell of a crosstab:

When creating a new comment the output of the API method is the comment’s ID. If we want to extract the comment’s properties we can get the comment as a whole object by doing the following:

Comments created on Local Mode will be stored in the Commentary Technical Component folder of Lumira within the configuration folder:

C:\Users\YOURUSER\LumiraDesigner-workspace\com.sap.ip.bi.zen\repository\__TECHNICAL_CONTENT\COMMENTARY

Comments created on BIP will be stored directly on the database.

See that we can see the properties of the commentary BIP application on CMC (Central Management Console):
Applications – BI Commentary Application – Properties

If we change the database we point to, a series of services need to be restarted for the changes to apply (APS, ConnectionServers, LumiraServer). If the restarting is not performed, we might get an Analysis Application error when launching our Lumira report with the Comments component.

We should also be able to see the Commentary Service in the APS when selecting Edit Common Services.

Create Comments on a Crosstab

This is the most common use case for comments in Lumira: creating comments on a crosstab (datacell, dimension or member).

When creating comments on a crosstab we need to remember that dimension and member comments should stay visible as far as those dimensions and members are visible in the crosstab.

Bear in mind that background filters are only important when saving comments on data cells so the comment will show or not depending on the navigation state.

This means that if we create a comment on a datacell and then we apply a background filter through the Filter Members option, the previous comment won’t be shown on the cell since it’s considered as a different context. If we remove the filter, then the comment will show again.

Here we can see the scripting used to create DATA, DIMENSION or MEMBER comments on a crosstab, taking into account the background filters:

var selType = CONTEXT_MENU.getSelectionType() + "";  
// This will assign the type of context we selected: DATA, DIMENSION or MEMBER and convert it into a string
var sel = CONTEXT_MENU.getSelection();
if (selType == "DATA") 
{	//add in the background filters
	sel = DS_1.getBackgroundFilters(sel);	
}
COMMENTS.create(selType + “Text of the comment”),
	{
		"context": sel,
		"contextType": selType
	}
);

Sometimes the datasource might have a background filter applied that we are not aware of. For this reason, it’s recommended to add the background filters every time we save a comment on a datacell. If not, our comment might be saved but not appear on the crosstab, which would result in confusion.

Update Comments

We can update an existing comment by using the API method setContent and providing its comment ID.

See an example here:

var commentId = COMMENTS_FEEDLIST_1.getSelectedItem().id;
COMMENTS.setContent(commentId,"Comment updated");

Show Comments

The most common method to display comments is through the Feed List component:

var FEEDLIST_1.setItems(COMMENTS.getComments());

If we want to show the content of a selected item on the feedlist:

var commentId = COMMENTS_FEEDLIST_1.getSelectedItem().id;
var commentObject = COMMENTS.getComment(commentId);

For a filtered list of comments:

var comments = COMMENTS.getComments
({
“context”: g_Context,
“contextType”: g_ContextType,
“dataSource”: DS_1,
“isPublic”: true,
“sortBy: CommentSortBy, CREATED_ON,
“order”: SortOrder.DESCENDING
});

Or if we want some more specific content and handling, see the following:

var comments = COMMENTS.getComments();
FEEDLIST_1.removeAllItems();

comments.forEach(function(element, index) 
{
  FEEDLIST_1.addItem({
  "author": element.author,
  "icon": element.icon,
  "authorId": element.authorId,
  "id": element.id,
  "info": element.info,
  "lastModifiedTime": element.lastModifiedTime,
  "text": element.text
});

Crosstabs can display a red arrow icon if a comment is available for a data cell, a member or a dimension. You can enable the comment display within the crosstab via property ‘Comments Visible = true’.

On top of that, comments can be included in the output of the Export PDF if we select ‘Comments Visible = true’ in the PDF Technical Component.

New from Lumira 2.3!
Context properties ‘context and context type’ are exposed now

2 new properties on the comment object can be retrieved now:

  • context
  • context type

This will allow the end user to create comments with different contexts and then filter them so they can be rendered separately by context.

Saving a comment with a user defined context:

var commentId = COMMENTS.create(INPUTFIELD_1.getValue(), {
    "context": {"sales":"2018", "country":"Ireland"},
    "contextType": CommentContextType.CONTEXT,
    "isPublic": true,
    "dataSource": DS_1
});

Retrieving comments with the user defined context:

var comments = COMMENTS.getComments();

comments.forEach(function(element, index) {
    var context = element.context;
    context.forEach(function(value, key) {
    if(value[0] == "Ireland") {
    FEEDLIST_IRELAND.addItem(comments[index]);
    } 
    });
});

Delete Comments

We can delete an existing comment by using the API method delete and providing its comment ID.

See an example here:

var commentId = COMMENTS_FEEDLIST_1.getSelectedItem().id;
COMMENTS.delete(commentId);

If we want to delete all the comments at once we can do:

var comments = COMMENTS.getComments();
comments.forEach(function(comment, index) 
{
  COMMENTS.delete(comment.id);
});

Public and Private Lumira Comments

All Lumira comments can be created as:

  • Public: everyone can view it. It may also be called Global.
  • Private: only the creator of the comment can view it. It may also be called Personal.
var publicCommentId = COMMENTS.create("Every Lumira user can see this comment", 
{
    "isPublic": true
});
var privateCommentId = COMMENTS.create("Only the user that creates the comment can see it", 
{
    "isPublic": false
});

This property is not linked to any rights on the platform since Public and Private comments are a ‘Lumira only’ concept.

If the Lumira user has the correct BIP rights, the user can add/edit/delete any comment on BIP via the BIP Commentary Service.

Don’t leave without knowing

The commenting feature on Lumira is available from Lumira 2.1 onwards.

Comments are not supported on BIP 4.1 or lower. This is also the case for comments on Webi, Analysis Office, etc.

Also note that on BIP 4.2 SP0 – 4.2 SP4 the performance when saving/retrieving/deleting comments on Lumira is very slow whereas when using BIP 4.2 SP5 or higher the performance is very similar to the one we can experience in Local Mode.
See SAP Note 2566001 – Creating or listing Lumira 2.1 Comments on the BI Platform is taking longer than expected.

To report this post you need to login first.

29 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member

    Hi Laura,

    great article – thanks!

    We’ve implemented a Designer Lumira application (with the comments functionality) and in local mode everything works as expected. But if we create comments within our BIP 4.2 SP3 we will get the following error message:

    MissingResource for class com.sap.ip.bi.zen.boe.commentary.CommentPlatformSupport, key: ZEN_COMMENT_MSG_NO_PLATFORM_SUPPORT, locale: de

     

     

    We are using our existing Audit database for commentary.

    Any ideas how to solve the problem?

     

    Best regards

    Sebastian

     

    (0) 
    1. Laura Piris
      Post author

      Hi Sebastian,

      Thanks for your comment. Let’s follow up with a ticket instead since it might need some investigation. Once the query is resolved I can post the solution here.

      Regards,
      Laura

      (0) 
    2. Former Member

      Hi Sebastian,

      did you find an explanation for the above error message? We are facing the same issues, however it does not seem to be consistent. We actually managed to save and read comments to the audit DB, but at some point the functionality stopped working properly and we recieved the same error message. We are on Lumira 2.1 SP00 and SBOP 4.2 SP5.

      BR., Anders

      (0) 
      1. Stefan Backhaus

        Hi!

        Could you solve the problem? We are having it too and can only use the commentary with Administrator users.

        Many thanks for your help!

        Stefan

        (0) 
    3. Stefan Backhaus

      Hi!

      Could you solve the problem? We are having it too and can only use the commentary with Administrator users.

      Many thanks for your help!

      Stefan

       

      (0) 
  2. Bryn Evans

     

    Hi Laura,

    Great Blog! We want to actually display the comments in the crosstab in its own column so users can see them without any additional clicks. Is this possible?

    Thanks

    Bryn

    (0) 
    1. Laura Piris
      Post author

       

      Hi Bryn,

      Thanks for the feedback. I am not fully sure what you mean by ‘displaying the comments in its own column’. Could you elaborate?

      Comments in a crosstab are associated to a particular cell so that’s why we need to select the cell in order to display its comments, usually via a feedlist component.

      An option that wouldn’t require any clicks is to display all the comments of the application, which is already possible. And then you can filter that list by context type DATA in order to get only comments from crosstab datacells. Now if you have more than one crosstab it will display them all together on the feedlist.

      I hope this solves your query.

      Regards,
      Laura

      (0) 
      1. Michael Tocik

        Hi Laura,

         

        Thank you for taking the time to post this i have found it very useful.

        What I think Bryn means is have the comments displayed as a column in the crosstab like this;

        We have the same requirement.

         

         

        (0) 
    2. Michael Tocik

      Hi Bryn

       

      A possibly work around would be to use the .getDataSelections for the datasource then loop through the selection for the crosstab and add a textbox using COMPONENTS.createComponent functionality that store a comment for each value

      We have managed to get this to work for our case but it depends on your scenario

      My view is that you should be able to have a property that shows the comments as a column

       

       

      (1) 
  3. Patrick Zeiser

    Hi Laura Piris ,

    thanks for this very good introduction to the commentary feature.

    I added the feature samples and after that I inserted the “Comments Dialog” composite in a blank applicatin. But it shows me nothing (Screenshot 1). Warning messages: No metadata is available for … SAP COM etc. How can I fix this?

    After that I tried it with the “Comments Panel”. Run it in Local Mode, everything is fine and works. But in the BI Platform mode I got the error message: Error during the procedure of the script (Screenshot2).

    I didn’t make changes to the Comments Panel. Are there any settings on the CMC required or is there a possibility to get more information about the error. Currently the error is very thin.

    Best regards

    Patrick

    Screenshot1:

    Screenshot2:

     

    (0) 
  4. Christof Hoffmann

    Hi Laura

    Using The The New comments fct. we like to share comments btw. different Applications

    E.g. Comments will be added in an data process application and be showed in corresponding dashboard applications. Normally this applications will be in different documents. When comments only can be shared within the same document what is the way to go?

    Copy the documents with dB fct. Or is there a more elegant way to proceed?

    Thanks in advance

    Chris​

    (0) 
  5. Jan-Frederik Marx

    Hi Laura Piris

    thank you for this overview.

    You’ve mentioned show up-behavior of comments regarding visibility of their context (dimension/members and navigation). How are comments with context DATA treated when a data refresh is being executed and figures change? Will the comment still be shown as long as dimension values exist (e.g. Neighborhood, Age Group and Total Population with the according values) even though the data value changed from a negative to a positive one (and thus the comment would lead to confusion)?

    Thanks for your help!

    Best regards,

    Jan-Frederik

    (0) 
    1. Laura Piris
      Post author

      Hi Jan-Frederik,

      That is correct, comments are stored by dimensions and not by measures so they will still show after a data refresh. The comment is linked to the position/selection of data, not the value itself.

      Regards,
      Laura

      (0) 
  6. Ramesh Jothimani

    Hi Laura,

    Really awesome blog. thanks for the information.

    I have a doubt that while checking Audit DB we can see a table called [COMMENTARY_MASTER] which stores the comments that entered via report. Now could you help me to understand that how we can specify value to the fields in those tables. like OptionKey1, OptionKey2…..because I want to filter the value to be displayed to different reports based on the module like retail, finance and so…

     

    Thanks!

     

    Regards,
    Ramesh J

    (0) 
    1. Laura Piris
      Post author

      Hi Ramesh J,

      Good point on the COMMENTARY_MASTER DB table. Those table values (OptionKey1, OptionKey2, etc) are not exposed at the runtime level which means that the Comments API doesn’t have the capability of filtering or editing them.

      What you can actually do is filtering comments by your own defined modules (retail, finance, etc). You can create a context with these identifiers and use them when saving and retrieving comments.

      Regards,
      Laura

      (0) 
    1. Laura Piris
      Post author

      Hi Fahad,

      Thanks for that. Yes, it is available on Lumira Designer 2.1 and onwards. Please refer to the last section of the article “Don’t leave without knowing”.

      Regards,
      Laura

      (1) 
  7. Andrew Ming Zhou

    Hi Laura, I was able to implement the COMMENTS_PANEL composite with a crosstab. I can insert and view comments against data cells from the panel, however, the red indicator for cells with comments is not showing up right away. It only shows up when the crosstab is re-rendered (such navigating away from the pagebook and back). Currently, I’m using reloadDataSource() as a workaround to force a refresh after posting or deleting a comment. Any better suggestions would be welcome. Thanks in a advance!

    Also, please update the blog with commenting on chart with context. I tried getting context to work with a chart to no avail, because charts have no getSelection() function. I tried passing a JSON-like string with dimension:member combination to the comment but COMMENTS_PANEL is unable to retrieve the comment.

    By the way, we’re on BO 4.2 SP6, Lumira 2.1 SP1 P1.

    (0) 
    1. Laura Piris
      Post author

       

      Hi Andrew,

      Thanks a lot for your feedback and suggestions, appreciated.

      I haven’t been able to reproduce the behaviour you mention about creating comments on a crosstab within a panel since I can see the red indicator shows without refreshing the datasource. Could you please design a simple application where that happens and create a ticket with the application attached to it? That way we can investigate further.

      In the meantime, the workaround that you applied (refreshing the datasource) is correct.

      In regards to your query about comments on charts that is right, which is by design. The commenting functionality is mainly aimed to add comments at an application level or a crosstab level (DATA, DIMENSION, MEMBER). The part that says context can be anything means that many contexts can be created and referenced to when creating comments. In the first examples we have a context whose name is the application name and another context whose name is “sales”:”2017″. The ContextType in this case is CONTEXT.

      And then it is possible to create comments associated to a data cell with ContextType DATA, to a dimension with DIMENSION and to a member with MEMBER but not to a chart.

      Regards,
      Laura

      (0) 
  8. Abhinav Kothi Reddy

     

    Hi Laura,

    Thank you for the Blog. I Have implemented the commentary for the application as you have explained and it works as expected, But I have a requirement in addition to the current capability.

    Is it possible to highlight the icon used to open the comments panel if there are any new comments(May be along with number of new comments added).

    Is there a way to do this in real time like a live commentary.(If there are two users viewing the dashboard at the same time and one enters a comment and other person should be able to see a highlighted Icon with number of new comments.

    I have used the below Scrip to scrolltoBottom in the Feed List component but it does not work while loading initially.Is anything else iäm missing to scroll down to the latest comments.

    Regards,

    Abhinav

     

    (0) 
    1. Laura Piris
      Post author

      Hi Abhinav,

      Thanks for the input provided.

      Regarding your first query (highlighted icon, number of notifications, etc) they are all good points that can be considered as a new requirement, like you mentioned. Please feel free to raise a ticket in order to request this additional functionality. Tag it as Feature Request so it can reach our product manager and get evaluated for a future release.

      Regarding your second query (scrollToBottom on Startup) this could be a bug. Please raise a ticket as Incident attaching a simple dashboard where you can easily reproduce it so it can be investigated by the development team.

      Regards,
      Laura

      (0) 
      1. Abhinav Kothi Reddy

        Hi Laura,

         

        Thank you for the response.

         

        I was able to find a work around for the first query (highlighted icon, number of notifications, etc) and was also able to achieve a near real time Commentary as mentioned in my second point by utilizing the properties available with the COMMENTS technical Component.

        Still in the process of fine tuning it .

         

         

        Thank You ,

        Abhinav Kothi.

        (1) 

Leave a Reply