To make different colours for the columns of ALV report in Grid display.

Hai Friends,
                   I have created an ALV report in grid display method by using the call function reuse_alv_grid_display.
I have obtained the report.In that report i want to change the colour of each column.Plz provide the answer with a sample program.
                Thank u.

hi i had a program  for the rows with diff colors....do the same thing for the columns..
REPORT  zdemo_alvgrid                 .
TABLES:     ekko.
type-pools: slis.                                 "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
  statu TYPE ekpo-statu,
  aedat TYPE ekpo-aedat,
  matnr TYPE ekpo-matnr,
  menge TYPE ekpo-menge,
  meins TYPE ekpo-meins,
  netpr TYPE ekpo-netpr,
  peinh TYPE ekpo-peinh,
  line_color(4) type c,     "Used to store row color attributes
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
      wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
      gd_tab_group type slis_t_sp_group_alv,
      gd_layout    type slis_layout_alv,
      gd_repid     like sy-repid.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
*&      Form  BUILD_FIELDCATALOG
      Build Fieldcatalog for ALV Report
form build_fieldcatalog.
  fieldcatalog-fieldname   = 'EBELN'.
  fieldcatalog-seltext_m   = 'Purchase Order'.
  fieldcatalog-col_pos     = 0.
  fieldcatalog-outputlen   = 10.
  fieldcatalog-emphasize   = 'X'.
  fieldcatalog-key         = 'X'.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'EBELP'.
  fieldcatalog-seltext_m   = 'PO Item'.
  fieldcatalog-col_pos     = 1.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'STATU'.
  fieldcatalog-seltext_m   = 'Status'.
  fieldcatalog-col_pos     = 2.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'AEDAT'.
  fieldcatalog-seltext_m   = 'Item change date'.
  fieldcatalog-col_pos     = 3.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'MATNR'.
  fieldcatalog-seltext_m   = 'Material Number'.
  fieldcatalog-col_pos     = 4.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'MENGE'.
  fieldcatalog-seltext_m   = 'PO quantity'.
  fieldcatalog-col_pos     = 5.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'MEINS'.
  fieldcatalog-seltext_m   = 'Order Unit'.
  fieldcatalog-col_pos     = 6.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'NETPR'.
  fieldcatalog-seltext_m   = 'Net Price'.
  fieldcatalog-col_pos     = 7.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-datatype     = 'CURR'.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'PEINH'.
  fieldcatalog-seltext_m   = 'Price Unit'.
  fieldcatalog-col_pos     = 8.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
endform.                    " BUILD_FIELDCATALOG
*&      Form  BUILD_LAYOUT
      Build layout for ALV grid report
form build_layout.
  gd_layout-no_input          = 'X'.
  gd_layout-colwidth_optimize = 'X'.
  gd_layout-totals_text       = 'Totals'(201).
Set layout field for row attributes(i.e. color)
  gd_layout-info_fieldname =      'LINE_COLOR'.
endform.                    " BUILD_LAYOUT
*&      Form  DISPLAY_ALV_REPORT
      Display report using ALV grid
form display_alv_report.
  gd_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            i_save                  = 'X'
       tables
            t_outtab                = it_ekko
       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.
endform.                    " DISPLAY_ALV_REPORT
*&      Form  DATA_RETRIEVAL
      Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
data: ld_color(1) type c.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
  from ekpo
  into table it_ekko.
*Populate field with color attributes
loop at it_ekko into wa_ekko.
  ld_color = ld_color + 1.
Only 7 colours so need to reset color value
  if ld_color = 8.
    ld_color = 1.
  endif.
  concatenate 'C' ld_color '10' into wa_ekko-line_color.
wa_ekko-line_color = 'C410'.
  modify it_ekko from wa_ekko.
endloop.
endform.                    " DATA_RETRIEVAL
regards,
venkat

