How to colour specific rows within an WebDynpro ALV

Hi everyone,
I need to colour only specific rows of an ALV. I've already scoured sdn and implemented the solutions that I found but none of them seems to be working okay.
I have an ALV table and I want to highlight only a few rows based on a certain logic.
I've defined a context node that defines 2 attributes: textview_design and cell_design.
  LOOP AT ft_out_purchase_order_temp INTO ls_out_purchase_order_temp.
  if ....
    ls_out_purchase_order_temp-textview_design =  cl_wd_text_view=>e_design-standard.
    ls_out_purchase_order_temp-cell_design = cl_wd_table_column=>e_cell_design-standard.
  else.
      ls_out_purchase_order_temp-cell_design =  cl_wd_table_column=>e_cell_design-total.
      ls_out_purchase_order_temp-textview_design =  cl_wd_text_view=>e_design-emphasized.
  endif.
ENDLOOP.
  lr_column_settings ?= po_alv_config_table.
  lr_column = lr_column_settings->get_column( 'EBELN' ).
  lr_column = po_alv_config_table->if_salv_wd_column_settings~get_column( 'EBELN' ).
  lr_column->set_cell_design_fieldname( value = 'CELL_DESIGN' ).
This code works but the thing is that the whole column named 'EBELN' is coloured light green. This is strange because I've instructed the system that the design of the column EBELN is controlled by the field CELL_DESIGN and this field has the following values:
10    (light green)
33    (light blue)
10
10
10
33
10
33
Any ideas?

Hii,
   To color a particular row you need to follow two things.
1. Specify condition based on which the row will be colored i.e. set the value for the attribute 'CELL_DESIGN'.
2. Get all column references and  set the cell design field name with 'CELL_DESIGN'.
Get all column reference.
DATA : LT_COLUMNS TYPE SALV_WD_T_COLUMN_REF,
             LS_COLUMNS TYPE SALV_WD_S_COLUMN_REF.
  LT_COLUMNS = LR_COLUMN_SETTINGS->GET_COLUMNS( ).
configure column
  LR_COLUMN_SETTINGS ?= LV_VALUE.                              " column functions
  LT_COLUMNS = LR_COLUMN_SETTINGS->GET_COLUMNS( ).
set cell design for all.
In your case if a single column is getting colored the then the reason might be
1.every record satisfying your if condition specified.
2.you have set cell design in that particular field name.
Regards,
Monishankar C

