Coloring each row  Dynamically in WebDynpro using SALV_WD_TABLE component

Hi All,
  We have a requirement in WebDynpro  ABAP ,to display the ALV  table rows with different colors on the bases of come condition at runtime.
    We have checked but got only for column wise but not row wise.
Can we archive it for Row wise also?
Thanks in advance.
CB

Hi Saji,
Please go through this...
coloring  the rows of alv dnamically
Color ALV column and rows
Cell color change in ALV
Cheers,
Kris.

Similar Messages

  • Transportable stadard view using SALV_WD_TABLE component

    Hi all,
    Is it possible to make a stanard default view for all users of my WD appl. using SALV_WD_TABLE component? The standard view must be a subset of my context node.
    Thanks,
    Morten

    Hi,
    Yes you can create one view and you can display it for all users as default veiw.
    Cheers,
    Kris.

  • Header after each row in report

    Hi Team,
    In my report i want header should be repeated after each row.
    I m using apex 4.1 and template for report that i m using is STANDARD.
    EXAMPLE:- IF A,B,C are header colums then the report should be like below.
    A B C
    1 2 3
    A B C
    5 6 7
    A B C
    8 9 1
    A B C
    1 2 3
    Please suggest me some way to edit template and getting the report in the desired format.
    Thanks,
    Rajendra

    Hello Thomas,
    sorry for the late answer.
    Here is the part of the coding.
    There is nothing special about conversion,
    I just call the parser and return the XML stream back.
    The parser itself provides this conversion with CR/LF.
    I think it is not the best way to do this, but it works fine and it was very easy.
    best regards
    Werner
         public void execute(InputStream in, OutputStream out) throws StreamTransformationException
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setNamespaceAware(true);
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   Document doc = builder.parse(in);
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   Transformer t = tFactory.newTransformer();
                   t.setOutputProperty(OutputKeys.INDENT, "yes");
                   t.transform(new DOMSource(doc), new StreamResult(out));
              catch(Exception e)
                   e.printStackTrace();
                   throw new StreamTransformationException("Mapping Error!", e);

  • Finding minimum value in each row using dynamic query

    need to find the minimum and maximum value from each row using dynamic query
    [from curr] will be given as input
    Tuky

    DECLARE @t TABLE(a INT,b INT,c INT);
    INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
    SELECT *
    ,      (   SELECT  MAX(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS MaxVal 
    ,      (   SELECT  MIN(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS MinVal 
    FROM @t;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Dynamic coloring of rows using FM (Reuse_alv_grid_display.)

    I need to color the rows depending on the condition dynamically . I am using FM Reuse_alv_grid_display for ALV . I have the code using Oops Concept, But i need to know how can we do using the Function Module. Please Clarify

    Hi,
    In the final internal table you declare one fieldsline_col(4) type c.
    Data: begin of itab occurs 0, "final internal table.
          line_col(4) type c,.
         end of itab.
    IF .......your condition.
        loop at itab.
          if itab-WERKS = '1000'.
            itab-line_col = 'C600'.
          endif.
          modify itab.
          clear itab.
        endloop.
    Next build your FIELDCATALOG ......
        gt_layout-zebra = 'X'.
        gt_LAYOUT-DETAIL_POPUP = ' '.
        gt_layout-info_fieldname = 'LINE_COL'.
    Next pass this to your FM.
    I hope this will help you.
    Thanks.
    If your issue is solved award points and close the thread if not revert back.
    Message was edited by: Deepak333 k
    Message was edited by: Deepak333 k

  • How to use EVS with different data in each row, in a Java Web Dynpro table?

    Hi all,
    I am using EVS in a column of java web dynpro table.
    Let's say the name, and context attribute, of this column is column1.
    It's filled dynamically using an RFC, that uses as input parameter the value of another column, and related context attribute, from the same table (Let's call it column2).  Obviously, from the same row. So, in other words: the values of the EVS in column1 of row1, are dependent of the value of column2 of row1. And the values of the EVS in column1 of row2, are dependent of the value of column2 of row2. And so on... Hope i could explain myself ok.
    The code I'm using works great for filling the EVS dynamically:
    IWDAttributeInfo attrInfo = wdContext.nodeDetail().getNodeInfo().getAttribute(nodeElement.COLUMN1);
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    value.clear();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for (int i = 0; i < wdContext.nodeRFCresult().size(); i++){
              value.put(wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgort()
                 , wdContext.nodeRFCresult().getRFCresultElementAt(i).getLgobe());
    In this code, nodeElement is the context row of the table that is passed dynamically to the method when the value of colum2 is changed.
    HOWEVER, the problem I'm having is that after executing this code, EACH NEW ROW that is added to the table has by default the same values as the first row, in the column1 EVS. And, for example, if I refresh the values of the column1 EVS in row 2, all EVS values in the other rows are also refreshed with the same values as the ones of EVS in row 2.
    How can I make sure each row EVS has its own set of independent values, so they don't mess with each other?
    Hope you guys can help me. And please, let me know if I didn't explain myself correctly!
    Thanks!

    I just did as you said (I think), but it's still having the same behaviour as before (same data for all EVS in the table).
    Here´s what I did:
    I
    In node "Detail" (cardinality 0...n, singleton set to true), which is binded to the table, I created a child node named "Column1Values" wth cardinality 1...1 and singleton set to false.
    "Column1Values" node has an attribute called "column1", of type String.
    I did the binding between attribute "column1" and the column1 inputfield celleditor in the table.
    I created an event called Column2Changed and binded it to the column2 celleditor of the table. I added a parameter called nodeElement of type IPrivateCompView.IDetailElement to this event, and mapped it to the column2 editor in the table so that I can dynamically get the nodeElement that is being affected.
    I added the following code to the onActionColumn2Changed(wdEvent, nodeElement) method that gets created in the view:
    IWDAttributeInfo attrInfo = nodeElement.nodeColumn1Values().getNodeInfo().getAttribute("column1");
    ISimpleTypeModifiable siType = attrInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet<String> value = siType.getSVServices().getModifiableSimpleValueSet();
    if(this.initRFC_Input(nodeElement.getColumn2())){
         for(int i =0; i < wdContext.nodeRFCresults().size(); i++){
              value.put(wdContext.nodeRFCresults().getRFCresultsElementAt(i).getId(),
                                  wdContext.nodeRFCresults().getRFCresultsElementAt(i).getDesc());
    And with this, I still get the original problem... When the EVS of one row is updated, ALL other EVS of the table get also updated with the same values.
    What am I missing? Sorry Govardan, I bet I'm not seeing something really obvious... hopefully you can point me in the right direction.
    Thanks!

  • Dynamic rows in ABAP webdynpro table

    hi all
    I've got a question. I have a webdynpro with a table.
    This table is feed by a node. The number of rows of this node is dynamic.
    I had seen in the properties of the table object that the number of visible rows can be set.
    But is there also a method to set this number of rows dynamicly? So when the node has 20 rows
    the table object is also set to show 20 rows and when there are none, the table
    only shows the header of the  table.
    Currently the table always shows 5 rows, without checking how many rows there actually are.
    Does any of you know how to do this?
    kind regards,
    Anton Pierhagen

    Hi Anton ,
    You can use the method SET_VISIBLE_ROW_COUNT() of the class cl_wd_table for setting the visible row count dynamically.
    In the WDDOMODIFY view , you can get the reference of the table UI element used and proceed.
    DATA lo_table TYPE cl_wd_table.
    lo_table ?= view->get_element( ID = 'name_of_table_in_the_view').
    lo_table->SET_VISIBLE_ROW_COUNT(value = 5)."Here the value you can decide based on your data.
    But this method is not recommended as it directly deals with the view's elements and will be very difficult for the person maintaining the code.
    Instead create a attribute which can store a number and bind the visible row count property to this attribute.
    set this attribute with the values based on the data.(as in number of visible rows you would want to see.)
    Thanks,
    Aditya

  • How to display the rows in a color for specific dynamic condition.

    Hi,
    I am new to OAF. I created a custom Search Page.My requirement is we need to display a color for specific dynamic condition. Could any one help me how to do this?
    Thanks in Advance
    Sruthi.

    Hi,
    Sruthi wrote:
    I am new to OAF. I created a custom Search Page.My requirement is we need to display a color for specific dynamic condition. Could any one help me how to do this?------I think we can display colours at coloumns level only,nt at row levevl.
    ------use CSSStyle to set the colour, via webBean.
    Co-ProcessRequest:*
    import oracle.cabo.style.CSSStyle;
    CSSStyle oraaniltext = new CSSStyle();
    oraaniltext.setProperty("color", "#F6358A");
    oraaniltext.setProperty("background-color", "#000000");
    OAMessageTextInputBean comCode = (OAMessageTextInputBean)webBean.findChildRecursive("InvoiceIdTI");
    comCode.setInlineStyle(oraaniltext);
    http://www.computerhope.com/htmcolor.htm
    Regards
    Meher Irk
    Edited by: Meher Irk on Oct 25, 2010 9:46 PM

  • Select item on a Tabular form with a different dynamic LOV on each row

    I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
    So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
    -- Justin

    I'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
    Here's the query:
    select apex_item.display_and_save(1,dept) dept,
    apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
    from dept_emp
    I removed the code that was there already (ApplyMRU) and just put in this code:
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    UPDATE dept_emp
    SET
    name=HTMLDB_APPLICATION.G_F02(i)
    WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
    END LOOP;
    END;
    The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
    http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
    The thing I could not get to work was a dynamic message
    #MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
    Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
    You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
    Thanks again everybody!

  • Dynamic messageChoice based on value in each row

    Hi All,
    Am trying to implement a requirment, am not sure how i can acchive this in OAF.
    I would appriciate any one who points me in the right direction
    How to have a dynamic messageChoice in OAFTable.
    My scenario is like this,
         OAFTable[UI Table]
    ========================================
    | Name | xxx      | MessageChoice values |
    ========================================
    | 12-A | xxx | Apple,Airport |
    | 15-B | xxx | Ball,Box |
    | 20-S | xxx | Singapore |
    =======================================|
    VALUE_TABLE[DB table]
    =======================
    | Letter | Value |
    =======================
    | A     | Apple |
    | S     | Singapore |
    | A     | Airport |
    | B | Ball |
    | B | Box |
    =======================
    There is a messageChoice column in my OAFTable(third column as represented above),
    values for this messageChoice should be filtered on 'Name' column in each row i.e extract the letter and use this extracted value to filter the values in VALUE_TABLE.
    Where clause for each rows message choice should dynamically modify as
    Row 1 : select value from VALUE_TABLE where letter = 'A'
    Row 2 : select value from VALUE_TABLE where letter = 'B'
    Row 3 : select value from VALUE_TABLE where letter = 'C'
    since messageChoice EVENT is generated only after value is changed, i cann use that to modify the where clause of the VO.
    Is there any feature in OAF that modifyes VO's WHERE clause for each row?
    what will be the ideal approach to acchive this. surely some one would have resolved this kind of scenario..
    Advance thanks for any suggestions :)
    srinath

    Hi,
    Yes there is a standard approach available
    Consider a container, such as a table, that has two columns. One column displays a department, while the
    other column displays all the employees of that department in a poplist. The view object used for the poplist
    (Pick List View Definition) needs the department number (the "Deptno" field of the container) bound for bind
    variable :1. This can be done with the following code example in the controller's processRequest method:
    OATableBean table = ...
    OAMessageChoiceBean empPoplist =
    (OAMessageChoiceBean)table.findChildRecursive("EmpName");
    empPoplist.setListVOBoundContainerColumn(0, /* bind index */
    table,"Deptno");
    This code binds the first (0th) bind index of the employee poplist view object to the value displayed by the
    column named Deptno in the table.
    The method setListVOBoundContainerColumn can be called multiple times if the query used for the poplist has
    multiple bind variables. Note that this approach effectively simulates a BC4J view link except that it relies on
    the UI table columns for the bind values rather than the view object attribute values directly.
    Thanks,
    Gaurav

  • How to add af:inputFile dynamically within each row of table?

    I need to add af:inputfile dynamically within each row of af:table, when the user hits a commandlink at the bottom of each row.
    I have tried wrapping af:inputfile with af:foreach:
    <af:table value="Bean.rows" var="row">
    <af:column>
    <af:forEach step="1" begin="1"
    end="#{Bean.filecount}">
    <af:inputFile label="Please upload a file"
    id="1"
    valueChangeListener="#{Bean.onClickUpload}"/>
    </af:forEach>
    <af:commandLink text="Add more file" id="cl3" actionListener="#{Bean.onAddFile}"/>
    </af:column>
    </af:table>
    in Bean.onAddFile, I have:
    public void onAddFile(ActionEvent event){
    filecount++;
    It works but there's no independent control of each row. When I click one commandlink, All rows now have 2,3,.... af:inputFile. The change affects all rows.
    The requirement should be that when I click one commandlink in a row, only that row shows additional af:inputFile.
    So why not leverage the row variable of the table, right? That's what I did, I changed the end attribute of foreach to the following:
    <af:forEach step="1" begin="1"
    end="#{row.fileRowCount}">
    the backing bean method changed to the following:
    public void onAddFile(ActionEvent event){
    int filerowcount = (Integer)JsfUtil.resolveExpression("#{row.fileRowCount}");
    Integer newcount = filerowcount+1;
    JsfUtil.setExpressionValue("#{row.fileRowCount}", newcount.toString());
    Note that "row" refers to an object that has a int field called "filerowcount". And the initial value is "1".
    Just for testing, I also added <af:outputText value="row.filerowcount"/>, to see if the count is what I expected it to be.
    I didn't see the any af:inputfile this time, but the outtext is showing the filerowcount properly. When I click the commandlink, the number changed to 2,3,..... Also in the backing bean newcount and filerowcount is incrementing correctly.
    I know the begin, end attribute means the index of a for loop. So I changed begin="0", it now shows one row of af:inputfile, but when I click the commandlink, no additional rows are shown. (Although the outputtext of filerowcount keeps incrementing as expected.
    So to sum up, the END attribute of af:foreach row CAN pick up the value from the backing bean and render af:inputfile dynamically, but it CANNOT pick up the value from the the field in VAR object of a table.
    Is is a known issue? Or I did something by mistake.
    Is there any other way to add af:inputFile dynamically within each row of table?
    Any advice/comment is appreciated.

    Hi,
    here is how it goes:
    - add an af:inputFile to the column and set its rendered property to point to a managed bean property. The managed bean property has a default value of "false" and the bean should be in viewScope
    - create another variable that holds the row number that should show the inputFile component. This is updated by the command link and evaluated by the get method of the managed bean property controlling the inputFile visibility
    - Define a property name for the table varStatus property
    - For the command link, define a attribute f:attribute with the name rowNumber and set its value to #{varStatusPropertyName.index}
    - define an action listener for the command link
    public void showInputFile(ActionEvent actionEvent){
    int rowNumber = ((RichCommandLink) actionEvent.getSource()).getAttributes().get("varStatusPropertyName");
    //set the value on the internal variable
    - In the getter of the property that defines the render value of the inputFile, use code like this
    public boolean get<whatever name you use>(){
    //access the following EL from Java #{varStatusPropertyName.index}
    int currentRenderedRow = <EL result here>;
    // compare the current row index with the one set by the command link, which is stored in the variable of the managed bean
    if true return true
    else return false
    - Set the PartialTriggers property of the table to point to the commandLink ID so the table is repainted when the command link is pressed
    This should then render the fileInput component for a single row (the one you clicked the command link in)
    Frank

  • How to color a row using REUSE_ALV_HIERSEQ_LIST_DISPLAY

    Hi,
    I'm able to color a row using REUSE_ALV_GRID_DISPLAY, I tried the same way to color a row at the item level using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' but I'm not able to get the row color, please let me know how to acheive this.
    Thanks in Advnce
    Narayan

    you need to do 4 things.
    1. Add a field in your final internal table which ur going to display.
    2.Name the field as----
    > color_line(4)   TYPE  c,
                begin of itab,
                              matnr            type  mara-matnr,
                              ernam          type  mara-ernam,
                           color_line(4)   TYPE  c,
               end of itab.
    3.declare layout ....................> data :  it_layout   TYPE lvc_s_layo.
    4. After filled your fieldcat and before display your ALV
            loop at itab assigning to <itab>.
                          if <itab>-ernam eq 'XYZ'.
                          <itab>-color_line = 'C600'.
           end loop.
    it_layout-info_fname = 'COLOR_LINE'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    exporting
        IS_LAYOUT                      = it_layout
        IT_FIELDCAT                    = your_fieldcat
      and pass ur  ITAB.

  • Using a LoV in each row of a report (SELECT)

    Hi everyone,
    I have a report of a table in APEX and I'd like to show a column with a Select list that I have saved (LoV). I mean, for each row of the table it must appear this dinamic select list. In addition, I want a button next to every Select list, every row.
    I know how to show a static select list using HTML in my SELECT query. I do something like:
    SELECT atribute1, atribute2, .... , '<html> select code </html>' as "list"
    FROM table1
    But I need to use an existing LoV. And then, if the user change one value of one select list, and presses the button in the same row, this value should be processed and do an UPDATE of this row in the DataBase.
    I suppose it is possible to do this in APEX, but I still didn't fins the way to do this.
    Can you help me, please? If my english is too bad, I can try to explain it better.

    It's not necessary any answer.
    I was wrong about inserting LoVs with HTML. It is not that hard, it's more simple and I know how to do this now.

  • I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly app

    I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly appreciated.

    Here's something I threw together rq. The script is in the change event for the checkbox in the table. (Of course, you'll have to modify it to suit the names of your fields.)
    var rows = xfa.resolveNodes("tblAmounts.Row1[*]");
    var subtotal=0;
    for (i=0; i<rows.length; i++) if (rows.item(i).cbAdd.rawValue == 1) subtotal = subtotal + rows.item(i).nfAmount.rawValue;
    nfSubtotal.rawVlaue=subtotal;

  • Problem in displaying dynamic values in dropdown list for each row

    I want to display dynamic values in a drop down list for each row, and these values depends on the column value in each row(ptaid), based on each ptaid i need to fetch values for drop down list. so how can i achieve this..
    Thanks
    Babu

    Babu,
    This has been discussed in many old threads, try to find them. Also u can refer to article "Dependent Dynamic message choicelists ", at my blog
    http://www.mukx.blogspot.com/
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • Dynamic selection-screen parameters

    Hi All, Is it possible to create a dynamic selection-screen checkbox parameters at runtime. My requirement is : I have Object parameter on the selection-screen, based on this it has to fetch the info structures and display it with checkboxes on the s

  • Indic script display problem - Open Office PDF export does

    I am trying to create a PDF document using iText (a Java library) and I found out that Indic script specificaly Malayalam Language Unicode is not displayed properly. Ligature substitution and reordering is not working at all. (See attached image1.png

  • Housekeeping of Query Views in Portal

    Hi, I am looking to provide housekeeping with Query Views on our Portal. At the moment all Query Views appear when you choose 'Bex Portfolio' and there are a large number in there now - most of which are redundant. At the moment, I have two issues -

  • Control Framework tree control event not trigerring

    The event handle_node_double_click is not trigerring on the tree controls . I want to display the contents of the nodes on the text editor on trigerring of this event *& Report  ZCONTROLS_TREE_TEDIT_SPITTER REPORT  zcontrols_tree_tedit_spitter. DATA

  • Email loading issues

    I have a Droid X2 and regularly when accessing an email or the email mail accounts, the phone says loading for a while then kicks me out of the app. I have tried rebooting, taking the battery out, etc. Nothing seems to work except letting it sit for