Similar Messages

  • To change the colour of the particular cell of ALV report in Grid display.

    Hai Friends,
                      I have created an Alv report in grid display .In that i want to change the colour of the particular cell.Plz provide the answer with a solved example.
             Thank u.

    This works for a Custom Control and OO ALV in a Dialog Module
    TABLES: kna1.
    * Data (for the ALV Grid)
    TYPES:
      BEGIN OF t_alv_data,
        cust_id    TYPE kunnr,        "Customer Number
        cust_name  TYPE name1_gp,     "Customer Name
        cust_color TYPE i,
    *   cell coloring field
        color     TYPE lvc_t_scol,   "Cell coloring
      END OF t_alv_data.
    DATA:
      v_alv_data TYPE t_alv_data,
      i_alv_data TYPE STANDARD TABLE OF t_alv_data.
    * ALV grid containers and objects
    DATA:
      o_alv_grid TYPE REF TO cl_gui_alv_grid,
      o_alv_cont TYPE REF TO cl_gui_custom_container.
    * ALV field catalog
    DATA:
      i_alv_fc TYPE lvc_t_fcat,
      v_alv_fc LIKE lvc_s_fcat.
    * ALV Layout (colors)
    DATA:
      v_alv_layout TYPE lvc_s_layo,
      i_alv_color TYPE lvc_t_scol,
      v_alv_color TYPE lvc_s_scol,
      v_alv_color_cell TYPE lvc_s_colo.
    * ALV variant
    DATA:
      v_alv_variant  TYPE disvariant.
    PARAMETERS:
      p_alvvar TYPE disvariant-variant DEFAULT 'DEFAULT'.
    DATA: ok_code LIKE sy-ucomm.
    * Class for event handling
    *       CLASS lcl_event_receiver DEFINITION
    * [+] Event listener for the ALV grid
    * [+] Handles hotspots and data changes
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
    *     Hotspot clicking
          hotspot_click
               FOR EVENT hotspot_click OF cl_gui_alv_grid
                 IMPORTING e_row_id
                           e_column_id
                           es_row_no,
    *     Data changed (such as checkbox clicking)
          handle_data_changed
            FOR EVENT data_changed OF cl_gui_alv_grid
                IMPORTING er_data_changed.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *       CLASS lcl_event_receiver IMPLEMENTATION
    * [+] Implementation of the ALV Grid event handler class
    CLASS lcl_event_receiver IMPLEMENTATION.
    *       METHOD hotspot_click                                          *
    * [+] Calls evvent_hotspot_click when a hotspot is clicked in the ALV
      METHOD hotspot_click.
        PERFORM event_hotspot_click
                      USING e_row_id
                            e_column_id.
      ENDMETHOD.                    "hotspot_click
    *       METHOD handle_data_changed                                    *
    * [+] Updates the source data when the data in the ALV display has
    * been changed, such as by clicking a checkbox.
      METHOD handle_data_changed.
        DATA: lv_changed TYPE lvc_s_modi.
        LOOP AT er_data_changed->mt_good_cells INTO lv_changed
          WHERE fieldname = 'CUST_NAME'.
          READ TABLE i_alv_data INTO v_alv_data INDEX lv_changed-row_id.
          IF sy-subrc = 0.
            MOVE lv_changed-value TO v_alv_data-cust_name.
            MODIFY i_alv_data FROM v_alv_data INDEX lv_changed-row_id.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                    "handle_data_changed
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    * Reference to the event listener class
    DATA: event_receiver TYPE REF TO lcl_event_receiver.
    *       FORM build_event_listener
    * [+] Set the event handler on the ALV Grid
    FORM build_event_listener.
    * Assigning the event listener to the ALV
      CREATE OBJECT event_receiver.
      SET HANDLER event_receiver->handle_data_changed FOR o_alv_grid.
      SET HANDLER event_receiver->hotspot_click       FOR o_alv_grid.
    ENDFORM.                    "build_event_listener
    *       AT SELECTION-SCREEN
    *         ON VALUE-REQUEST FOR p_alvvar
    * [+] Calls choose_alv_variant to ask the user to select an alv grid
    *     layout variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_alvvar.
      PERFORM choose_alv_variant
        CHANGING
          p_alvvar
          v_alv_variant.
    *       START_OF_SELECTION
    START-OF-SELECTION.
      PERFORM get_data.
      SET PF-STATUS 'ALVSCREEN' IMMEDIATELY.
      CALL SCREEN 2000.
    *       FORM get_data
    * [+] Gets the data for the ALV grid
    FORM get_data.
      SELECT kunnr name1
        INTO (v_alv_data-cust_id,
              v_alv_data-cust_name)
        FROM kna1.
        APPEND v_alv_data TO i_alv_data.
      ENDSELECT.
    ENDFORM.                    "get_data
    *       MODULE build_alv_grid
    *   THIS SHOULD BE IN THE "PROCESS BEFORE OUTPUT" OF THE ALV SCREEN
    * [+] Builds the ALV Grid objects
    * [+] Calls to build the field catalog table
    * [+] Loads the field catalog table into the ALV Grid
    * [+] Loads the table data into the ALV Grid
    MODULE build_alv_grid OUTPUT.
      SET TITLEBAR  '2000'.
    * Also enables layout saving
      PERFORM set_alv_variant
        USING
          p_alvvar
        CHANGING
          v_alv_variant.
    * Building the grid and container on the screen
    * NOTE: the container name MUST be upper-case
    * Also, we don't want the objects to be created if in batch mode!
      IF sy-batch IS INITIAL.
        CREATE OBJECT o_alv_cont
          EXPORTING
            container_name = 'O_ALV_TABLE'.
      ENDIF.
      CREATE OBJECT o_alv_grid
        EXPORTING
          i_parent = o_alv_cont.
    * builds the event listener
      PERFORM build_event_listener.
    * Color the cells
      PERFORM color_cells.
    * Build the field catalog
      PERFORM build_alv_fc.
    * Loads the data into the grid
      CALL METHOD o_alv_grid->set_table_for_first_display
        EXPORTING
          i_save          = 'A'
          i_default       = 'X'
          is_variant      = v_alv_variant
          is_layout       = v_alv_layout
        CHANGING
          it_outtab       = i_alv_data
          it_fieldcatalog = i_alv_fc.
    ENDMODULE.                    "build_alv_grid OUTPUT
    *       FORM build_alv_fc
    * [+] Constructs the ALV Grid field catalog table
    FORM build_alv_fc.
      CLEAR i_alv_fc.
      REFRESH i_alv_fc.
    * NOTE: the field name MUST be upper-case
    *                   field       heading         hide  hot
    *                   name                        zero  spot  just
      PERFORM:
        alv_field USING 'CUST_ID'    'Cust ID'        ' '  'X'  'R',
        alv_field USING 'CUST_NAME'  'Customer Name'  ' '  ' '  'L',
        alv_field USING 'CUST_COLOR' 'Color'          ' '  ' '  'R'.
    ENDFORM.                    "build_alv_fc
    *       FORM alv_field
    * [+] Describes and constructs a single field for the ALV Grid field
    *     catalog. The field length and type are both obtained from the
    *     actual field passed in to this method.
    * [+] Adds the constructed field to the ALV Grid field catalog table
    FORM alv_field
      USING
        p_field_name TYPE c
        p_heading    TYPE c
        p_hide_zeros TYPE c
        p_hotspot    TYPE c
        p_justify    TYPE c.
      CLEAR v_alv_fc.
      DATA:
        lv_type(1) TYPE c,
        lv_length TYPE i,
        lv_heading_length TYPE i.
    * get the type and length of this field
      FIELD-SYMBOLS <field>.
      ASSIGN p_field_name TO <field>.
      DESCRIBE FIELD <field> TYPE lv_type OUTPUT-LENGTH lv_length.
    * re-adjust the length to the length of the header, if too short
      lv_heading_length = strlen( p_heading ).
      IF lv_length < lv_heading_length.
        lv_length = lv_heading_length.
      ENDIF.
    * NOTE: the field name MUST be upper-case
      v_alv_fc-fieldname = p_field_name.
      TRANSLATE v_alv_fc-fieldname TO UPPER CASE.
      v_alv_fc-inttype   = lv_type.
      v_alv_fc-outputlen = lv_length.
      v_alv_fc-coltext   = p_heading.
      v_alv_fc-seltext   = p_heading.
      v_alv_fc-hotspot   = p_hotspot.
    * Determining which fields should show zeros
      IF p_hide_zeros = 'X'.
        v_alv_fc-no_zero = 'X'.
        v_alv_fc-lzero   = ' '.
      ELSE.
        v_alv_fc-no_zero = ' '.
        v_alv_fc-lzero   = 'X'.
      ENDIF.
      v_alv_fc-just = p_justify.
    * Add the field to the field catalog
      APPEND v_alv_fc TO i_alv_fc.
    ENDFORM.                    "alv_field
    *       FORM choose_alv_variant
    * [+] Shows a popup that allows the user to choose the layout variant
    *     for the alv grid of the current program
    * [+] Usually called by an AT SELECTION-SCREEN method.
    FORM choose_alv_variant
      CHANGING
        p_variant_name TYPE disvariant-variant
        p_variant      TYPE disvariant.
      CLEAR p_variant.
      DATA:
        p_exit_check(1) TYPE c.
      MOVE sy-repid TO p_variant-report.
      CALL FUNCTION 'LVC_VARIANT_F4'
           EXPORTING
                is_variant = p_variant
                i_save     = 'A'
           IMPORTING
                e_exit     = p_exit_check
                es_variant = p_variant
           EXCEPTIONS
                not_found  = 1
                OTHERS     = 99.
      IF sy-subrc = 0.
        IF p_exit_check <> 'X'.
          p_variant_name = p_variant-variant.
        ENDIF.
      ENDIF.
    ENDFORM.                    "choose_alv_variant
    *       FORM set_alv_variant
    * [+] Sets the alv grid layout variant. Used for setting the variant
    *     when its name is entered in a parameter rather than by using the
    *     popup, or when loading the variant from a variable of type C
    FORM set_alv_variant
      USING
        p_variant_name TYPE disvariant-variant
      CHANGING
        p_variant      TYPE disvariant.
      MOVE sy-repid TO p_variant-report.
      p_variant-variant = p_variant_name.
    ENDFORM.                    "set_alv_variant
    *       FORM color_cells
    * [+] Loop through the data and apply coloring
    FORM color_cells.
      DATA:
        my_color  TYPE i.
    * tell the ALV grid what field in v_alv_data contains color information
      v_alv_layout-ctab_fname = 'COLOR'.
      my_color = 0.
    * loop through each row of the table
      LOOP AT i_alv_data INTO v_alv_data.
    *   clear the variables
        CLEAR:
          v_alv_color,
          v_alv_color_cell,
          i_alv_color.
        REFRESH:
          i_alv_color.
        v_alv_data-cust_color = my_color.
        PERFORM color_cell USING 'CUST_COLOR' my_color. "negative
    *   apply the colors
    *    IF v_alv_data-cust_name = 'Testing Credit'.
    *      PERFORM color_cell USING 'CUST_NAME' 6. "negative
    *    ELSEIF v_alv_data-cust_name = 'Goober Goober Also'.
    *      PERFORM color_cell USING 'CUST_NAME' 5. "positive
    *    ENDIF.
    *   set the color data for this table row
        v_alv_data-color = i_alv_color.
        MODIFY i_alv_data FROM v_alv_data.
        my_color = my_color + 1.
        IF my_color GT 7.
          CLEAR my_color.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "color_cells
    *       FORM color_cell
    * [+] Colors a cell in the ALV grid
    FORM color_cell
      USING
        p_cellname TYPE c
        p_color    TYPE i.
      CLEAR:
        v_alv_color_cell,
        v_alv_color.
    * set the color for the cell
    *  IF p_color = 0.
    *    v_alv_color_cell-col = 0. "cl_gui_resources=>list_col_background.
    *  ELSEIF p_color = 1.
    *    v_alv_color_cell-col = 1. "cl_gui_resources=>list_col_heading.
    *  ELSEIF p_color = 2.
    *    v_alv_color_cell-col = 2. "cl_gui_resources=>list_col_normal.
    *  ELSEIF p_color = 3.
    *    v_alv_color_cell-col = 3. "cl_gui_resources=>list_col_total.
    *  ELSEIF p_color = 4.
    *    v_alv_color_cell-col = 4. "cl_gui_resources=>list_col_key.
    *  ELSEIF p_color = 5.
    *    v_alv_color_cell-col = 5. "cl_gui_resources=>list_col_positive.
    *  ELSEIF p_color = 6.
    *    v_alv_color_cell-col = 6. "cl_gui_resources=>list_col_negative.
    *  ELSEIF p_color = 7.
    *    v_alv_color_cell-col = 7. "cl_gui_resources=>list_col_group.
    *  ENDIF.
      v_alv_color_cell-col = p_color.
      v_alv_color-nokeycol = 'X'.
      v_alv_color-fname = p_cellname.
    *  v_alv_color-color = p_color.
      v_alv_color-color = v_alv_color_cell.
      APPEND v_alv_color TO i_alv_color.
    ENDFORM.                    "color_cell
    *       FORM event_hotspot_click
    * [+] What to do when clicking on a hotspot in the ALV Grid
    FORM event_hotspot_click
      USING
        p_row    TYPE lvc_s_row
        p_column TYPE lvc_s_col.
      DATA:
        lv_docnum TYPE kunnr.
      READ TABLE i_alv_data INTO v_alv_data INDEX p_row-index.
      IF p_column = 'CUST_ID'.
    *   call a transaction when the cust_id is clicked
        SET PARAMETER ID 'AUN' FIELD v_alv_data-cust_id.
        CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
      ENDIF.
    ENDFORM.                    "event_hotspot_click
    *&      Module  USER_COMMAND_2000  INPUT
    *       text
    MODULE user_command_2000 INPUT.
      CASE ok_code.
        WHEN 'BACK'
          OR 'STOP'
          OR 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_2000  INPUT

  • How to put colours for a column in ALV

    Dear All,
    I need to put green colour for 1 column in an ALV report.
    Can anybody tell me how we can do that ...
    Thanking you in advance,
    Shankar

    Here's a little sample program.....  this illistrates coloring at the column, row, and cell level.
    report zrich_0002 .
    * Use of colours in ALV grid (cell, line and column)            *
    * Table
    tables : mara.
    * Type
    types : begin of ty_mara,
              matnr         like mara-matnr,
              matkl         like mara-matkl,
              counter(4)    type n,
              free_text(15) type c,
              color_line(4) type c,           " Line color
              color_cell    type lvc_t_scol,  " Cell color
    end of ty_mara.
    * Structures
    data  : wa_mara     type ty_mara,
            wa_fieldcat type lvc_s_fcat,
            is_layout   type lvc_s_layo,
            wa_color    type lvc_s_scol.
    * Internal table
    data : it_mara     type standard table of ty_mara,
           it_fieldcat type standard table of lvc_s_fcat,
           it_color    type table          of lvc_s_scol.
    * Variables
    data : okcode like sy-ucomm,
           w_alv_grid          type ref to cl_gui_alv_grid,
           w_docking_container type ref to cl_gui_docking_container.
    parameters : p_column as checkbox,
                 p_line   as checkbox,
                 p_cell   as checkbox.
    at selection-screen output.
      perform get_data.
      perform fill_catalog.
      if w_docking_container is initial.
        perform create_objects.
      endif.
    *&      Form  create_objects
    form create_objects.
      create object w_docking_container
        exporting
          ratio                       = 60
        exceptions
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          others                      = 6.
      create object w_alv_grid
        exporting
          i_parent          = w_docking_container.
    * Field that identify color line in internal table
      move 'COLOR_LINE' to is_layout-info_fname.
    * Field that identify cell color in inetrnal table
      move 'COLOR_CELL' to is_layout-ctab_fname.
      call method w_alv_grid->set_table_for_first_display
        exporting
          is_layout                     = is_layout
        changing
          it_outtab                     = it_mara
          it_fieldcatalog               = it_fieldcat
        exceptions
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          others                        = 4.
    endform.
    *&      Form  get_data
    form get_data.
      select * from mara up to 5 rows.
        clear : wa_mara-color_line, wa_mara-color_cell.
        move-corresponding mara to wa_mara.
        add 1                   to wa_mara-counter.
        move 'Blabla'           to wa_mara-free_text.
        if wa_mara-counter = '0002'
        and p_line = 'X'.
    * Color line
          move 'C410' to wa_mara-color_line.
        elseif wa_mara-counter = '0004'
        and p_cell = 'X'.
    * Color cell
          move 'FREE_TEXT' to wa_color-fname.
          move '6'         to wa_color-color-col.
          move '1'         to wa_color-color-int.
          move '1'         to wa_color-color-inv.
          append wa_color to it_color.
          wa_mara-color_cell[] = it_color[].
        endif.
        append wa_mara to it_mara.
      endselect.
    endform.
    *&      Form  fill_catalog
    form fill_catalog.
    * Colour code :                                                 *
    * Colour is a 4-char field where :                              *
    *              - 1st char = C (color property)                  *
    *              - 2nd char = color code (from 0 to 7)            *
    *                                  0 = background color         *
    *                                  1 = blue                     *
    *                                  2 = gray                     *
    *                                  3 = yellow                   *
    *                                  4 = blue/gray                *
    *                                  5 = green                    *
    *                                  6 = red                      *
    *                                  7 = orange                   *
    *              - 3rd char = intensified (0=off, 1=on)           *
    *              - 4th char = inverse display (0=off, 1=on)       *
    * Colour overwriting priority :                                 *
    *   1. Line                                                     *
    *   2. Cell                                                     *
    *   3. Column                                                   *
      data : w_position type i value '1'.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATNR'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATNR'    to wa_fieldcat-ref_field.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'MATKL'    to wa_fieldcat-fieldname.
      move 'MARA'     to wa_fieldcat-ref_table.
      move 'MATKL'    to wa_fieldcat-ref_field.
    * Color column
      if p_column = 'X'.
        move 'C610'     to wa_fieldcat-emphasize.
      endif.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position to wa_fieldcat-col_pos.
      move 'COUNTER'  to wa_fieldcat-fieldname.
      move 'N'        to wa_fieldcat-inttype.
      move '4'        to wa_fieldcat-intlen.
      move 'Counter'  to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
      add 1 to w_position.
      clear wa_fieldcat.
      move w_position  to wa_fieldcat-col_pos.
      move 'FREE_TEXT' to wa_fieldcat-fieldname.
      move 'C'         to wa_fieldcat-inttype.
      move '20'        to wa_fieldcat-intlen.
      move 'Text'      to wa_fieldcat-coltext.
      append wa_fieldcat to it_fieldcat.
    endform.
    Regards,
    Rich HEilman

  • Colour for the List heading ALV

    Hi,
    I want to know as to how we can change the colour for the heading when we are using the report display with REUSE_ALV_LIST_DISPLAY.
    The default colour is blue, how to change it to the other colour??
    Thanks,
    Sirisha Matta.

    http://www.sap-img.com/abap/line-color-in-alv-example.htm
    Regards,
    Amit

  • Can I use different colours for the different user accounts in my iCal?

    I have my own iCal and one for my boss. I need our appointments to show up in different colours so that I can tell at a glance which are mine and which are his. Currently our appointments show up on the same calendar, on top of each other, and both are coloured red.
    Can I change the colour of one of us?

    Thanks. If there are other people invited to the appointment it comes up with this
    So I don't want to 'move' it or cancel the original appointment. is there another way I can, for example, have my boss's appointments all come up green and mine all come up blue......

  • Average of the column in ALV report

    Hi,
      I am working on an ALV report and for one of the column, i am calculating the average with fieldcatalog property do_sum = 'C'.
    I am sorting the output table for 2 fields and whenever I am expanding/compressing the sorted fields the average of the column is changing. Please let me know how do I get this average calculated constant. It should not change when the user collapses/expands on the sorted field.
    Regards
    Rashmi

    The same question has been asked in this thread:
    Compute average of a report column
    I have offered a solution but as I've said it's not great but it may meet your needs.
    Or another forum user may review and be able to suggest a better solution.
    Does the average need to be part of the report?
    Could you calculate it and display it within a page item below the report instead?

  • Displaying different colors for cells/columns in Interactive Report

    Hi,
    I have a requirement to display just the 'cells' in the Interactive Report columns with different colors.
    There are 3 columns in the Interactive report.
    The color coding for all the 3 different columns should be such that:
    <40% - red color
    40-70-orange
    greater than 70%-green
    I tried the highlight option in the report and saved the report as default, but still the color condition ended up getting displayed to the end user. I dont want this.
    Can someone suggest a better way to handle this requirement?

    Perhaps explore similar solutions described here
    Background Colour of Report Cell Issues.
    Scott

  • Matrix with different dimensions for each column

    Hi,
    I would like to have a matrix with different dimensions (rows) for each
    column, for example, I want the first column has 3 rows, the second one
    5 rows, the third one 10 rows, and so on.....
    With a simple array it is not possible, and then I make an array (for
    my columns) of clusters and each cluster has another array (rows for
    that column). Is it the best way to do it? Is it correct?
    Thanks,
    ToNi.

    Yes, everything we told you in this old thread  is still true!
    LabVIEW Champion . Do more with less code and in less time .

  • How can I make different catalogs from the same image

    How can I make different catalogs from the same image where that image has been changed in some way between the catalogs. For instance if I wanted to have a catalogs for cropped images and have 3 catalogs one for 4x6 , 5x7 and 8x10 cropping. When I tried this , if I changed a file in one catalog that same image in the other would change also.

    Do not confuse the creation of the crops and the display in collections per crop ratio.
    Of course one virtual copy (VC) per crop ratio is needed. If the same image should be cropped in all 3 mentioned ratios there would be 3 VCs.
    The OP asked how to have/see a set of same-crop-ratios.
    After having created the virtual copies for whatever crop ratio he wants, the way to display this result in the fashion asked for is via smart collections, provided they can be found. Without a plugin the naming of the VC with the crop ratio applied is a straight way to achieve that.
    IF the wish is to get new crops automatically added. (See my answers 2+3)
    IF the wish is to creat static collections per crop ratio for a certain set of images, I'd go as follows:
    1. Select all images you want to have cropped in that way,.
    2. With this selection click on the + to add another collection and fill the dialog box like this:
    Then navigate into this newly created selection and perform the 4x6 crop - according to taste individually or by synchronizing the first crop.
    Cornelia

  • "I would like to know how to set the default view for the columns. Somewhere I read it could be done in by music icon under Library.  Can't find it.  Thanks

    "I would like to know how to set the default view for the columns that are shown in iTunes. Every time I open it, I have to either go to the options, or right-click to get the pop-up options, and delete "rating" and add "composer." I'd really like to just do it once and be done with it."  Somewhere I read you could do this by clicking on the Music icon under LIBRARY then arramge the columns.  Trouble is, I can't find a Musi Folder or icon in my user library.
    Any help would be appreiated.  OSX 10.9.2  iTunes version 11.1.5  Thanks!!! CW!

    From the iTunes menu bar try View>Show View Options.  Make sure what you want to see is checked and what you don't is unchecked.  You can do this (may need to do this) for any playlists, your main Library, etc.
    Good luck
    srb

  • Alias name for the column name in Prompt

    Hi,
    I have a scenario where I am taking column names into prompt. I have used the following SQL in the SQL results under "Show" option of the Prompt.
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By OrderDate"' END FROM " Real Time"
    UNION ALL
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By ShipDate"' END FROM "Real Time"
    My problem here is I am getting the column names into the Prompt as "Orders"."By OrderDate" and "Orders"."By ShipDate", which is not acceptable and readable for mat for the user. Is there any way that I can assign an alias name for the column name such as OrderDate and ShipDate in the above SQL.
    Your quick respose is appreciated.
    Thanks,
    Rama

    hi,
    try an alternative one....in your administrator make new columns with alias to ones you want...so you wiil be able to show whatever you want.
    Otherwise,is it possible to show
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By OrderDate"' as "xxxxxxxxxxxxx"END FROM " Real Time"
    UNION ALL
    SELECT CASE WHEN 1=0 THEN AGE.AGE ELSE '"Orders"."By ShipDate"' as "yyyyyyyyyyyyyyyy"END FROM "Real Time"
    Ending,you want the data from your columns?or just the name??
    hope i helped...
    http://greekoraclebi.blogspot.com/

  • How to provide formulae for the columns in report based on date column

    Hi,
    How can we provide formulae for the columns in report, where each column is based on another Date Column.
    Can anyone suggest on this.
    Thanks

    Hi Manu,
    I think you a logical column X on which you created another Logical Column Y.
    Now you want 'Y' to be filtered based on Date Column.
    1. If, my assumption is right - You can do your requirement i.e. Filtering the logical col. 'Y' on Reports.
    Else,
    2. See - Your Logical column 'Y' While creating log. column 'Y' make sure you use any expression builder to filter across Date column. (i.e. using any case statements or where clause).
    Else,
    3. Make sure your First Logical column comes from Table by default (i.e. Create the same col. in d/b so it would be your Physic col. )
    Thank you.
    Edited by: GRK on Jan 28, 2013 7:48 AM

  • Setting different colours for different cells in a list

    Hi,
    I was wondering if we could select two cells in a list and have two different colours for each of them.
    For example, if i select the 1st and 9th cells in a list, can i have the first one to be green and the 9th one to be red?

    HI,
    Pls check this.
    http://forums.adobe.com/message/2216445#2216445
    It is for the datagrid but you can made similarly for the List. Let me know if you have any issue.
    with Regards,
    Shardul Singh Bartwal

  • PWA 2010 timesheet: 2 different colors for the rows "Actual " and "Planned

    Hello,
    To make timesheet easier to read and fill, is it possible to have 2 different colors for the rows “Actual “ and “Planned”?
    Thanks,
    soudha

    Hello Soudha,
    By default the timesheet grid shows the cells in white color. But if you have little coding skills or a developer at your end, you can try this using "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\JsGrid.js" java
    script file.
    You may have to modify it but I recommend to take a backup of the file and test in your test environment first.
    Happy troubleshooting.....
    Vikram Daruru - MSFT

  • How do I configure my iPhone to show different colours for my two calendars both from separate email accounts, both Exchange.

    How do I configure my iPhone to show different colours for my two calendars both from separate email accounts, both Exchange.

    It does so by default... what's the issue?

Maybe you are looking for