Similar Messages

  • How to Empty all rows within a Power Pivot Model

    Hi,
    I would like to know how to empty all rows within a Power Pivot model. I am in the process of creating quite a complex Power Pivot model. This means I need to create some sort of primitive version control process, e.g. stored multiple backups of the Power
    Pivot model without the data.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Forget what I've said before:
    Have a look at Gil's thread here:
    https://social.technet.microsoft.com/Forums/en-US/40abe021-1abd-4a2a-bf33-a035847fb7be/disconnect-datamodel-from-source?forum=powerquery
    For Power Pivot it means that you can get rid of all your data, but Keep Relations, measures, ..everything.
    Just import your tables once in order to get the connections right and move on.
    Imke

  • How to make all the rows editable in webdynpro alv output

    Hi,
    How to make all the rows editable in webdynpro alv output.
    Thanks
    Rakshar

    Hi Rakshar,
    Check this wiki:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP
    Regards

  • How to select specific rows in rtf template for complex calculation

    Hi,
    I want custom calculation in my rtf template and for this i need to select specific cell's value OR specific row's value. Any one please suggest how can I get this. Below is the example i have plotted using excel. My target is to get field 8 and 9 using sum and minus. We can calculate column over column, is there any way to calculate row over row? If I use variables, then i have to create so many variables because I have more columns and rows to calculate (here i posted one sample table). Any one please help me how can I get expected result other than using variables! If "Using variables" is the only way then also give your valuable opinions.
    Row No
    Curr Qtr
    PQtr1
    PQtr2
    3
    B3
    C3
    D3
    4
    B4
    C4
    D4
    5
    B5
    C5
    D5
    6
    B6
    C6
    D6
    7
    B7
    C7
    D7
    8
    B8=SUM(B4:B7)
    C8=SUM(C4:C7)
    D8=SUM(D4:D7)
    9
    B9=B8-B5
    C9=C8-C5
    D9=D8-D5
    Thanks.

    Hi AlexAnd,
    Thanks for the reply, I got 0 using both codes. This is a dummy table and I plotted 3,4 to give an idea of row number (as like as excel). Rows are individual data sets combining different measures and dimensions with different values.
    Account
    Curr_Qtr
    PQtr1
    PQtr2
    Deposit
    10
    15
    20
    Loan
    15
    20
    25
    Earning
    20
    25
    30
    Assets
    25
    30
    35
    Total
    =SUM(15,20)
    =SUM(20,25)
    =SUM(25,30)
    Expense
    =SUM(15,20)-25
    =SUM(20,25-30
    =SUM(15,20)-25
    Is there any way to identify the range or individual cell's value? Using variables I have to create lots of variables for each cells, I want to avoid that and want to use rows in calculation! Is that possible, Pls share your valuable opinions!
    Thanks.

  • How to color specific row in a table....

    Hi all,
    I created a table out of an Array[]. The table is successfully filled up by array's elements. Each element is a row.
    I want to be able to color specific row; instead of every row. How do I do that?
    I was looking rendering to color a row or a string; but not successfull.
    Thank you for your time and assistence.

    My favorite way of doing this is to use CSS. You plan on giving the row you want colored an id attribute, then provide a style like this:
    <style type="text/css">
      tr#colorMe td {
        background-color:blue;
    </style>Then, when you want to color the row, you make the HTML output like this:
    <table ...>
      <tr> //normal row
        <td></td><td></td><td></td>
      </tr>
      <tr id="colorMe"> //colored row
        <td></td><td></td><td></td>
      </tr>
      <tr> //normal row
        <td></td><td></td><td></td>
      </tr>
    </table>

  • How to restrict append row upto 5 in ALV Webdynpro.

    how to restrict append row up to 5 in ALV Webdynpro.

    how did you resolve it?
    thank in advance.

  • How to determine specific row in table clicked on

    Hello -
    I need to determine the specific row of a table control that is right-mouse-clicked on.  I think this is only possible by using the Shortcut Menu Activation? event for the table control and obtaining the vertical coordinate in the Coords filter options. 
    This entails performing experiments to determine the vertical range of each row in the table, or perhaps by determining the width of one row and using a linear relationship to determine the possible range of subsequent rows.  Do you feel this is the best strategy or is there possibly another easier way to obtain this information?
    Thanks,
    Don
    Solved!
    Go to Solution.

    Pop up on the Table and CREATE INVOKE NODE for POINT TO ROW COLUMN.
    Place that node on your diagram.
    Feed the COORDS cluster to that node, and out comes the row and column you clicked on.
    Be careful of edge cases, I don't remnember exactly, but if you have scroll bars visible, you might have to take them into account.  Use the IN BOUNDS output
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • How to access specific row of a database table.

    hi all,
    i am saving all the hr tables in a internal table.
    say, mtable = 'pa0002'  is the content of mtable on looping above internal table.
    LOOP AT i_itf_list INTO wa_list.  "wa_list contains list of hr tables.
       mtable = wa_list-tabname.
       LOOP AT persno.  "persno contains list of personal numbers.
    "how to acess particular row of (mtable)  dynamically where pernr = persno-pernr."
       ENDLOOP.
    ENDLOOP.
    thanks.

    Hi,
    Use below code for your reference.
    data : ref_table_des type ref to cl_abap_structdescr,
              dref type ref to data.
    field-symbols : <itab> type standard table,
                            <wtab> type any.
    data : mtable type tabname.
    LOOP AT i_itf_list INTO wa_list. "wa_list contains list of hr tables.
    clear mtable.
    mtable = wa_list-tabname.
    LOOP AT persno. "persno contains list of personal numbers.
    ref_table_des ?= cl_abap_typedescr=>describe_by_name( mtable ).
    create data dref type handle ref_table_des.
    assign dref->* to <wtab>.
    create data dref like standard table of <wtab>.
    assign dref->* to <itab>.
    ***if you want to select multople rows use below select***********
    select * from (mtable)
    into table <itab>
    where pernr = persno-pernr.
    ********if you want to select single row use below select************
    select single * from (mtable)
    into <wtab>
    where pernr = persno-pernr.
    ENDLOOP.
    ENDLOOP.
    Vijay

  • Returning specific rows within a resultset.

    I have a table with the following rows:
    Category Site Title
    ======== ==== ======
    1 1 sometitle
    123 1 sometitle
    128 1 sometitle
    4 1 sometitle
    10 1 sometitle
    I have a REF cursor that looks like this:
    OPEN RefCursor FOR
    SELECT Category, Site, Title
    FROM TableName
    WHERE Site = 1
    ORDER BY Category;
    Now...Here is the catch. In that same select statement, I want to be able to retrieve a specific range of rows to return, once the 'order by' is done.
    I want to be able to execute my query, having it return rows 2 to 4...
    So my RefCursor should contain:
    Category Site Title
    ======== ==== ======
    4 1 sometitle
    10 1 sometitle
    123 1 sometitle
    The two important things are this:
    1- The initial resultset must be sorted first..THEN I want to select specific rows.
    2- The final result set MUST be a Ref Cursor.
    Anyone have suggestions?

    This will retrieve ordered rows 2 -4.
    (SELECT Category, Site, Title
    FROM
    (select category, site, title
    from tablename
    order by category)
    WHERE Rownum < 5)
    MINUS
    (SELECT Category, Site, Title
    FROM
    (select category, site, title
    from tablename
    order by category)
    WHERE Rownum < 2)
    /

  • How to find specific text WITHIN iTunes lyrics?

    I've been trying to figure out how to search within existing iTunes song lyrics for specific words or phrases, for the purpose of making specific playlists of all songs that contain the specified text.
    As an example, I'd like to find all the songs (out of a couple thousand or so) that contain the word "Instrumental" and place them in a list.  Perhaps from there, I'd change all of those songs' Comments to show "[Instrumental]" or some such to make it easier to use some of iTunes built-in tools, or your own excellent ones.
    Or maybe I could look for songs that have the word "Notice" in them, so I can examine their lyrics to spot those which only had partial lyrics auto-loaded to them, so I could do a more thorough manual search.
    Thanks,
      Ed

    I think I'm on the good way with this:
        app.findTextPreferences = NothingEnum.nothing;
        app.changeTextPreferences = NothingEnum.nothing;
        app.findTextPreferences.findWhat = "CAR67765756";
        app.changeTextPreferences.changeTo = "bhbdbds"
        found = app.activeDocument.findText (true);
        if(found.length>0)
            for (j = 0; j < found.length; j++)
                found[j].select();
                alert("true");
                app.documents.item(0).changeText();   
        else
            alert("false");
        app.findGrepPreferences = app.changeGrepPreferences = null;
        app.changeGrepPreferences = app.changeGrepPreferences = null;

  • How to get specific rows from the vo or Iterator in the backing bean?

    Hi,
    I have to get the specific number of rows from iterator in the backing bean. means i want to get the records from the VO or Iterator only from 5 th record to 10th record its like rownum in SQL.
    We can use rownum in VO sql query. but there would be a performance issue with that ...
    SO i am trying to get the rows from ADF Iterator once we fetch from DB.
    Is it possible to do that ?
    Do we have any way to set the pointer to the VO/Iterator like setFirst() and after that setMaxResult to retrun the rows between first and maxresult..
    Thanks

    If this is for pagination, then af:table offers pagination by design when you set accessmode=RangePaging or RangePagingIncremental in VO. Paginated queries are fired when scroll down in the table. Explore this option before you try out any custom solution
    To answer the question,
    Note: same logic i have implpemented ADF with EJB ..In EJB Query class we have setFirst(int) and setMaxResult(int) methods...simply i did setFirst(30) and setMaxResult(10)..It worked fine...Theoretically speaking the same can be achieved by setting setRangeStart() on the viewobject(which in turn sets to the default rowset) and by setting max fetch size on VO + accessmode=RangePaging. However when you use table with ADF binding, these will be overridden by the binding layer. If you are not using ADF binding, then the above is same as what you did for JPA entity. Other option is, you build expert mode VO with rownum for this special case, which will work if you dont need to set accessmode=RangePaging for VO.

  • How to hide specific row or colum

    i want to show "debt to asset ratio“,but i don't want "asset" of colum and "liability" of colum stay in the table. how can i make it ?
    thank you!

    If this is for FR, you could select to hide always.

  • How to colour a row in alv report

    Hi
    As per our client's requirement we have to do color the column on the basis of values in the column like
    if data is more than 5000 it will show in red,if less than 5000 it will show in green in ALV  report.
    Pls give me the solution.
    Thanks&Regards.

    Hi Sahoo,
    If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
    in layout structure you will find field SEL_MODE
    pass :
    LS_LAYOUT-SEL_MODE = 'A'.
    In PAI.
      CALL METHOD GRID->GET_SELECTED_ROWS
        IMPORTING
          ET_INDEX_ROWS = T_ROWS
          ET_ROW_NO     = T_ROWID.
    Hope these will solve your problem.
    Regards,
    Kumar M.

  • Evaluate multiple selected rows within ABAP WD ALV

    Hi,
    I am using ALV within WebDynpros for ABAP. It's easily possible for users to select multiple rows. Subsequently I'd like to process only the selected rows further. How would I find out, which rows were selected?
    There should be a standard way via wd_this or wd_context, I don't seem to have found it yet.
    All ideas are appreciated.
    Regards, Rene

    Hi Rene,
    If you use external context binding to pass the table, the information of the selected rows should be available in the context node you passed (Get_Selected_elements).
    Ciao, Regina

  • Unable to selelct a Row in ABAP Webdynpro ALV table

    Hi,
    I have a ALV Table in webdynpro  and I need to choose a Row in that table. But the table is not allowing me to choose the row.
    Row_selectable is at 'X'.
    Row selection type is at 8.
    Still.. the grid looks like it is in display mode..
    pls help

    Hi
    You explicitly need to make the table editable.
    DATA lo_table_setings TYPE REF TO if_salv_wd_table_settings.
      lo_table = lo_interfacecontroller->get_model( ).
      lo_field_settings ?= lo_table.
      lo_table_setings->set_cell_action_event_enabled( value = abap_true ).
      lo_table_setings->set_read_only( value = abap_false ).
      lo_table_setings->set_enabled( value = abap_true ).
    have u written thse lines in ur code??
    Regards,
    Arvind

Maybe you are looking for

  • How do I reinstall my Airport extreme?

    I am having problems reinstalling my airport extreme, I need to reconfigure it, having security issues.Please helping me , do I need to un install first, to reconfigure set up.

  • Can't print to pdf from Word - Stumped Applecare & Microsoft level 2

    This is a challenge question that has stumped the Applecare level 2 and the Microsoft Office level 2 support people. I'm hoping someone out there can help me. This is different from the other postings about printing to a pdf. I am able to print to a

  • How to populate a tree from .aspx file?

    Hi, I'm very new to flex. I have a .aspx file which has xml populated in it. I would like to populate the tree based on the values of the .aspx file. Here is my code which i have tried doing this functionality but it couldn't worked out. Could anyone

  • Missing Name in BBP_PD_SC_GETDETAIL

    Hello, I use BBP_PD_SC_GETDETAIL to get the details of a sc. Then I loop over the table e_partner. Then I select the partner_fct = '00000016'. Then I select BUT000 with die guid. But the field but000-xubname is empty Here is the Conding:         if w

  • Broken Codec in new versions of QuickTime?

    Broken Codec in new QT upgrades? Why is it that my QuickTime video files: (Dimensions 720x480, Codec DV/DVCPRO-NTSC, Integer Big Endian) playback crystal clear when using QT 7.0.4, but when I playback these same files using QT 7.1.6 or QT 7.3.1 or th