How to select a color of cell in REUSE_ALV_HIERSEQ_LIST_DISPLAY

Hi.
I need to select a color of a cell in REUSE_ALV_HIERSEQ_LIST_DISPLAY.
I have found an example, but 
It shows how to select a color of sell in REUSE_ALV_LIST_DISPLAY.
Can you give me an example of code?
Thanks.

Here ia a simple example of the method how to paint a cell / line / column using REUSE_ALV_HIERSEQ_LIST_DISPLAY  function.
  Programm:    zalv_hierseq_color
  Paint a line, a colomn, or a cell
  using REUSE_ALV_HIERSEQ_LIST_DISPLAY
  Victor Stupin, Russia 2009
REPORT zalv_hierseq_color.
TABLES: spfli.
TYPE-POOLS: slis.
SELECTION-SCREEN BEGIN OF BLOCK rad1.
PARAMETERS:
        p_row TYPE i,
        p_col TYPE i.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /1(50) comm1.
SELECTION-SCREEN COMMENT /1(50) comm2.
SELECTION-SCREEN COMMENT /1(50) comm3.
SELECTION-SCREEN END OF BLOCK rad1.
INITIALIZATION.
  comm1 = 'Paint a line: fill ONLY p_row (p_col is empty)'.
  comm2 = 'Paint a colomn: fill ONLY p_col (r_row is empty)'.
  comm3 = 'Paint a cell: fill P_COL and R_ROW'.
  DATA:
        t_fieldcat TYPE slis_t_fieldcat_alv,
        fs_fieldcat LIKE LINE OF t_fieldcat,
        fs_layout TYPE slis_layout_alv ,
        w_color(4) ,
        w_row TYPE i,
        w_fieldname(20),
        w_prog TYPE sy-repid.
  DATA:
  BEGIN OF t_spfli OCCURS 0,
        color(4),
        checkbox ,
        cell     TYPE slis_t_specialcol_alv,
        carrid   TYPE spfli-carrid,
        connid   TYPE spfli-connid,
        cityfrom TYPE spfli-cityfrom,
        cityto   TYPE spfli-cityto,
        distance TYPE spfli-distance,
        keyln    TYPE int4,
        box      TYPE char1,
        lineno   TYPE int4,
  END OF t_spfli.
  DATA:
  fs_cell LIKE LINE OF t_spfli-cell.
  DATA: gt_item    LIKE TABLE OF t_spfli WITH HEADER LINE,
        gt_header  LIKE TABLE OF t_spfli WITH HEADER LINE,
        gs_keyinfo TYPE slis_keyinfo_alv.
