Coloring Cells in Apex 4.2

I'm trying to figure out how to change the cell background color in an Apex report. I've tried following instructions that I've found on here and on the net with no luck. I'm wondering if maybe the instructions are not valid for 4.2.
Anyway, has anyone had any lock with setting a cell background-color in Apex 4.2 based on value?
Thanks!

>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user12612539".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
Your question does not provide enough detail to permit a rapid and accurate response.
I'm trying to figure out how to change the cell background color in an Apex report.What kind of report?
I've tried following instructions that I've found on here and on the net with no luck.Where here (see the FAQ for how to link to previous threads)? Where on the net? What do you mean by "no luck"? What happens when you follow these instructions?
Please consider providing an example showing how far you have got with this on apex.oracle.com.

Similar Messages

  • ALV with colored cell exporting to Excel

    Hi all,
    I have an ALV-Table in my webdynpro appliation. There are some dropdownbykey fields in the alv and some cells are colored.
    After export to excel the colored cells are no more colored.
    Is there a possibility to export the color too.
    Best regards
    Marcus

    Have you found a solution to this issue? I am searching for the same.

  • Problem with coloring cells in dynamic fieldcatalog

    Hi All,
    I am trying to color cells based on the values in the cells. Here we are using dynamic fieldcatalog and internal table to build the ALV grid.I am getting problem in adding a field to the fieldcatlog which is of type lvc_t_scol. This Part of the code is used to build fieldcatlog dynamically.
    DEFINE add_cat.
        add 1 to lv_count1.
        lwa_fldcat-col_pos     = lv_count1.
        lwa_fldcat-fieldname = &1 .
        lwa_fldcat-reptext   = &2.
        lwa_fldcat-inttype   =  &3.
        lwa_fldcat-intlen    = &4.
        append lwa_fldcat to lt_fldcat .
      END-OF-DEFINITION.
    *Add Columns to the fieldcatalog
      add_cat c_proj 'Project' 'C' '30'.
      add_cat c_cust 'Customer' 'C' '30'.
      lwa_fldcat-col_pos     = 12.
        lwa_fldcat-fieldname = 'cellcolor' .
        lwa_fldcat-reptext   = 'cell color'.
    <b>    lwa_fldcat-inttype   =  'lvc_t_scol'.</b>
        append lwa_fldcat to lt_fldcat .
    Here i want to assign internal table(lvc_t_scol) to the fieldcatalog as a field.But  lwa_fldcat-inttype is of size 1 which will take one char. Is there any way that we can assign field of type internal table to the field catalog. Becoz of this i am unable to color cells in my ALV grid.
    Thanks

    It is not possible with the METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
    I have tried to do it with the code and I got the dynamic table created after at the end of the program.
    In the code,
    <DYN_TABLE> has same effect as your <table> variable
    <DYN_WA> has same effect as your <HEADER>
    REPORT  ZTEST_NP_DYNAMIC.
    DATA: DY_TABLE TYPE REF TO DATA,
          DY_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                   <DYN_WA>,
                   <DYN_FIELD>.
    FIELD-SYMBOLS: <FS> TYPE ANY.
    * To generate the Dyanmic table with the COLOR
    DATA: LS_SOURCE TYPE STRING.
    DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
    DATA: L_NAME LIKE SY-REPID.
    DATA: L_MESSAGE(240) TYPE C,
          L_LINE TYPE I,
          L_WORD(72) TYPE C.
    DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
    LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'FORM  TABLE_CREATE USING I_FS TYPE ANY.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
    APPEND LT_SOURCE.
    * you can add your fields here.....
    LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.  " <<
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'I_FS = POINTER.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'ENDFORM. '.
    APPEND LT_SOURCE.
    L_NAME = 'ZTEST_SUBROUTINE_POOL'.
    CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
      GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
               MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD.  "#EC CI_GENERATE
    ENDCATCH.
    IF NOT L_MESSAGE IS INITIAL.
      MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
    ENDIF.
    ASSIGN DY_TABLE TO <FS>.
    PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
    ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    * Create dynamic work area and assign to FS
    CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
    ASSIGN DY_LINE->* TO <DYN_WA>.
    Write: 'bye'.
    Regards,
    Naimesh Patel

  • Colored Cells in Excel sheet

    hi
    we have a excel sheet with values which we created based on a tutorial spreadsheet. We tried the exactly the same steps provided in the PDF but it did not work. however when we used the original file we got the same output that was shown in the PDF screenshot. Here is what we tried.
    we created a spreadsheet similar to the one given below
    City     JAN     FEB     MAR     APR     MAY     JUN     JUL     AUG     SEP     OCT     NOV     DEC     Low     High
    ABILENE, TX     44     49     56     65     73     80     84     83     76     66     54     45     44     84
    AMARILLO, TX     36     41     48     56     65     74     78     76     69     58     45     37     36     78
    AUSTIN/BERGSTROM, TX     48     53     60     67     75     80     83     82     78     69     58     50     48     83
    In the canvas we placed a spreadsheet table control which contained the city names , a line chart and 2 gauges for HIGH and LOW values.
    Now the problem we faced was when we click on the city name in the table control nothing changed in the chart even though it was mapped to the correct cells.
    In the original file that came with the PDF there were YELLOW and RED blank cells to which it asked to map but those cells didnot contain any hidden data also. We would like to know is there any significance of those colored cells. whenever we download some sample excel file from the internet for a dashboard creation it has some colored cells, we would like to know does those cells contain any hidden info to make the dashboard work.
    Thanks
    GURU

    Most of the times, colored cells are used by the dashboard's designer to represent cells that are used at run time as origin/destination cells. This means that although at design time they are empty (they indeed are - there is no "hidden" data there), they contain data when the dashboard is executed.
    Some suggestions:
    - Check the component's properties to see which cells it uses.
    - Also, when in Preview, go to File -> Snapshot -> Current Excel Data to see what the Excel file actually looks like at run time. There you should see data in the colored cells.
    HTH,
    JK

  • Inner table output to Excel with colored cells?

    Hi!
    I would like to output my inner table into Excel ducoment.
    And it is important to have Excel document with colored cells.
    I have searched for this solution, but could not find...
    Any help will be awarded!
    Kind regards, M.

    Hi,
    You can use function module "XXL_SIMPLE_API"
    or alternatively use "XXL_FULL_API".
    On the import, parameter name "N_KEY_COLS" is used to colour fields. The headings are automatically coloured. 1 is the default value.
    This reply is nearly 1 year after the last post
    Regards,
    Daniel

  • Sorting colored cell in JTable

    First, i'm sory for my bad english
    I've made a JTable that have a column contains different colored cell each row depend on value at that cell. Like some post at many forums, I'm using DefaultTableCellRenderer with overiding getTableCellRendererComponent() and calling setBackground(Color c) from that return Component object .
    At the first time data loaded into table, all is working well (each cell has their suitable color), but when I sort the table by clicking their header, the bacground color still at the fix cell (not sorted)
    Any idea for this?
    Thnks before.

    Thanx to Axel.
    Yes, right, it's working in TableSorterDemo.java
    that code coloring the cell depen on its value
    but my app need to be colored only at specific column, so i need the value of column
    i just try to modify at your code like this:
             table.setDefaultRenderer(Integer.class, new DefaultTableCellRenderer() {
                 public Component getTableCellRendererComponent (JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                     Component cell = super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column);
                     cell.setBackground(Color.white);
                     if(value instanceof Integer) {             
                         if ((new Integer(5)).equals(value)) {
                             cell.setBackground(Color.yellow);
                         } else if((new Integer(3)).equals(value)) {
                             cell.setBackground(Color.green);
                         } else if((new Integer(20)).equals(value)) {
                             cell.setBackground(Color.red);
                     if(column == 0){ //not working, n it should not :D
                    cell.setBackground(Color.red);
                     return cell;
    but, didn't work
    so i set the CellRenderer using column approach in my app, like this:
    DefaultTableCellRenderer leftCellRenderer = new DefaultTableCellRenderer() {
                @Override
                public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                    Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                    super.setHorizontalAlignment(SwingConstants.LEFT);
                    return cell;
            DefaultTableCellRenderer centerCellRenderer = new DefaultTableCellRenderer() {
                @Override
                public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                    Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                    super.setHorizontalAlignment(SwingConstants.CENTER);
                    return cell;
            DefaultTableCellRenderer coloredCellRenderer = new DefaultTableCellRenderer() {
                @Override
                public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                    Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                    super.setHorizontalAlignment(SwingConstants.CENTER);
                    if (value.equals(" ")) {
                        cell.setBackground(Color.GREEN);
                    } else {
                        cell.setBackground(Color.RED);
                    return cell;
            myTable.getColumnModel().getColumn(1).setCellRenderer(leftCellRenderer);
            myTable.getColumnModel().getColumn(0).setCellRenderer(centerCellRenderer);
            myTable.getColumnModel().getColumn(2).setCellRenderer(centerCellRenderer);
            myTable.getColumnModel().getColumn(3).setCellRenderer(centerCellRenderer);
            myTable.getColumnModel().getColumn(4).setCellRenderer(coloredCellRenderer);And all works fine :-)
    Thanks.

  • Coloring cells in alv

    How to color cells according to particular condition in alv using field catalog?
    thanks

    hi
    good
    go through this report
    tables used -
    tables: mkpf,
            mseg,
            lfa1,
            makt.
    global hashed tables used
    data: begin of wa_mkpf, "header
          mblnr like mkpf-mblnr,
          mjahr like mkpf-mjahr,
          budat like mkpf-budat,
          xblnr like mkpf-xblnr,
          end of wa_mkpf.
    data: ht_mkpf like hashed table of wa_mkpf
          with unique key mblnr mjahr
          with header line.
    data: st_mkpf like standard table of wa_mkpf
          with header line.
    data: begin of wa_mseg, " line items
          mblnr like mseg-mblnr,
          mjahr like mseg-mjahr,
          zeile like mseg-zeile,
          bwart like mseg-bwart,
          charg like mseg-charg,
          matnr like mseg-matnr,
          lifnr like mseg-lifnr,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_mseg.
    data ht_mseg like hashed table of wa_mseg
          with unique key mblnr mjahr zeile
          with header line.
    data st_mseg like standard table of wa_mseg
          with header line.
    cache structure for lfa1 records
    data: begin of wa_lfa1,
          lifnr like lfa1-lifnr,
          name1 like lfa1-name1,
          end of wa_lfa1.
    data ht_lfa1 like hashed table of wa_lfa1
          with unique key lifnr
          with header line.
    cache structure for material related data
    data: begin of wa_material,
          matnr like makt-matnr,
          maktx like makt-maktx,
          end of wa_material.
    data: ht_material like hashed table of wa_material
            with unique key matnr
            with header line.
    result table
    data: begin of wa_lst, "
          budat like mkpf-budat,
          mblnr like mseg-mblnr,
          lifnr like mseg-lifnr,
          name1 like lfa1-name1,   
          xblnr like mkpf-xblnr,
          zeile like mseg-zeile,
          charg like mseg-charg,
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          mjahr like mseg-mjahr,
          end of wa_lst.
    data: ht_lst like hashed table of wa_lst
            with unique key mblnr mjahr zeile
            with header line.
    data: begin of wa_lst1, " sumary by material
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          color_line(4) TYPE c,           " Line color
          color_cell    TYPE lvc_t_scol,  " Cell color
          celltab type LVC_T_STYL,
          end of wa_lst1.
    data: ht_lst1 like hashed table of wa_lst1
            with unique key matnr
            with header line.
    structures for alv grid display.
    itabs
    type-pools: slis.
    data: it_lst            like standard table of wa_lst with header line,
          it_fieldcat_lst   type slis_t_fieldcat_alv with header line,
          it_sort_lst       type slis_t_sortinfo_alv,
          it_lst1           like standard table of wa_lst1 with header line,
          it_fieldcat_lst1  type slis_t_fieldcat_alv with header line,
          it_sort_lst1      type slis_t_sortinfo_alv.
    structures
    data: wa_sort         type slis_sortinfo_alv,
          ls_layout       type slis_layout_alv.
    color management.
    DATA  : wa_color    TYPE lvc_s_scol.
    Internal table for color management.
    DATA : it_color    TYPE TABLE          OF lvc_s_scol.
    itab for input enabling.
    DATA: lt_celltab TYPE lvc_t_styl. "
    global varialbes
    data: g_lines type i.
    data: g_repid like sy-repid,
          ok_code       like sy-ucomm.
    selection-screen
    "text: Dates:
    select-options: so_budat for mkpf-budat default sy-datum.
    "text: Material numbers.
    select-options: so_matnr for mseg-matnr.
    selection-screen uline.
    selection-screen skip 1.
    "Text: show summary by material.
    parameters: gp_bymat as checkbox default ''.
    parameters: gp_hier  as checkbox default 'X'.
    start-of-selection.
      perform get_data.
      perform show_data.
    end-of-selection.
          FORM get_data                                                 *
    form get_data.
            select mblnr mjahr budat xblnr
                into table ht_mkpf
               from mkpf
              where budat in so_budat. " make use of std index.
    have we retrieved data from mkpf?
      describe table ht_mkpf lines g_lines.
      if g_lines > 0.
    if true then retrieve all related records from mseg.
    Doing this way we make sure that the access is by primary key
    of mseg.
    The reason is that is faster to filter them in memory
    than to allow the db server to do it.
        select mblnr mjahr zeile bwart charg
                 matnr lifnr erfmg erfme
          into table ht_mseg
          from mseg
            for all entries in ht_mkpf
         where mblnr = ht_mkpf-mblnr
           and mjahr = ht_mkpf-mjahr.
      endif.
    fill t_lst or t_lst1 according to user's choice.
      if gp_bymat = ' '.
        perform fill_ht_lst.
      else.
        perform fill_ht_lst1.
      endif.
    endform.
    form fill_ht_lst.
      refresh ht_lst.
    Example: how to discard unwanted data in an efficient way.
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
      read header line.
        read table ht_mkpf with table key mblnr = ht_mseg-mblnr
        mjahr = ht_mseg-mjahr.
        clear ht_lst.
    * note : this may be faster if you specify field by field.
        move-corresponding ht_mkpf to ht_lst.
        move-corresponding ht_mseg to ht_lst.
        perform read_lfa1 using ht_mseg-lifnr changing ht_lst-name1.
        perform read_material using ht_mseg-matnr changing ht_lst-maktx.
        insert table ht_lst.
      endloop.
    endform.
    form fill_ht_lst1.
    data: colorear.
      refresh ht_lst1.
    Example: how to discard unwanted data in an efficient way.
             hot to simulate a collect in a faster way
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
    * note : this may be faster if you specify field by field.
        read table ht_lst1 with table key matnr = ht_mseg-matnr
        transporting erfmg.
        if sy-subrc <> 0. " if matnr doesn't exist in sumary table
        " insert a new record
          clear ht_lst1.
          ht_lst1-matnr = ht_mseg-matnr.
          perform read_material using ht_mseg-matnr changing ht_lst1-maktx.
          ht_lst1-erfmg = ht_mseg-erfmg.
          ht_lst1-erfme = ht_mseg-erfme.
          if colorear = ''.
            colorear = 'X'.
            refresh it_color.
            ht_lst1-color_cell[] = it_color[].
            MOVE 'C410' TO ht_lst1-color_line.
          else.
            colorear = ' '.
            refresh it_color. clear it_color.
            MOVE 'MATNR' 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.
            MOVE 'MAKTX' TO wa_color-fname.
            MOVE '3'         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.
            MOVE 'ERFMG' TO wa_color-fname.
            MOVE '5'         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.
            ht_lst1-color_cell[] = it_color[].
            clear ht_lst1-color_line.
          endif.
          insert table ht_lst1.
        else." a record was found.
        " collect erfmg.  To do so, fill in the unique key and add
        " the numeric fields.
          ht_lst1-matnr = ht_mseg-matnr.
          add ht_mseg-erfmg to ht_lst1-erfmg.
          modify table ht_lst1 transporting erfmg.
        endif.
      endloop.
    endform.
    implementation of cache for lfa1.
    form read_lfa1 using p_lifnr changing p_name1.
            read table ht_lfa1 with table key lifnr = p_lifnr
            transporting name1.
      if sy-subrc <> 0.
        clear ht_lfa1.
        ht_lfa1-lifnr = p_lifnr.
        select single name1
           into ht_lfa1-name1
          from lfa1
        where lifnr = p_lifnr.
        if sy-subrc <> 0. ht_lfa1-name1 = 'n/a in lfa1'. endif.
        insert table ht_lfa1.
      endif.
      p_name1 = ht_lfa1-name1.
    endform.
    implementation of cache for material data
    form read_material using p_matnr changing p_maktx.
      read table ht_material with table key matnr = p_matnr
      transporting maktx.
      if sy-subrc <> 0.
        ht_material-matnr = p_matnr.
        select single maktx into  ht_material-maktx
          from makt
         where spras = sy-langu
           and matnr = p_matnr.
        if sy-subrc <> 0. ht_material-maktx = 'n/a in makt'. endif.
        insert table ht_material.
      endif.
      p_maktx = ht_material-maktx.
    endform.
    form show_data.
      if gp_hier = 'X'. "no anda.
       perform show_hierarchicalALV.
      else.
        if gp_bymat = ' '.
          perform show_ht_lst.
        else.
          perform show_ht_lst1.
        endif.
      endif.
    endform.
    form show_hierarchicalALV.
    st_mkpf[] = ht_mkpf[].
    st_mseg[] = ht_mseg[].
    call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    exporting
      I_INTERFACE_CHECK              = ' '
      I_CALLBACK_PROGRAM             =
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IS_LAYOUT                      =
      IT_FIELDCAT                    =
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
       i_tabname_header               =
       i_tabname_item                 =
      I_STRUCTURE_NAME_HEADER        =
      I_STRUCTURE_NAME_ITEM          =
       is_keyinfo                     =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_BUFFER_ACTIVE                =
      I_BYPASSING_BUFFER             =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      tables
        t_outtab_header                = st_mkpf
        t_outtab_item                  = st_mseg
    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.
    form show_ht_lst.
      "needed because the FM can't use a hashed table.
      it_lst[] = ht_lst[].
      perform fill_layout using 'full display'
                           changing ls_layout.
      perform fill_columns_lst.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form show_ht_lst1.
      "needed because the FM can't use a hashed table.
      it_lst1[] = ht_lst1[].
      perform fill_layout using 'Sumary by matnr'
                           changing ls_layout.
      perform fill_columns_lst1.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst1[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst1
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form fill_layout using p_window_titlebar
                   changing cs_layo type slis_layout_alv.
      clear cs_layo.
      cs_layo-window_titlebar        = p_window_titlebar.
      cs_layo-edit                   = 'X'.
      cs_layo-edit_mode              = space.
      MOVE 'COLOR_LINE' TO cs_layo-info_fieldname.
    Field that identify cell color in inetrnal table
      MOVE 'COLOR_CELL' TO cs_layo-coltab_fieldname.
    move 'CELLTAB' TO cs_layo-stylefname.
    endform.                    " armar_layout_stock
    form set_pf_status using rt_extab type slis_t_extab.
    create a new status
    and then select extras -> adjust template -> listviewer
      set pf-status 'VISTA'.
    endform.        "set_pf_status
    define add_lst.
      clear it_fieldcat_lst.
      it_fieldcat_lst-fieldname     = &1.
      it_fieldcat_lst-outputlen     = &2.
      it_fieldcat_lst-ddictxt       = 'L'.
      it_fieldcat_lst-seltext_l       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      if &1 = 'MATNR'.
        it_fieldcat_lst-emphasize = 'C111'.
      endif.
      append it_fieldcat_lst.
    end-of-definition.
    define add_lst1.
      clear it_fieldcat_lst.
      it_fieldcat_lst1-fieldname     = &1.
      it_fieldcat_lst1-outputlen     = &2.
      it_fieldcat_lst1-ddictxt       = 'L'.
      it_fieldcat_lst1-seltext_l       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      append it_fieldcat_lst1.
    end-of-definition.
    form fill_columns_lst.
    set columns for output.
      refresh it_fieldcat_lst.
      add_lst 'BUDAT' 10.
      add_lst   'MBLNR' 10.
      add_lst  'LIFNR' 10.
      add_lst  'NAME1' 35.
      add_lst  'XBLNR' 15.
      add_lst    'ZEILE' 5.
      add_lst    'CHARG' 10.
      add_lst   'MATNR' 18.
      add_lst   'MAKTX' 30.
      add_lst   'ERFMG' 17.
      add_lst   'ERFME' 5.
      add_lst   'MJAHR' 4.
    endform.
    form fill_columns_lst1.
    set columns for output.
      refresh it_fieldcat_lst1.
      add_lst1 'MATNR' 18.
      add_lst1 'MAKTX' 30.
      add_lst1 'ERFMG' 17.
      add_lst1 'ERFME' 5..
    endform.
    Horacio Zapettini
    Program to Calculate FI Opening Balance
    How to find the Opening balance for a given period in FI Module for a Particular GL A/c.
    I was calculated opening balance, code is below maybe it will be helpful.
    *find period.
      CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
        EXPORTING
          i_date         = s_budat-low
          i_periv        = i_tab-periv                          "'K4'
        IMPORTING
          e_buper        = v_donem
          e_gjahr        = v_gjahr
        EXCEPTIONS
          input_false    = 1
          t009_notfound  = 2
          t009b_notfound = 3
          OTHERS         = 4.
    *calc opening balance hesabý
      SELECT * FROM knc1 WHERE kunnr = i_tab-kunnr
                         AND bukrs = i_tab-bukrs " s_bukrs
                         AND gjahr EQ v_gjahr.
        v_dnm = v_donem.
    opening balance first calc > old year ,
        WHILE v_dnm > 1.
          v_dnm = v_dnm - 1.
          CONCATENATE 'knc1-um' v_dnm 's' INTO v_field_name_borc.
          CONCATENATE 'knc1-um' v_dnm 'h' INTO v_field_name_alacak.
          ASSIGN (v_field_name_borc) TO  old
    add days which is from selected date-low month
        IF v_donem > 1.
          v_dnm = v_donem - 1.
        ELSE.
          v_dnm = v_donem.
        ENDIF.
        SELECT SINGLE * FROM t009b WHERE periv = i_tab-periv    "'K4'
                                     AND bdatj = s_budat-low+0(4)
                                     AND poper = v_dnm.
        t009b-butag = t009b-butag + 1.
        IF s_budat-low+6(2) NE t009b-butag.
          v_date_high = s_budat-low - 1.
          IF v_donem = 1.
            v_date_low = s_budat-low.
            v_date_low+4(4)  = '0101'.
          ELSE.
            CONCATENATE t009b-bdatj t009b-bumon t009b-butag INTO
            v_date_low.
          ENDIF.
          SELECT *  FROM bsad WHERE bukrs EQ i_tab-bukrs "IN s_bukrs
                                AND kunnr = i_tab-kunnr
                                AND budat BETWEEN v_date_low AND
                                v_date_high
                                AND umskz = space
                                AND blart IN s_blart.
            IF bsad-shkzg = 'S'.
              i_tab-dmbtr_s = i_tab-dmbtr_s + ( bsad-dmbtr ).
            ELSEIF bsad-shkzg = 'H'.
              i_tab-dmbtr_h = i_tab-dmbtr_h + ( bsad-dmbtr   ).
            ENDIF.
          ENDSELECT.
          SELECT *  FROM bsid WHERE bukrs EQ i_tab-bukrs "IN s_bukrs
                               AND kunnr = i_tab-kunnr
                               AND budat BETWEEN v_date_low AND
                               v_date_high
                               AND umskz = space
                               AND blart IN s_blart.
                                 AND gsber IN gsber.
            IF bsid-shkzg = 'S'.
              i_tab-dmbtr_s = i_tab-dmbtr_s + ( bsid-dmbtr   ).
            ELSEIF bsid-shkzg = 'H'.
              i_tab-dmbtr_h = i_tab-dmbtr_h + ( bsid-dmbtr   ).
            ENDIF.
          ENDSELECT.
        ENDIF.
        "opening balance ( þirket bazlý )z1 degeri
       i_tab-z1 = i_tab-z1 + ( knc1-umsav + i_tab-dmbtr_s - i_tab-dmbtr_h ).
    for israel
        i_tab-dmbtril_s = i_tab-dmbtr_s .
        i_tab-dmbtril_h = i_tab-dmbtr_h .
      ENDSELECT.
    thanks
    mrutyun^

  • SAPSCRIPT: How change background color cell/table

    Hi!
    How can I change background color cell/table in Sapscript?
    Thanks very much!

    Hi ,
    Normally we use Scripts and smartforms for submitting the output to customers or for tax purpose  and so on,,in such case we wont submit in differnt color other than white and black,so formatting in other colors is not possible in Script and smartforms.
    Please let me know if have any issues on this.
    Thanks and regards,
    Rajeshwar

  • How to use filter to color cell content

    Numbers 3.5.2: I would like the content of a cell to change color, if the value of the number within the cell drops down below a certain value. For instance: as long as the values in the cell stay above 50 -> the number should be displayed black, if below 50 -> number should appear in red.
    This was possible in Numbers 09 using a simple filter as shown here:
    Did this filter disappear in actual Numbers? Is there any alternative?
    Thanks
    Ulrich

    What you are looking for isn't a "filter", its conditional text or conditional highlighting: http://help.apple.com/numbers/mac/3.5/#/tan93f5de5c3

  • Counting colored cells in numbers

    Hi,
    I would like to count only the cells in a row or  colum which have a specific color. Which formula should I use?
    thank you

    Smothin wrote:
    Hi Jerrold
    I just mark them. I could use a color, make them bold or whatever (manually), to make distinction between paid and unpaid.
    Greetings
    Smothin
    My suggestion would be to add a column for Date Paid. If a row has content in Date Paid, include it in the SUMIF spec.
    If Date Paid is in Column C, the expression for the conditional sum would be:
    =SUMIF(C, "", B)
    Jerry

  • Compare Previous Row in Same Group Color Cell?

    Is is possible to display multiple row/groups and compare each top and bottom row/cell within the same group and color the bottom row/cell on content mismatch?
    [header title]
    Row 1a cell 15
    Row 1b cell 15  //compare to 1a
    Row 2a cell 15
    Row 2b cell 15. //compare to 2a

    Hi pointeman,
    According to your description, when compare the row and the previous row in the same group, you want to color the later cell if the values are mismatch. After testing the issue in my local environment, we can click the detail cell to open the Property Windows,
    then use the following expression to control the BackgroundColor property:
    =iif(Fields!A.Value=previous(Fields!A.Value) and Fields!B.Value=Previous(Fields!B.Value),"Red","White")
    Note that the field A stands for the group field, the field B stands for the field that you want to compare.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Need Infor coloring cells in ALV

    H all,
    I am working  ALV in webdynpro. I got two requirements.
    1)  I need to change the color for the cell Level based on the data.
    with different colors
    2)  I want to color the entire row based on the condition
    pl help to proceed
    Thanks in advance
    Kar

    Hello,
    Please see this: [https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap%2bweb%2bdynpro%2balv%2b-%2bchange%2bcell%2bcolour%2bbased%2bon%2bcontent].
    Regards.

  • ALV: Color cells in subtotals. Is it possible?

    Hi,
    I have an ALV-report which initially shows subtotals only. The users want to see specific colors in specific cells of the subtotals if possible.
    Is it?
    Regards
    Thomas

    Hi Thomas,
    Please check the Demo program ERGP2120.
    It has this feature.
    Step1: define you internal table like below
    DATA: BEGIN OF mylist OCCURS 20,       " Internal table for preparing
            zuordnung(8) TYPE c,
            belegnr(10) TYPE c,
            ba(2) TYPE c,
            bldatum TYPE d,
            bs(2) TYPE c,
            s(4) TYPE c VALUE ' ',
            wrg(4) TYPE c,
            betrag TYPE p DECIMALS 2,
            colinfo TYPE slis_t_specialcol_alv,
          END OF mylist.
    Step2:
      LOOP AT lt_mylist.
        REFRESH gt_color.
        CLEAR   gt_color.
        IF lt_mylist-betrag  > 500000.
          CLEAR gt_color.
          gt_color-fieldname = 'BETRAG'.
          gt_color-color-col = cl_gui_resources=>list_col_positive.
          gt_color-color-int = 0.
          APPEND gt_color.
        ELSEIF lt_mylist-betrag < 100000.
          CLEAR gt_color.
          gt_color-fieldname = 'BETRAG'.
          gt_color-color-col =  cl_gui_resources=>list_col_negative.
          gt_color-color-int = 0.
          APPEND gt_color.
        ENDIF.
        lt_mylist-colinfo[] = gt_color[].
        MODIFY lt_mylist.
      ENDLOOP.
    Thanks,
    Ramakrishna
    Message was edited by: Ramakrishna Prasad

  • Color Cell In a templete dynamically in Smart Forms

    Hi ,
    I am working on a requirement in smart forms and im not knowing how to fill color in a cell that changes dynamically with respect to the condition with in a template.
    My Problem is this the color of the cell should change with the condition triggered. Please help.
    Thankyou,
    Swetha

    Hi,
    1.Template is Static,we cann't set the color dynamically for this cell.
    Check:
    http://help.sap.com/saphelp_nw04/helpdata/en/b9/722de52f1711d5b695006094192fe3/content.htm
    Regards,
    Shiva kumar

  • Diadem how to color cells individually

    Hello,
    How do I separately control the background color of a given cell of a table using a script for a 2Dtable in the report?
    I am able to color only the whole line...
    Thank you very much,
    Best regards,
    Louval

    I am really sorry but I cannot make it work.
    WHat should I do.
    1. I copy the function in UserCmdReport.vbs
    2. I produce my table
    3. I change the format of the channel I want to color adding the function in the format : @@TabColorCol(CFV)@@
    4. nothing happen or rather, the cell are fill up with "@@TabColorCol(CFV)@@"
    To be honest I do not understand the input of the function TabColorCol(CFV)...
    Thank you,
    Best regards,
    Louval
    Attachments:
    test.PNG ‏12 KB
    test2.PNG ‏244 KB

Maybe you are looking for

  • How do I add a Gmail account to my Mail program

    Hi Until now, I have only had @verizon.net email accounts. I now how a @gmail.com email account I don't know how to configure my Mail program so I can receive gmail to my computer, and not have to get it using a Browser. I have attended to configure,

  • How to use the transformation matrix in Placed Suite.

    I am in trouble how to use the transformation matrix Placed Art (PlacedSuite ).         AIRealMatrix rasterMatrix; AIRealMatrix placedMatrix; if (artType == kRasterArt {      error = sAIRaster-> GetRasterMatrix (art, & rasterMatrix); } else if ((artT

  • LCD monitor and AirPort

    my new LCD monitor seems to interfere wit airport. How can avoid such interferation in order to employ the monitor with mac mini?

  • ITunes 11.1.5 crashing on launch?!

    So I updated my Windows 7 laptop to iTunes 11.1.5 but it keeps crashing on launch for about 7 or 8 hours now and I give up, I've tried absolutely everything! I followed all the threads I could find, including trying iTunes on safe mode (that worked f

  • Is DFS Initial Sync actually getting anywhere?

    Hi, The other day i had to recreate our DFS name space and replication.  One of the servers is running an initial sync and has been for around a week and a half.  How long is this supposed to take?  Its 2tb over a 10mbps leased line so not that fast,