Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: How to set background color of cell to red

$
0
0

Hi Oliver,

 

Great to hear you once more, i guess now you know how to color cell text with the help of threadhttp://scn.sap.com/message/14295856 , for background cell color just prepare the HTML code as below,

 

 

CASE p_column_key.

 

 

          WHEN 'DESCRIPTION'. "// Field (or Colunm) name

                    READ TABLE me->gt_result INTO ls_order INDEX p_row_index.

                    IF sy-subrc NE 0.

                              EXIT."==============>>>

                    ENDIF.

 

                    ASSIGN COMPONENT p_column_key OF STRUCTURE ls_order TO <col>.

                    IF sy-subrc = 0.

                              wf_text = <col>."// Field value

                    ENDIF.

 

                    CASE wf_text. "// Field value

                    WHEN 'TESTING'. "// Field value

                    CONCATENATE '<span style="background-color:#00FF00">' wf_text '</span>'

                    INTO html_str.     "// Setting background color for particular column

                    CREATE OBJECT html_bee.

                    html_bee->add( html = html_str ).

                    p_replacement_bee = html_bee.

 

 

                    WHEN 'TEST'. "// Field value

                    CONCATENATE '<span style="background-color:YELLOW">' wf_text '</span>'

                    INTO html_str.    "// Setting background color for particular column

                    CREATE OBJECT html_bee.

                    html_bee->add( html = html_str ).

                    p_replacement_bee = html_bee.

 

 

                    WHEN 'TEST123'. "// Field value

                    CONCATENATE '<span style="background-color:RED">' wf_text '</span>'

                    INTO html_str.    "// Setting background color for particular column

                    CREATE OBJECT html_bee.

                    html_bee->add( html = html_str ).

                    p_replacement_bee = html_bee.

 

 

                    WHEN 'HI'. "// Field value

                    CONCATENATE '<span style="background-color:PINK">' wf_text '</span>'

                    INTO html_str.   "// Setting background color for particular column

                    CREATE OBJECT html_bee.

                    html_bee->add( html = html_str ).

                    p_replacement_bee = html_bee.

                    ENDCASE.

 

 

ENDCASE.

 

 

NOTE: The table GT_RESULT will contain the table view records.

           Be careful WHEN 'DESCRIPTION' always taking the search result’s field

           name and WF_TEXT = 'TESTING' is taking the search result’s field value (in my

           case).

 

Please feel free to query again

 

Column Bacgruond color.JPG

 

 

Regards,

Vishal.


Viewing all articles
Browse latest Browse all 7775

Trending Articles



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