START-OF-SELECTION.
  SELECT *
  FROM spfli
  INTO CORRESPONDING FIELDS OF TABLE t_spfli.
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 1.
  fs_fieldcat-tabname = 'GT_HEADER'.
  fs_fieldcat-fieldname = 'CARRID'.
  fs_fieldcat-ref_tabname = 'SPFLI'.
  fs_fieldcat-key = 'X'.
  fs_fieldcat-hotspot = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat .
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 2.
  fs_fieldcat-tabname = 'GT_HEADER'.
  fs_fieldcat-fieldname = 'CONNID'.
  fs_fieldcat-ref_tabname = 'SPFLI'.
  fs_fieldcat-key = 'X'.
  fs_fieldcat-hotspot = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat .
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 3.
  fs_fieldcat-tabname = 'GT_HEADER'.
  fs_fieldcat-fieldname = 'DISTANCE'.
  fs_fieldcat-key = ' '.
  fs_fieldcat-edit = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat.
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 4.
  fs_fieldcat-tabname = 'GT_HEADER'.
  fs_fieldcat-fieldname = 'CITYFROM'.
  fs_fieldcat-ref_tabname = 'SPFLI'.
  fs_fieldcat-key = ' '.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat .
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 5.
  fs_fieldcat-tabname = 'GT_ITEM'.
  fs_fieldcat-fieldname = 'CARRID'.
  fs_fieldcat-ref_tabname = 'SPFLI'.
  fs_fieldcat-key = 'X'.
  fs_fieldcat-hotspot = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat .
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 6.
  fs_fieldcat-tabname = 'GT_ITEM'.
  fs_fieldcat-fieldname = 'CONNID'.
  fs_fieldcat-ref_tabname = 'SPFLI'.
  fs_fieldcat-key = 'X'.
  fs_fieldcat-hotspot = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat.
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 7.
  fs_fieldcat-tabname = 'GT_ITEM'.
  fs_fieldcat-fieldname = 'DISTANCE'.
  fs_fieldcat-key = ' '.
  fs_fieldcat-edit = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat.
  fs_fieldcat-row_pos = 1.
  fs_fieldcat-col_pos = 8.
  fs_fieldcat-tabname = 'GT_ITEM'.
  fs_fieldcat-fieldname = 'CITYFROM'.
  fs_fieldcat-ref_tabname = 'SPFLI'.
  fs_fieldcat-key = ' '.
  APPEND fs_fieldcat TO t_fieldcat.
  p_col = p_col + 4.
  LOOP AT t_fieldcat INTO fs_fieldcat WHERE tabname = 'GT_ITEM'.
    IF fs_fieldcat-col_pos EQ p_col.
      fs_fieldcat-emphasize = 'C600'.
      w_fieldname = fs_fieldcat-fieldname.
      IF p_row IS INITIAL AND p_col GT 0.  " <---- paint only column if p_row is empty
        MODIFY t_fieldcat FROM fs_fieldcat TRANSPORTING emphasize.
      ENDIF.
    ENDIF.
  ENDLOOP.
  fs_cell-fieldname = w_fieldname .
  fs_cell-color-col = 6.
  fs_cell-nokeycol = 'X'.
  APPEND fs_cell TO t_spfli-cell.
  IF p_row IS NOT INITIAL AND p_col IS NOT INITIAL.  " <---- paint a cell
    MODIFY t_spfli INDEX p_row TRANSPORTING cell.
  ENDIF.
  fs_layout-info_fieldname = 'COLOR'.
  fs_layout-coltab_fieldname = 'CELL'.
  fs_layout-f2code = '&ETA'.
  gs_keyinfo-header01 = 'KEYLN'.
  gs_keyinfo-item01   = 'KEYLN'.
  LOOP AT t_spfli INTO gt_item.
    gt_item-keyln = 1.
    gt_item-lineno = gt_item-lineno + 1.
    APPEND gt_item.
  ENDLOOP.
  READ TABLE t_spfli INDEX 1 INTO gt_header.
  gt_header-keyln = 1.
  gt_header-lineno = 0.
  APPEND gt_header.
  CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      is_layout                      = fs_layout
      it_fieldcat                    = t_fieldcat
      i_tabname_header               = 'GT_HEADER'
      i_tabname_item                 = 'GT_ITEM'
      is_keyinfo                     = gs_keyinfo
    TABLES
      t_outtab_header                = gt_header
      t_outtab_item                  = gt_item
