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

customizing a specific row in a table ( making bold and add colour )

Hi,

I want to change some particular row based on some condition by making it bold and adding color to them..

how can this be done?

Thanks

Akash

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 11:48 AM

    Hi Akashdeep,

    Follow this link....

    to-have-one-field-as-standard-and-others-as-emphas

    Surely ur problem will be solved....

    Regards,

    Rohit

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 03, 2008 at 12:57 PM

    Hi Akashdeep,

    If you are working for table,so defaultly all the columns are text views,so text views has the property design and semantic color to change the style and color of the text view.To do this

    Create 2 attributes one is for design of type WDUI_TEXT_VIEW_DESIGN and color of type WDUI_TEXTVIEW_SEM_COL in addition to your context node attributes.

    Then write the below logic in the method WDDOMODIFYVIEW.

    method WDDOMODIFYVIEW .
    here i populated design and color attributes conditionally.
    DATA:lo_nd_hcm TYPE REF TO if_wd_context_node,
            lo_el_hcm TYPE REF TO if_wd_context_element,
            ls_hcm TYPE wd_this->element_hcm,
            it_hcm type table of wd_this->element_hcm,
            it_final type table of wd_this->element_hcm,
            ls_final type wd_this->element_hcm,
            l_var type abap_bool,
            lr_table type ref to cl_wd_table,
            lr_column1 type ref to cl_wd_table_column,
            lr_column2 type ref to cl_wd_table_column.
    
    *  navigate from <CONTEXT> to <HCM> via lead selection
       lo_nd_hcm = wd_context->get_child_node( 'HCM' ).
    
      select * up to 20 rows from pa0001 into corresponding fields of table it_hcm .
      loop at it_hcm into ls_hcm.
      move-corresponding ls_hcm to ls_final.
      if l_var = abap_true.
       ls_final-design = CL_WD_TEXT_VIEW=>E_DESIGN-HEADER1.
       ls_final-color = CL_WD_TEXT_VIEW=>E_SEMANTIC_COLOR-POSITIVE.
       l_var = abap_false.
      else.
       ls_final-design = ''.
       ls_final-color = ''.
       l_var = abap_true.
      endif.
      append ls_final to it_final.
      endloop.
    
      LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).
    
    
      lr_table ?= VIEW->GET_ELEMENT( 'TABLE1' ).
      CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_DESIGN'
    *      INDEX      =
        RECEIVING
          THE_COLUMN = lr_column1.
    
    
     CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
    *      INDEX      =
        RECEIVING
          THE_COLUMN = lr_column2.
    
    endmethod.

    Now bind the 2 two attributes to the all the columns text views.

    For ALV check my Article

    Conditionally Assigning Colors and Input Enable to ALV Columns in Web Dynpro ABAP

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 03, 2008 at 11:29 AM

    Hi Akashdeep,

    Please check the following link

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393

    Regards,

    Lakshman.

    Edited by: Lakshman N on Nov 3, 2008 12:29 PM

    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.