Skip to Content
0
Former Member
Oct 28, 2010 at 06:49 AM

Color Cell in Dynamic ALV

969 Views

Hi all

i try to put color in the dynamic alv, but i become a dump message

Runtime Errors         OBJECTS_MOVE_NOT_SUPPORTED
Date and Time          28.10.2010 08:46:49

 Short text
     Conversion of type "h" to type "g" not supported.

 What happened?
     Error in the ABAP Application Program

     The current ABAP program "SAPLSLVC" had to be terminated because it has
     come across a statement that unfortunately cannot be executed.

 Error analysis
     You attempted to move one data object to another.
     This is not possible here because the conversion of a data object
     of type "h" to type "g" is not supported.

my code implementation looks like

  method validate_order_deli.

    data ls_scol        type lvc_s_scol.
    data ls_colo        type lvc_s_colo.
    data ls_aoc_percent type zsd_aoc_percent.
    data lf_deliv       type lifmg.
    data lf_db_percent  type f.
    data lf_calc_perc   type f.

    refresh et_color.
    select single *
      from zsd_aoc_percent
      into corresponding fields of ls_aoc_percent
      where acin = 'X'.
    if sy-subrc <> 0.
      exit.
    endif.
    lf_db_percent = ls_aoc_percent-percent.
*    ls_scol-fname = if_fieldname.
    ls_scol-fname = 'MATNR'.
    if if_deliv <> 0.
      me->calc_amour_unit(
        exporting
          if_matnr  = if_matnr
          if_amount = if_deliv
          if_input  = if_deliv_unit
          if_output = if_order_unit
        importing
          ef_amount = lf_deliv
          ).
      lf_calc_perc = ( lf_deliv * 100 ) / if_order.
      if lf_calc_perc < lf_db_percent.
        ls_colo-col = cl_gui_resources=>list_col_positive.
      else.
        ls_colo-col = cl_gui_resources=>list_col_negative.
      endif.

      ls_scol-color = ls_colo.
      append ls_scol to et_color.
    else.
      exit.
    endif.

  endmethod.                    "validate_order_deli

  method add_color_field.

    data ls_fcat type lvc_s_fcat.

    ls_fcat-fieldname = 'COLOR'.
    ls_fcat-ref_field = 'COLTAB'.
    ls_fcat-ref_table = 'CALENDAR_TYPE'.
    append ls_fcat to ct_fcat.

  endmethod.                    "add_color_field

      ls_lvc_s_layo-cwidth_opt = 'X'.
      ls_lvc_s_layo-ctab_fname  = 'COLOR'.

i don't no, what's wrong...

thx for help