EXCEPTIONS
  PROGRAM_ERROR                  = 1
  OTHERS                         = 2
  IF sy-subrc = 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Similar Messages

  • How can I select same color shapes in adobe flash program ?

    how can I select same color shapes in adobe flash program ? for example we assume 10 rectangle shapes . 3 of them are red others are green. I want to use only one click or method to select 3 of them. please help me
    thanks kunter

    that is not possible unless they are all grouped into one symbol or movieclip

  • How to set background color for selected days in DateChooser

    How to set background color for selected days. I created
    checkbox for each day [Son,Mon,Tue,Wed,Thu,Fri,Sat] and a
    DateChooser, I want to change the background color for the selected
    day when i click on a button after selecting the desired checkboxs
    [ monthly wise/yearly wise]
    Thanks in advance

    There is no button involved in the following code, but it may
    be of use to you:
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private var origColor:uint;
    private function init():void {
    origColor = dc.getStyle("selectionColor");
    public function setBackGrdColors(newColor:uint):void {
    dc.setStyle("selectionColor", origColor);
    if(dc.selectedDate){
    var dayOfWeek:Number = dc.selectedDate.day;
    else{
    return;
    switch(dayOfWeek) {
    case 0:
    if(sun.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 1:
    if(mon.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 2:
    if(tue.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 3:
    if(wed.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 4:
    if(thu.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 5:
    if(fri.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    case 6:
    if(sat.selected)
    dc.setStyle("selectionColor", newColor);
    break;
    default:
    break;
    ]]>
    </mx:Script>
    <mx:VBox horizontalAlign="center" verticalGap="20">
    <mx:DateChooser id="dc" textAlign="left"
    change="setBackGrdColors(cellColor.selectedColor)"/>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="sun" label="Sun"/>
    <mx:CheckBox id="mon" label="Mon"/>
    <mx:CheckBox id="tue" label="Tue"/>
    <mx:CheckBox id="wed" label="Wed"/>
    </mx:HBox>
    <mx:HBox width="100%" horizontalAlign="center">
    <mx:CheckBox id="thu" label="Thu"/>
    <mx:CheckBox id="fri" label="Fri"/>
    <mx:CheckBox id="sat" label="Sat"/>
    </mx:HBox>
    <mx:HBox width="300" horizontalAlign="center">
    <mx:Label text="Background Color" />
    <mx:ColorPicker id="cellColor"
    selectedColor="#FF00FF"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • How do I select multiple, non-adjacent, cells in Numbers?

    I have a spreadsheet that I need to select multiple non-adjacent cells for the purposes of highlighting them and I can't figure out how to do it. The Excel equivilant would be highlight a cell and then click he desired cell while pressing cmd. This does not work nor do fn, ctrl or option. Is this possible and if so how can I do it?

    K
    It's apparently one of those many things that haven't been implemented in the iCloud beta. You'll be able to make that type of multiple selection if you spring for the OSX version of Numbers.
    Jerry

  • How to get default color of a selected row in a JLIst

    I have a JList that I am changing the font color for based on a certian situation so I created my own MyCellRenderer to do this. However, when I select an item in the list the row is no longer highlighted. I used the isSelected method to determine if a row was selected and then change the background color of that row. However, I would like the color to be the default color that you get when you select a row in a default JList. I can't seem to figure out how to get that color. How do I obtain what that color is? I found an example where you can get the default color for the background of a button and use that color so I would guess it is something similar to that. My code is below so I hope someone can tell me how to get that color that I want.
    Thanks...Chris
    class MyCellRenderer extends JLabel implements ListCellRenderer {
         public MyCellRenderer() {
              setOpaque(true);
         public Component getListCellRendererComponent(
             JList list,
             Object value,
             int index,
             boolean isSelected,
             boolean cellHasFocus)
             int index1 = value.toString().indexOf("-");
               String errors = value.toString().substring(index1 + 1, index1 + 6).trim();
             int numErrors = Integer.parseInt(errors);
               if (numErrors > 0)
                      setForeground(Color.red);
                      setBackground(Color.white);          
             else
                  setBackground(Color.white);
                  setForeground(Color.black);
             if(isSelected)
                  //ColorUIResource col = (ColorUIResource)UIManager.getDefaults().get("JButton.background");
                  ColorUIResource col = (ColorUIResource)UIManager.getDefaults().get("Button.background");
                  setBackground(col);
             setText(value.toString());
             return this;
    }

    Swing related questions should be posted in the Swing forum.
    I would like the color to be the default color that you get when you select a row in a default JList. I can't seem to figure out how to get that colorlist.getSelectionBackground();

  • How do I select a color range like in Photoshop OR copy/move a layer into the mask of another layer?

    Hi there,
    I'm trialling Photoshop Elements and wanting to use a black and white (grey scale) layer that I've made as a mask in another layer and don't know how to do it in Elements.  In Photoshop, I'd do this (there maybe a better way in PS to do it, but I haven't discovered it yet)...
    Click the layer i've created that I intend to use as a mask
    Select All
    Copy
    select layer that I want the mask to be applied to
    click the Add Layer Mask button (at the bottom of the Layers window)
    click the mask icon so it is highlighted (and the image isn't)
    switch to Channels view
    highlith the Layer Mask beneath the R,G,B layers and make it visible
    Paste
    make it invisible again
    switch back to layers.
    This works and retains the full range of transparency for semi transparency and soft edges of the mask etc.
    Alternatively, I can select a Color Range, but that doesn't seem to be available in PS Elements.
    So, how do I achieve the same result in PS Elements?
    Thanks for your help
    Jonno

    Perfect!   Thanks very much R_Kelly.  That does exactly what I was hoping to do.
    Cheers
    Jonno

  • How to set selected text color in Spark TextInput

    I'm trying to make Spark TextInputs and MXFTETextInputs look like Halo/MX TextInputs as much as possible, since I have a mix of both Spark and MX TextInputs in my application. I know I can set the
    selection background color to black using focusedTextSelectionColor. How can I set the selected text color to white so it matches the MX white-on-black look?

    This works, if you set the enabled property directly on the s:TextInput:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:layout>
            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
        </s:layout>
        <s:controlBarContent>
            <s:CheckBox id="ch" label="enabled" selected="true" />
        </s:controlBarContent>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            s|TextInput:disabled {
                color: red;
        </fx:Style>
        <s:Group>
            <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{ch.selected}" />
        </s:Group>
    </s:Application>
    It can get a bit trickier when you're setting the enabled property on a parent container, since (I believe) that the child control's enabled properties are still set to true and just the container is disabled. One possible workaround would be to bind the child TextInput control's enabled property to the container's enabled property. That way the s:TextInput should still go to it's disabled state and you can customize the disabled state's styles to have darker text, or whatever else you want.
    <s:Group id="gr" enabled="{ch.selected}">
        <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{gr.enabled}" />
    </s:Group>
    Peter

  • How to change the selection background color of the selected item in the popup menu of the choice box ?

    How to change the selection background color of the selected item in the popup menu of the choice box ?
    By defaut, the selection background color likes "blue", but if I want it to be "yellow" for example, how should I do ?
    Thanks

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

  • Photoshop CS 6 - image -canvas - make double matt - select color - if I select wrong color, how do I change to a new color, right now it won't change to the new color I select, WHY?????

    Photoshop CS 6 - image -canvas - make double matte - select color - if I select wrong color, how do I change to a new color, right now it won't change to the new color I select, WHY?????

    Hi, The options bar shows sample size 101 by 101 Average. That was my problem. When I was troubleshooting in order to try to explain to you what was happening, I noticed that when I sampled my models teeth, it gave me a color a bit lighter than her lipstick as my foreground color in my tool box. That started me thinking in the correct way. I didn't realize that my sample size had somehow gotten switched from point sample to 101 by 101 average. I appreciate the help. Thank you.

  • How to set colors in cells depending the conditions  in alvtree

    Hi All,
    Could you please provide me idea or sample program how to set colors in cells depending the conditions  in alvtree.
    Thanks,
    Suresh

    When running vim in a terminal, it will use whatever colour scheme is defined by the terminal.  You should have a look at this thread:
    http://bbs.archlinux.org/viewtopic.php?id=51818
    Also, check the wiki article on Xdefaults.

  • How to select multiple cells on a spreadsheet (online diary) without click and drag or shift and arrow keys as iPad has neither :(

    Hey guys really annoyed as I got my I pad with main reason of being able to update my online diary which is basically a spreadsheet, but I can't select more than one cell to book out a time slot, dragging just tees up the copy function and without arrow keys cannot shift and highlight, coming from windows wandering if this function is done another way on macs?  Any help would be appreciated as I'm thinking only way is to get the wireless keyboard which has arrow keys but kind of defeats the point of iPad.
    Thanks in advance ;)

    I guess I should state how much of a newbie I am.
    I did take a summer Java course at a community college this summer and I have some other programming experience (mostly Matlab).
    The course covered a lot of the language but it wasn't exhaustive. We covered (in no particular order) Arrays, Interfaces, overloading, inheritance, loops, actionlisteners, Layout managers, exceptions (a little) One thing that we really didn't get into were packages.
    We did some GUI design, but not a whole lot.
    The programming that I do with Matlab is very similar to C. (i.e. highly procedural not Object Oriented) so I think that's where some of my stumbling blocks are. I feel pretty comfortable reading Java code and using the API (sort of) but I didn't even know that 2D intersections existed.
    I have just started using eclipse last week. My previous coding was just done with textpad, so I am trying to get used to compiling code and building projects (and .jars) with an IDE.
    Thank you for the tips. I am going to keep looking around and see what I can find.

  • Color a cell when i select THAT cell

    Hi!
    I searced for something about my question, but i didn't find anything about it :/
    I have to color one cell of a JTable when i select it and make some operation.
    I tried with this:
    java.awt.Component cell = jTable1.getComponentAt(jTable1.getSelectedColumn(),jTable1.getSelectedRow());
                     cell.setForeground(java.awt.Color.red);But it color all my table and not THE cell that i've selected.
    If i've understood, the overriding of the metods prepareRenderer (or similar, i don't remember its exact name) sets the color of cells under particulare condition, but i think i don't need it: i have to color a cell only when i select it.
    Thank you!

    but i think i don't need it: i have to color a cell only when i select it. Why don't you think you need it. You have a special requirement that you only want to give the cell a specific color when it is selected. So the prepareRenderer() method should do what you want.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting.

  • How do I change color in a selection, not globally?

    Hi guys,
    My question is how do I change color in a selection and not globally? My company uses Freehand currently and there is an option to find and replace color in a selection instead of the entire document. I need to figure out how to do this in Illustrator as we will be switching over shortly.
    Thanks,
    Ron

    Edit > Edit Colors > Recolor Artwork.

  • ALV - How to hide yellow color in first cell

    Hello ALV experts!
    I am using 7 ALV layouts in one screen with one main screen and 6 small layouts with nine cells each. My objective is to enter data data in main ALV which updates the cells in the remaining ALV layouts.
    In all the six ALV alyouts, I am getting the first cell with yellow color (highlighted) which makes screen look awkward. Do you have any idea how to hide that color. ALso I would apprecaite if any of you know how to make the column fixed (when you pull the vertcal line between columns, it should not move).
    I am using OOPS ALV grid control.
    thanks!
    Senthil

    Hi,
    TO fix a column, in the filedcatalogfor the particular column which u want to fix give as
    DATA: fcat LIKE LVC_S_FCAT.
    fcat-fieldname  = 'MATNR'.
    fcat-<b>FIX_COLUMN = 'X'.</b>
    Hope this helps.

  • How to export table data with coloring of cell according to value.

    Hi all,
    I am using jdeveloper 11.1.1.6
    i want to export table data with lot of formatting. like with coloring of cell according to value and so many.How to do that?

    Hi,
    like with coloring of cell according to value and so many.How to do that?
    Answer is, you can't
    Frank

Maybe you are looking for

  • ITunes 12.1.1 won't start on Windows 7

    I've just installed iTunes 12.1.1.4 64-bit on on Windows 7. The installation did not report any errors. Prior to my installation, the previous version (not sure of the version #) worked fine. But now iTunes won't launch. When I double click the icon,

  • Reporting

    Hi every1, Please explain about these points... •     Created Update rules and Transfer routines/User Exits to harmonize the data for Global reporting. •     Extensively used Restricted Key Figures, Variables, Conditions, Exceptions and Calculated Ke

  • Low Battery rejected IOS 7 upgrade at the end of the upgrade

    Attempted to upgrade the Ipad 4 after it gave me a warning that battery is low (was at 37%). Do you want to continue? I answered YES. The install continued for about 20 minutes. When it was "done" the error message popped up that install was unsucces

  • Transfer of specific gl account balances transfer

    We want to transfer the particular GL account balances not all gl account balances.  How to transfer.  I dont find any list of selection gl accounts in F.16 or FAGLGVTR

  • Jakarta HTTPClient , dont wont to wait for a response.

    Hi there. I wonder if I can do that , I want to send a post\get request to another server but I don�t want to wait for a response from it. Actually, I want to continue with my program regardless to the response and don�t want to be delayed while wait