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^

Similar Messages

  • 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.

  • How to give color of particular cell in alv list display for dynamic table

    Dear Experts,
    i want to give color of a particular cell in alv list display (reuse_alv_list_display). Here i am passing data through dynamic table?

    Hi,
    Se this:
    DATA: lt_color    TYPE lvc_t_scol WITH HEADER LINE.
    DATA: BEGIN OF data_tab OCCURS 0.
             tabcolor     TYPE   lvc_t_scol,
          END OF data_tab.
    * Befone ALV call
      alv_layout-coltab_fieldname  = 'TABCOLOR'.
    * For each row in data_tab
    REFRESH: lt_color.
    CLEAR: lt_color.
    lt_color-color-col = 6.
    lt_color-color-int = 1.
    lt_color-fname = FIELD1'.
    APPEND lt_color.
    lt_color-color-col = 2.
    lt_color-color-int = 0.
    lt_color-fname = 'FIELD2'.
    APPEND lt_color.
    data_tab-tabcolor[] = lt_color[].
    append data_tab.
    Best regards,
    Leandro Mengue

  • 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.

  • Cell Color Yellow in ALV

    Hi Team,
    I have a scenario where the ALV table cells are colored based on certain rules. I have successfully achieved this by using the ALV Cell Design. I have a problem specifically with the Cell Design Code = "18", Cell Design Value = " TWO". This color is a pure yellow and when used, it forcefully aligns the cell values to LEFT and the font size is reduced. We specifically need this color in our application. Anyone faced this problem?
    Is this a bug in the Cell Design option for code "18"? Is there any other way I can get this color in the ALV cell?
    Please help. Any pointers will be appreciated.
    Thanks for your time.
    Best Regards
    Sanjay

    Hi Team,
    Any thoughts on this issue? Is this a standard bug or there is another way to achieve the same functionality? I tried using cell variants also, but the "Text View" and "Input Field" don't have a background color attribute for them.
    Any pointers?
    Thanks
    Sanjay

  • "Custom" grouping and / or colored lines in ALV

    Hi!
    Two questions:
    1. Is it possible to use colors in the ALV for a given set of rows? I'd like to mark rows with a color, which are logically belongs together.
    2. Other approach would be to sort the ALV and via that the "similar" rows (i.e. some column values in the rows have the same value ) would be grouped.
    The normal ALV grouping feature is too general. E.g if the ALV contains a lot of empty cells, then those cells will be grouped as well, nevertheless they are logically don't belong together -> looks quite weird.
    If the custom grouping cannot be realized, then my approach would be the following:
    1. Sorting the table. -> rows where the content partially equal are in succession.
    2. Manually clear the cells in the second (in my business case only two lines can be partially equal, others are unique) row, which are the same as in the previous row.
    3. Use coloring to indicate that these two lines are belonging together.
    Best regards,
    Peter

    Hi Peter,
    It is possible to assign colors to a specific row. But you need to have some work around.
    You have to create an extra attribute for each column that you have in your table. The type of that attribute should be of WDUI_TABLE_CELL_DESIGN.
    After Instatiating your ALV Component you have to use the following statement for the column that you have to apply the color.
    ls_column-r_column->set_cell_design_fieldname( COLUMN1_DESIGN ). Assuming ls_column-r_column will have COLUMN1 as filed name.
    There are 16 colors that are defined and each combination from '00' to '15' will define one color.
    Look at the structure below.  Its a table with 4 columns(2nd and 4th represents colors for first and third columns)
    value11          00            value12          00
    value21          00            value22          00
    value31          02            value32          02.
    If you consider the above struture as your output table 3 rows and 4 columns  then your third row will be highlighted in green color because 02 represents green. You can hide your second column and fourth column in above example because they represents colors. Use the following statement to hide those columns.
    ls_column-r_column->set_visible(
                     cl_wd_uielement=>e_visible-none ). "ls_column-r_column will have 'COLUMN1_DESIGN'
    Let me know if you know more code.
    Thank You,
    Gajendra.

  • 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

  • How to change the selected row color in an alv grid display ?

    Hello ,
    I WANT TO CHANGE THE COLOR OF THE SELECTED RECORDS  IN AN ALV GRID DISPLAY ?
    ITS URGENT..
    WILL BE REWARDED...

    hai   Ssnagh Samala 
    EXicut This report >
    Hope It Will  Meet U r Requirement.
    If Found Helpfull Reward.
    REPORT zcuitest_alv_07.
    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.
    START-OF-SELECTION.
    PERFORM get_data.
    END-OF-SELECTION.
    PERFORM fill_catalog.
    PERFORM fill_layout.
    CALL SCREEN 2000.
    *& Module status_2000 OUTPUT
    text
    MODULE status_2000 OUTPUT.
    SET PF-STATUS '2000'.
    ENDMODULE. " status_2000 OUTPUT
    *& Module user_command_2000 INPUT
    text
    MODULE user_command_2000 INPUT.
    DATA : w_okcode LIKE sy-ucomm.
    MOVE okcode TO w_okcode.
    CLEAR okcode.
    CASE w_okcode.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " user_command_2000 INPUT
    *& Module alv_grid OUTPUT
    text
    MODULE alv_grid OUTPUT.
    IF w_docking_container IS INITIAL.
    PERFORM create_objects.
    PERFORM display_alv_grid.
    ENDIF.
    ENDMODULE. " alv_grid OUTPUT
    *& Form create_objects
    text
    --> p1 text
    <-- p2 text
    FORM create_objects.
    Ratio must be included in http://5..95
    CREATE OBJECT w_docking_container
    EXPORTING
    ratio = 95
    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.
    ENDFORM. " create_objects
    *& Form display_alv_grid
    text
    --> p1 text
    <-- p2 text
    FORM display_alv_grid.
    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. " display_alv_grid
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    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 '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.
    wa_mara-color_cell] = it_color[.
    ENDIF.
    APPEND wa_mara TO it_mara.
    ENDSELECT.
    ENDFORM. " get_data
    *& Form fill_catalog
    text
    --> p1 text
    <-- p2 text
    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. " fill_catalog
    *& Form fill_layout
    text
    --> p1 text
    <-- p2 text
    FORM fill_layout.
    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.
    ENDFORM. " fill_layout
    Regards.
    Eshwar.

  • Changing colour based on cells for ALV in Web Dynpro ABAP

    Hi,
    I have a requirement where I need to change the font color for some cells of ALV in Web Dynpro ABAP. I am able to change the font color for whole row or whole column but need to know how to change it based on cells.
    My output should be something like the picture attached to this discussion. The coloumns/cells where I need the font colour can change for different rows, based on some internal condition.
    Please let me know how to achieve this...... Thank you.
    - Divya Posanpally

    Hi Divya,
    Your requirement can be achieved as below
    Create an attribute for each column of alv i.e. COLOR_F1, COLOR_F2, COLOR_F3...... COLOR_F10 of type WDY_UIE_LIBRARY_ENUM_TYPE in the context node which holds the color value
    Now while configuring ALV, set the field name of semantic color for each column as below
                   data lv_color_fld_name type string.
                   data lo_text_view type ref to cl_salv_wd_uie_text_view.
              loop at lt_columns into ls_column.
              concatenate 'COLOR'  ls_column-id into lv_color_fld_name separated by '_'.
              lo_text_view ?=  ls_column-r_column->get_cell_editor( ).    
              if lo_text_view is bound.
              lo_text_view->SET_SEMANTIC_COLOR_FIELDNAME( value = lv_color_fld_name ).
              endif.
              endloop.
    Set the color based on the condition
             loop at lt_data into ls_data.
                        if ..... "your condition here.
                        ls_data-color_f1 = cl_wd_text_view=>e_semantic_color-NEGATIVE.
                        ls_data-color_f2 = cl_wd_text_view=>e_semantic_color-POSITIVE.
                        elseif...... " another condition
                        endif.
              endloop.
    Note: You can optimize the code as per your requirement
    Hope this helps you.
    Regards,
    Rama

  • How to colour a cell in alv's

    hi experts ,
    any one tell me how to colour a cell in alve. give me some sample code.
    reward points.......

    Hi
    Fareeda
    this is w2ht the code example u asked
    if u found it helpfull plzz reward
    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Plzzz dont forget to reward

  • Wht r color codes in ALV rep for EMPHASIZE, like C500?

    Hi Experts,
    Am looking to color the column in ALV report......so, am using EMPHASIZE in filed catalg, am using C 500.......working fine.
    So, pls. let me know, What r the other colors & their #, like C500?
    thanq

    You can find answer in next link:
    Coloring Cells/rows in ALV Grid.
    Best regards.

  • Color line in alv

    Please find details below ..
    This code in if statement do what I want (coloured cell )how can I colour my line .
    data definitions.
    DATA: BEGIN OF ztab OCCURS 0.
            INCLUDE STRUCTURE zskar_anz.
    DATA :  line_color TYPE shp_slis_t_specialcol_alv ,
            cell_color TYPE shp_slis_t_specialcol_alv .
    DATA: END OF ztab .
    IF ztab-stskz < 0 .
        ls_cell_color-fieldname = 'STSKZ'.
        ls_cell_color-color-col =  6.      "k&#305;rm&#305;z&#305;
        ls_cell_color-color-int =  0.
        APPEND ls_cell_color TO ztab-cell_color[].
        MODIFY ztab TRANSPORTING cell_color.
      ENDIF.

    Hi,
    See this code:
    Here is a sample program which illistrates the coloring in ALV grid.
    report zalv_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.
    I hope it helps u.
    Regards,
    Kumar

  • Double click on cell in alv report

    Hi all,
    I want to show detail popup on cell of alv report. how to get the cell value.
    plz tell me the logic for getting cell value.
    thanks in advance.

    Hi,
    IF RS_SELFIELD-FIELDNAME = 'EBELN1'.
    * Read data table, using index of row user clicked on
    READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
    Please remember the field EBELN1 should be in IT_EKKO. after the read statement you can move which ever field you want to another for further processing
    like
    READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
    if sy-subrc eq 0.
      move it_ekkp-( your field name) to v_field
    endif.

  • How to make cell editable alv in WebDynpro for ABAP?

    I make Column editable ALV.(See under source code)
    But I can't make Cell editable ALV.
    How to make Cell editable ALV in WebDynpro for ABAP?
    and..how to get changed data?
    DATA: l_value TYPE REF TO cl_salv_wd_config_table.
      l_value = l_ref_interfacecontroller->get_model( ).
    * { EDITABLE
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_input_field     TYPE REF TO cl_salv_wd_uie_input_field,
            lr_column          TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= l_value.
      lr_column = lr_column_settings->get_column( 'TOTAL_COUNT' ).
      CREATE OBJECT lr_input_field
        EXPORTING
          value_fieldname = 'TOTAL_COUNT'.
      lr_column->set_cell_editor( lr_input_field ).
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= l_value.
      lr_table_settings->set_read_only( abap_false ).

    the code seems to be correct....but where are you writing it?
    put the code in the wddoinit method and it should work.
    have a look at this article..
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1

  • 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

Maybe you are looking for

  • HT1420 How can I deauthorize a computer that is not hooked up

    I am new to Mac's. While I do have iphone and iPad I am trying to learn to navigate this Computer and having trouble hooking up my iTunes. It says I have to deactivate one computer but the only one I would like to deactivate is the olod one which is

  • Broadcast quality output

    I've just spent hours chroma keying and I want to be sure of the quality of my output. As this is going to television, it needs to be broadcast quality. I'm I correct in assuming that I should output it as a quicktime movie and not use quicktime conv

  • Having difficulty finding my photos to upload from iPhoto to blogger

    Hello-  I recently got a Mac and I am having a hard time uploading photos from iphoto to blogger.  When I select "upload photos" on blogger then select iphoto library, there is no subfolder with all of my photos.  The only thing there is the iphoto i

  • Re: Speed & Websites not found

    I have the exact same issue and have to restart the routers and modem daily to make sure all sites work.  It's very annoying and has only started happening since getting Infinity broadband a month ago.  I never had any problems with normal ADSL but t

  • Accounting item text problems when MIRO

    Dear all:          In the MIRO transaction,  after posted the item text will be generated to FI doc. item text?          Item text of MIRO basic data will be generated to fi doc. item text when after miro.          But I not sure the item text will b