Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

highlighting entire row

We have a report showing CUSTOMER and EMPLOYER on X axis and SATISFACTION LEVEL , SUPPORT LEVEL on Y axis.

Now what we want is if the SATISFACTION LEVEL or SUPPORT LEVEL goes below 6 , we want the whole ROW highlighted with a colour , not that single cell . So, is there any way to achive this .

Regads,

Abraham

replied

Abraham,

This can be acheived by custom Javascript enhancement in the Web template.

First create a web template for this query. Once you have that, between <head> .... </head> area, insert the following code. This code highlights all the keyfiures but not the characteristics. Hope this does the job...

<script type="text/javascript">

var table_name = "GR1Table";//make sure this is the name of your table web item

function analyzeTable(){

var tbl = getTableReference( table_name );

var rows = tbl.getElementsByTagName("tr");

for( var i=0;i<rows.length;i++ ){

if( rows<i>.innerHTML.indexOf("SAPBEXexcBad9") > -1 )

hiliteCells( rows<i>, "SAPBEXexcBad9" )

}//end for

}//end function

function hiliteCells( tr,className ){

var cols = tr.getElementsByTagName("td");

for( var i=0;i<cols.length;i++ )

cols<i>.className.indexOf("Data")>0?cols<i>.className=className:"" ;

}//end function

function getTableReference( table_name ){

var all_tables = document.getElementsByTagName("table");

for( var i=0;i<all_tables.length;i++ ){

if( all_tables<i>.name == table_name ) //we have found tbl

return all_tables<i>;

}//end for

return null;

}//end function

window.attachEvent("onload", analyzeTable );

</script>

<b>NOTE:</b> SAPBEXexcBad9 is for exception level BAD9, similarly for the other codes, whatever you use...

Good Luck

Gova

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question