The “BSP tag” I mentioned in the blog title means for example the tag chtmlb:configCellerator below which is pre-delivered by SAP and you could include it in your UI component view to draw various UI element.

/wp-content/uploads/2014/04/clipboard1_439771.png

In this blog I will share with you a real issue I meet with when I am using configCellerator and how I find the root cause. So sometimes if you find the behavior of BSP tag is not working as you expected, if time allowed, you can spend sometime to investigate by yourself. Such investigation will make you understand how native html is rendered based on those BSP tag more thoroughly.

Issue1 – Missing table toolbar

Although the entry for table toolbar is found in debugger,

/wp-content/uploads/2014/04/clipboard2_439826.png

However in the UI the table toolbar is missing.

/wp-content/uploads/2014/04/clipboard3_439827.png

I guess the issue might be related to attribute “editMode” set in line 12. I try to find documentation on this attribute in SE80 but unfortunately there is not.

/wp-content/uploads/2014/04/clipboard4_439832.png

Then double click on line 6 ( the first sceenshot in this blog) “configCellerator”, in the new screen click tab “Attribute”, now I get to know the possible value for editMode is NONE, SINGLE and ALL. However still I don’t know the clear meaning of these three values.

/wp-content/uploads/2014/04/clipboard5_439833.png

So below is how I investigate on the usage of attribute “editMode”:

1. Do observation on the callstack of UI rendering and I find framework is using CL_THTMLB_CELLERATOR to render the table defined via configCellerator.

/wp-content/uploads/2014/04/clipboard6_439834.png

2. run report RS_ABAP_SOURCE_SCAN,  search key word EDITMODE against class CL_THTMLB_CELLERATOR found in step1.

Navigate to the source code of the third hit:

/wp-content/uploads/2014/04/clipboard7_439838.png

it means if the editmode is set as NONE, the member attribute NOHEADER of class CL_THTMLB_CELLERATOR is set as TRUE.

/wp-content/uploads/2014/04/clipboard8_439840.png

2.1 rerun report RS_ABAP_SOURCE_SCAN but this time search keyword NOHEADER instead ( or you can also use where used list on member attribute NOHEADER in SE24 ). The hit shows that the string “TRUE”( or “FALSE”) stored in member attribute NOHEADER is converted to abap boolean and stored in variable gv_no_header.


/wp-content/uploads/2014/04/clipboard9_439844.png

2.2 repeat the step 2 and 2.1, search keyword gv_no_header. The third hit demonstrates the table toolbar could only be rendered if gv_no_header is abap_false ( and other condition between line 10 and 14 are fulfilled ). The html source is the final native html code rendered by UI framework.


/wp-content/uploads/2014/04/clipboard10_439845.png

After I remove the editMode attribute and I could see the expected table toolbar.

/wp-content/uploads/2014/04/clipboard11_439846.png

I view the source code of my table view and I could find the hard coded html code in the line 17 of screenshot above. And the html code for toolbar title is just very next to it. So this issue is just resolved without debugging, but just pure source code analysis in the design time.


/wp-content/uploads/2014/04/clipboard12_439848.png

Issue2 – Do not expect the table cell editable

In my project I need to switch the BOL entity to change mode, however I do not want to make each table cell be editable, instead user will edit the locked object in another UI and see result after edit in the table view. In the table view I expect each cell is read only.

/wp-content/uploads/2014/04/clipboard13_439849.png

My BOL model has 40 attributes and I would not like to code “rv_disabled = TRUE” 40 times in each GET_I_<XXXX> method.

I plan to investigate the attribute usage = “ASSIGNMENTBLOCK”

Here below is my analysis process:

1. run report RS_ABAP_SOURCE_SCAN, search keyword ASSIGNMENTBLOCK, class CL_THTMLB_CELLERATOR – no result

2. double click tag configCellerator, then find the element handler class name:

/wp-content/uploads/2014/04/clipboard14_439856.png

then run report again and change the search class to CL_CHTMLB_CONFIG_CELLERATOR.

only one result which points to the commented out code. Just ignore it.

/wp-content/uploads/2014/04/clipboard15_439857.png

3. find all possible value for usage attribute here, and run report again with search keyword = “SEARCHRESULT”:

Only one result hit:

/wp-content/uploads/2014/04/clipboard16_439858.png

and the code indicates that the usage attribute “SEARCHRESULT” will set the whole table to read only mode.

/wp-content/uploads/2014/04/clipboard17_439859.png

After I change the attribute and test the table cells are rendered as read only as I expect.

Summary

In some case it might be possible that you can not get quite promising result by the first RS_ABAP_SOURCE_SCAN execution.

The tip is how to specify search keyword and search class ( or package, report etc ) cleverly so that the search result are relevant and helpful for your further investigation. Ususally it would take several iterations before you reach your target, as are shown in my two examples in this blog.

My common experience to specify search selection for report RS_ABAP_SOURCE_SCAN is:

1. Try to find the very class ( or report, function group etc ) which is relevant. If it is difficult to identify the exact one, use * for example “CL_CHTMLB*”.

2. Find the package name of the class( or report, function group etc ), and run report against the package instead.

/wp-content/uploads/2014/04/clipboard18_439860.png

Reference

there is a useful blog written by Andrei Vishnevsky about creating a new BSP tag and its corresponding element handler class. By reading it you will get a deeper understanding how the element handler class takes part in the UI render process.

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply