Skip to Content
author's profile photo Former Member
Former Member

Highlight the Table View Rows(entire row) with color based on some condition

Hi Friends,

I have one requirement, where I have to highlight the table view rows(entire row) with color in background based on some conditions.

I tried with table view iterator(IF_HTMLB_TABLEVIEW_ITERATOR), where I can highlight the cell with color in background. But I couldn't find to highlight the entire row.

Could anyone please help on this.

Regards,

Kumar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 05, 2013 at 08:00 AM

    Hi Friends,

    Could anyone please help me on this.

    Regards,

    Kumar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Andrei Vishnevsky

      Hi Andrei,

      I followed the below blog.

      http://scn.sap.com/thread/2128064

      In Table View Iterator class method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START :

      where I put some dummy conditions :

      method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.

      data : ls_order type CRMST_QUERY_R_SRVO_BTIL,

      wf_text type string,

      html_bee TYPE REF TO cl_bsp_bee_html,

      html_str type string.

      field-symbols: <row> type any, <col> type any.

      CASE P_ROW_INDEX.

      when 1 or 3.

      READ TABLE me->orders 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>.

      ENDIF.

      if p_row_index = 1.

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

      INTO html_str.

      else.

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

      INTO html_str.

      endif.

      p_replacement_bee = CL_HTMLB_LINK=>factory(

      id = p_cell_id

      text = html_str

      ONCLICK = lv_event ).

      ENDCASE.

      endmethod.

      ***where wf_text contains the current cell value

      ***lv_event contains the EVENT(for navigation, which needs to be filled dynamically)

      Thanks

      Kumar

  • author's profile photo Former Member
    Former Member
    Posted on Nov 07, 2013 at 02:22 PM

    Hi kumar,

    Are you doing in webdynpro? Please follow the below link , it may help you

    http://wiki.scn.sap.com/wiki/display/WDABAP/Colour+the+row+in+the+Table

    Regards,

    Pravin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 12:30 PM

    hi kumar,

    I have also same issue,

    plz check the thread.

    http://scn.sap.com/thread/3479317

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.