Color for negative Values in ALV Report

I want to change the color for negative values displayed in ALV list diplay report. Eg. -5 in Quantity should be changed to orange. Kindly help me
Thanks

Check the below program and bold one are important ( which is similar to MD05 Traffic lights )
REPORT ZWM_BIN_STOCK_REQ no standard page heading
                    message-id zwave.
D A T A   D E C L A R A T I O N ****************************
Tables
tables :zpwvbap,
         mara,
         marc,
         makt,
         vbap,
         zshift,
         marm,
         lqua.
TYPE-POOLS: SLIS.
Internal Table for Sales order
data : begin of i_vbap occurs 0,
       matnr like zpwvbap-matnr," Material #
       ZZCUTOFF like zpwvbak-ZZCUTOFF," Cutoff Time
       vlpla like zpwvbap-vlpla,
       kwmeng like zpwvbap-kwmeng," Quantity
       vrkme  like zpwvbap-vrkme, " Sales Unit
       meins like zpwvbap-meins, " Unit of measure
       end of i_vbap.
Internal Table for final Processing
data : begin of i_final occurs 0,
       date(8) type c,
       matnr like zpwvbap-matnr," Material #
       zzshift like zshift-zzshift, " Wave Drop
       maktx like makt-maktx," Desc
       lgpla like lagp-lgpla, " Pick Bin
       pverme like lqua-verme," Stock at Pick Bin
       prverme like lqua-verme," Stock at Prod Bin
       kwmeng like zpwvbap-kwmeng," Requiremnet from Wave Drop
       vrkme  like zpwvbap-vrkme, " Sales Unit
      meins like zpwvbap-meins," Unit of measure
       end of i_final.
Internal Table for Output
data : begin of i_output occurs 0,
     <b>  field type c, " Traffic Lights</b>     
      zzshift like zshift-zzshift, " Wave Drop
       matnr like zpwvbap-matnr," Material #
       maktx like makt-maktx," Desc
       lgpla like lagp-lgpla, " Pick Bin
       pverme like lqua-verme," Stock at Pick Bin
       prverme like lqua-verme," Stock at Prod Bin
       kwmeng like zpwvbap-kwmeng," Requiremnet from Wave Drop
       vrkme like zpwvbap-vrkme," Sales Unit
      meins like zpwvbap-meins," Unit of measure
       diff like zpwvbap-kwmeng, " Diffrence
       end of i_output.
Work Area for Final Internal Table
data wa_final like i_final.
data :  w_zzcutoff(12) TYPE c,
        v_date type sy-datum,
        v_time(4) type c,
        v_fldate(12) type c,
        v_fhdate(12) type c,
        v_pverme like lqua-verme,
        v_prverme like lqua-verme,
        v_diff like zpwvbap-kwmeng.
Variables for new check box
data : v_nverme like lqua-verme.
Internal Table for Pick Bin
data : begin of i_verme occurs 0,
       verme like lqua-verme,
       end of i_verme.
Internal table for Prod Bin
data : begin of i_pverme occurs 0,
       verme like lqua-verme,
       end of i_pverme.
Variables for ALV
DATA: FIELDCAT           TYPE SLIS_T_FIELDCAT_ALV,
      FIELDCAT_LN        LIKE LINE OF FIELDCAT,
      SORTCAT            TYPE SLIS_T_SORTINFO_ALV,
      SORTCAT_LN         LIKE LINE OF SORTCAT,
      EVENTCAT           TYPE SLIS_T_EVENT,
      EVENTCAT_LN        LIKE LINE OF EVENTCAT,
      LAYOUT             TYPE SLIS_LAYOUT_ALV,
      C_TOP_OF_PAGE      TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
      g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
      GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: COL_POS TYPE I,
      P_LIGNAM TYPE SLIS_FIELDNAME VALUE  'FIELD'.
DATA : V_REPID LIKE SY-REPID,
       flag type c.
S E L E C T I O N - S C R E E N *************************
selection-screen : begin of block blk with frame title text-001.
parameter : p_plant like marc-werks obligatory default '1000'.
select-options : s_date for sy-datum obligatory ,
                 s_shift for zshift-zzshift,
                 s_matnr for mara-matnr,
                 s_dept for zpwvbap-zzdept,
                 s_pdept for marc-ZZPRODDEPT.
selection-screen: end of block blk.
parameters : p_check as checkbox ."default 'X'.
ranges r_cutoff for  w_zzcutoff.
I N I T I A L I Z A T I O N ****************************
initialization.
  V_REPID = SY-REPID.
  s_date-low = sy-datum + 1.
  append s_date.
S T A R T - O F - S E L E C T I O N  ***********************
start-of-selection.
Get the Shift Data.
  PERFORM GET_SHIFT_DETAILS.
Get the data from ZPWVBAP Table
  PERFORM GET_DATA_VBAP.
E N D - O F - S E L E C T I O N **********************
end-of-selection.
  if not i_output[] is initial.
    sort i_output by field zzshift matnr.
Reset the all Fiedcatlog.
    PERFORM RESETVALUES.
Traffic Lights
    PERFORM BUILD_LAYOUT.
Fill the fieldcatlog values
    PERFORM FILL_FIELDCATLOG.
Call the List Function module
    PERFORM CALL_lIST.
  endif.
*&      Form  GET_SHIFT_DETAILS
      Get the Cutoff Time.
FORM GET_SHIFT_DETAILS.
  clear : v_fldate,
          v_fhdate.
  if not s_shift-low is initial.
    clear: v_time,
           v_date.
    if s_shift-low = '1'.
      v_time = '2000'.
    elseif s_shift-low = '2'.
      v_time = '2300'.
    endif.
    v_date = s_date-low - 1.
    concatenate v_date v_time into v_fldate.
  endif.
  if not s_shift-high is initial.
    clear : v_date,
            v_time.
    if s_shift-high = '1'.
      v_time = '2000'.
    elseif s_shift-high = '2'.
      v_time = '2300'.
    endif.
    if not s_date-high is initial.
      v_date = s_date-high - 1.
    else.
      v_date = s_date-low - 1.
    endif.
    concatenate v_date v_time into v_fhdate.
  endif.
  if not v_fhdate is initial.
    r_cutoff-low = v_fldate.
    r_cutoff-high = v_fhdate.
    r_cutoff-sign = 'I'.
    r_cutoff-option = 'BT'.
    append r_cutoff.
  endif.
ENDFORM.                    " GET_SHIFT_DETAILS
*&      Form  GET_DATA_VBAP
      Get the data from ZPWVBAP Table
FORM GET_DATA_VBAP.
Get the data from ZPWVBAP and ZPWVBAK Table
  if not v_fhdate is initial.
    select matnr ZZCUTOFF  vlpla sum( kwmeng ) vrkme meins
                 into table i_vbap
                 from zpwvbap as a inner join zpwvbak as b on
                               a~vbeln = b~vbeln
                               where a~werks = p_plant
                               and   a~matnr in s_matnr
                               and b~vdatu in s_date
                               and a~zzdept in s_dept
                               and b~zzcutoff in r_cutoff
                              group by matnr zzcutoff vlpla vrkme meins.
  elseif not v_fldate is initial.
    select matnr ZZCUTOFF vlpla sum( kwmeng ) vrkme meins
                       into table i_vbap
                       from zpwvbap as a inner join zpwvbak as b on
                               a~vbeln = b~vbeln
                               where a~werks = p_plant
                               and   a~matnr in s_matnr
                               and b~vdatu in s_date
                               and a~zzdept in s_dept
                               and b~zzcutoff = v_fldate
                           group by matnr zzcutoff vlpla vrkme meins.
  else.
    select matnr ZZCUTOFF vlpla sum( kwmeng ) vrkme meins
                          into table i_vbap
       from zpwvbap as a inner join zpwvbak as b on
                               a~vbeln = b~vbeln
                               where a~werks = p_plant
                               and   a~matnr in s_matnr
                               and b~vdatu in s_date
                               and a~zzdept in s_dept
                               and b~zzcutoff in r_cutoff
                            group by matnr zzcutoff vlpla vrkme meins .
  endif.
  if sy-subrc ne 0.
    message i000(zwave) with 'No data found for given selection'.
    stop.
  endif.
  sort i_vbap by zzcutoff matnr.
  loop at i_vbap.
    clear : v_pverme,
            v_prverme.
Compare the data with pick method
    select single zzpick from marc into marc-zzpick
                         where matnr = i_vbap-matnr
                         and   werks = p_plant
                         and   zzpick = '01'.
    if sy-subrc ne 0.
      continue.
    endif.
Compare the data from MARC Table with Production Department
    select single zzPRODdept from marc into marc-zzPRODdept
                         where matnr = i_vbap-matnr
                         and werks = p_plant
                         and  zzPRODdept in s_pdept.
    if sy-subrc ne 0.
      continue.
    endif.
Get the Material Description from MAKT Table
    Select single maktx from makt into makt-maktx
                        where matnr = i_vbap-matnr
                        and   spras = 'E'.
    if sy-subrc eq 0.
      i_final-maktx = makt-maktx.
    endif.
Get the Pick Bin
    i_final-lgpla = i_vbap-vlpla.
    refresh i_verme.
    clear i_verme.
Get the stock at Pick bin
    select verme  from lqua into table i_verme
                        where lgpla = i_vbap-vlpla
                        and   matnr = i_vbap-matnr
                        and   LGNUM = '100'.
    if sy-subrc eq 0.
      loop at i_verme.
        v_pverme = v_pverme + i_verme-verme.
      endloop.
      if sy-subrc eq 0.
        i_final-pverme = v_pverme.
      endif.
    endif.
    refresh i_pverme.
    clear i_pverme.
Get the stock at Production bin
    select  verme from lqua into table i_pverme
                       where matnr = i_vbap-matnr
                       and   LGNUM = '100'
                   and ( lgpla = '9595959595' or
                         lgpla = '2222222222' or
                         lgpla = '5555555555' or
                         lgpla = '3232323232' or
                         lgpla = '8080808080' or
                         lgpla = '4040404040' or
                         lgpla = '9090909090' ).
    if sy-subrc eq 0.
      loop at i_pverme.
        v_prverme = v_prverme + i_pverme-verme.
      endloop.
      if sy-subrc eq 0.
        i_final-prverme = v_prverme.
      endif.
    endif.
Compare the unit of measure and sales unit
    if i_vbap-vrkme ne i_vbap-meins.
Get the data from MARM Table ( Unit of measure )
      select single * from marm into marm
                           where matnr = i_vbap-matnr
                           and   meinh = i_vbap-vrkme.
      if sy-subrc eq 0.
        i_final-pverme = ( i_final-pverme * marm-umren ) / marm-umrez.
      endif.
    endif.
Material #
    i_final-matnr = i_vbap-matnr.
Quantity from ZPWVBAP
    i_final-kwmeng = i_vbap-kwmeng.
Unit of Measure
   i_final-meins = i_vbap-meins.
Sales Unit
    i_final-vrkme = i_vbap-vrkme.
Wave Drop
    if i_vbap-ZZCUTOFF+8(4) = '2000' .
      i_final-zzshift = '1'.
    endif.
    if i_vbap-zzcutoff+8(4) = '2300'.
      i_final-zzshift = '2'.
    endif.
    i_final-date = i_vbap-zzcutoff+0(8).
    append i_final.
    clear : i_final,
            i_vbap.
**Difference
   i_output-diff = i_output-pverme - i_vbap-kwmeng.
Traffic Lights Depends on value
   if i_output-pverme > i_output-kwmeng.
     i_output-field = '3'.
   elseif i_output-pverme < i_output-kwmeng.
     i_output-field = '1'.
   elseif i_output-pverme = i_output-kwmeng.
     i_output-field = '2'.
   endif.
   append i_output.
   clear : i_output,
           i_vbap.
  endloop.
  refresh i_vbap.
  sort i_final by date matnr zzshift.
Processing the internal table to get same material with pick quantity
deduction even it for 2nd shift
  loop at i_final.
Move the data into work area in order remove #
    move i_final to wa_final.
    clear : flag.
    at new matnr.
      move : wa_final-matnr to i_output-matnr," Material #
             wa_final-maktx to i_output-maktx," Desc
             wa_final-lgpla to i_output-lgpla," Pick Bin
             wa_final-kwmeng to i_output-kwmeng," Order qty
             wa_final-zzshift to i_output-zzshift," Shift
             wa_final-pverme to i_output-pverme, " Pick bin qty
             wa_final-vrkme  to i_output-vrkme," Sales Unit
             wa_final-prverme to i_output-prverme. " Prod Bin Qty
Difference
      i_output-diff = i_output-pverme - i_output-kwmeng.
New logic for Only HMR Department
    <b>  if p_check = 'X'.
        if i_output-pverme < i_output-kwmeng.
          v_nverme = i_output-pverme + i_output-prverme.
          if v_nverme > i_output-kwmeng.
           if i_output-pverme < i_output-kwmeng.
           i_output-field = '2'.
            else.
Traffic Lights Depends on value
            i_output-field = '3'.
            endif.
          elseif v_nverme < i_output-kwmeng.
            i_output-field = '1'.
          elseif v_nverme = i_output-kwmeng.
            i_output-field = '2'.
          endif.
        elseif i_output-pverme > i_output-kwmeng.
          i_output-field = '3'.
        elseif i_output-pverme = i_output-kwmeng.
          i_output-field = '3'.
        endif.
      else.
Traffic Lights Depends on value
        if i_output-pverme > i_output-kwmeng.
          i_output-field = '3'.
        elseif i_output-pverme < i_output-kwmeng.
          i_output-field = '1'.
        elseif i_output-pverme = i_output-kwmeng.
          i_output-field = '2'.
        endif.
      endif.
      move i_output-diff to v_diff.
      flag = 'X'.
    endat.</b>
    if flag ne 'X'.
      move : wa_final-matnr to i_output-matnr," Material #
             wa_final-maktx to i_output-maktx," Desc
             wa_final-lgpla to i_output-lgpla," Pick Bin
             wa_final-kwmeng to i_output-kwmeng," Order qty
             wa_final-zzshift to i_output-zzshift," Shift
             wa_final-vrkme  to i_output-vrkme," Sales Unit
             wa_final-prverme to i_output-prverme. " Prod Bin Qty
  Move Diffrence value
      move v_diff to i_output-pverme.
      clear: v_diff.
New logic for Only HMR Department
New logic for Only HMR Department
      if p_check = 'X'.
        if i_output-pverme < i_output-kwmeng.
          v_nverme = i_output-pverme + i_output-prverme.
          if v_nverme > i_output-kwmeng.
          if i_output-pverme < i_output-kwmeng.
           i_output-field = '2'.
            else.
Traffic Lights Depends on value
            i_output-field = '3'.
            endif.
Traffic Lights Depends on value
           i_output-field = '3'.
          elseif v_nverme < i_output-kwmeng.
            i_output-field = '1'.
          elseif v_nverme = i_output-kwmeng.
            i_output-field = '2'.
          endif.
        elseif i_output-pverme > i_output-kwmeng.
          i_output-field = '3'.
        elseif i_output-pverme = i_output-kwmeng.
          i_output-field = '3'.
        endif.
i_output-diff = i_output-pverme - i_output-kwmeng.
      else.
Difference
        i_output-diff = i_output-pverme - i_output-kwmeng.
Traffic Lights Depends on value
        if i_output-pverme > i_output-kwmeng.
          i_output-field = '3'.
        elseif i_output-pverme < i_output-kwmeng.
          i_output-field = '1'.
        elseif i_output-pverme = i_output-kwmeng.
          i_output-field = '2'.
        endif.
      endif.
    endif.
    append i_output.
    clear : i_output,
            wa_final,
            i_final,
             v_nverme.
  endloop.
  sort i_output by field zzshift matnr.
ENDFORM.                    " GET_DATA_VBAP
*&      Form  RESETVALUES
      Reset the all fieldcatlogs
FORM RESETVALUES.
  FIELDCAT_LN-KEY = SPACE.
  FIELDCAT_LN-DO_SUM = SPACE.
  FIELDCAT_LN-NO_OUT = SPACE.
  FIELDCAT_LN-QFIELDNAME = SPACE.
  FIELDCAT_LN-HOTSPOT = SPACE.
  FIELDCAT_LN-OUTPUTLEN = '0'.
  CLEAR: fieldcat_ln-seltext_l, fieldcat_ln-seltext_m,
         fieldcat_ln-seltext_s, fieldcat_ln-reptext_ddic.
ENDFORM.                    " RESETVALUES
*&      Form  FILL_FIELDCATLOG
      Fill the Fieldcatlog values
FORM FILL_FIELDCATLOG.
  DATA: ls_fieldcat TYPE slis_fieldcat_alv.
Trafiic Light
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'FIELD'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 7.
  LS_FIELDCAT-col_pos    = '1'.
  ls_fieldcat-seltext_L = 'Lights'.
  ls_fieldcat-seltext_s = 'Lights'.
  ls_fieldcat-seltext_m = 'Lights'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Wave Drop
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'ZZSHIFT'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 9.
  LS_FIELDCAT-col_pos    = '2'.
  ls_fieldcat-seltext_L = 'Wave Drop'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Material
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'MATNR'.
  LS_FIELDCAT-ref_fieldname = 'MATNR'.
  LS_FIELDCAT-ref_tabname = 'MARA'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 18.
  LS_FIELDCAT-col_pos    = '3'.
  ls_fieldcat-seltext_L = 'Material'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Description
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'MAKTX'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 40.
  LS_FIELDCAT-col_pos    = '4'.
  ls_fieldcat-seltext_L = 'Description'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Pick Bin
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'LGPLA'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-col_pos    = '5'.
  ls_fieldcat-seltext_L = 'Pick Bin'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Trafiic Light
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'PVERME'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 16.
  LS_FIELDCAT-col_pos    = '6'.
  ls_fieldcat-seltext_L = 'Stock at Pick Bin'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Stock at Prod Bin
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'PRVERME'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 16.
  LS_FIELDCAT-col_pos    = '7'.
  ls_fieldcat-seltext_L = 'Stock at Prod Bin'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Req from wave drop
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'KWMENG'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 23.
  LS_FIELDCAT-col_pos    = '8'.
  ls_fieldcat-seltext_L = 'Requirement from Wave Drop'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Sales Unit
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'VRKME'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 12.
  LS_FIELDCAT-col_pos    = '9'.
  ls_fieldcat-seltext_L = 'Sales Unit'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Unit of Measure
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'MEINS'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 9.
  LS_FIELDCAT-col_pos    = '10'.
  ls_fieldcat-seltext_L = 'UNIT'.
  ls_fieldcat-no_out = 'X'.
  APPEND LS_FIELDCAT TO FIELDCAT.
Diffference
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'DIFF'.
  LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
  LS_FIELDCAT-OUTPUTLEN    = 12.
  LS_FIELDCAT-col_pos    = '11'.
  ls_fieldcat-seltext_L = 'Difference'.
  APPEND LS_FIELDCAT TO FIELDCAT.
ENDFORM.                    " FILL_FIELDCATLOG
*&      Form  CALL_lIST
      Use ALV Function module to display output
FORM CALL_lIST.
Top - of - Page
  PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                =
  I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = V_REPID
  I_CALLBACK_PF_STATUS_SET          = ' '
    I_CALLBACK_USER_COMMAND           = g_user_command
      I_CALLBACK_TOP_OF_PAGE            = C_TOP_OF_PAGE
  I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
  I_CALLBACK_HTML_END_OF_LIST       = ' '
  I_STRUCTURE_NAME                  =
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
      IS_LAYOUT                         = LAYOUT
      IT_FIELDCAT                       = FIELDCAT
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
  I_SAVE                            = ' '
  IS_VARIANT                        =
  IT_EVENTS                         =
  IT_EVENT_EXIT                     =
  IS_PRINT                          =
  IS_REPREP_ID                      =
  I_SCREEN_START_COLUMN             = 0
  I_SCREEN_START_LINE               = 0
  I_SCREEN_END_COLUMN               = 0
  I_SCREEN_END_LINE                 = 0
  IT_ALV_GRAPHICS                   =
  IT_ADD_FIELDCAT                   =
  IT_HYPERLINK                      =
  I_HTML_HEIGHT_TOP                 =
  I_HTML_HEIGHT_END                 =
  IT_EXCEPT_QINFO                   =
IMPORTING
  E_EXIT_CAUSED_BY_CALLER           =
  ES_EXIT_CAUSED_BY_USER            =
    TABLES
      T_OUTTAB                          = I_OUTPUT
   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.                    " CALL_lIST
*&      Form  BUILD_LAYOUT
      text
FORM BUILD_LAYOUT.
  LAYOUT-GET_SELINFOS = 'X'.
Now we want a traffic light to say if the Truck is deleted
the variable p_lignam contains the name in IREPO which stores the
value for the traffic light
  LAYOUT-LIGHTS_FIELDNAME = P_LIGNAM.
  layout-HEADER_TEXT = 'Lights'.
  LAYOUT-LIGHTS_CONDENSE =  'X'.
ENDFORM.                    " BUILD_LAYOUT
*&      Form  COMMENT_BUILD
      text
     -->P_GT_LIST_TOP_OF_PAGE[]  text
FORM COMMENT_BUILD USING    LT_TOP_OF_PAGE TYPE
                                        SLIS_T_LISTHEADER.
  data : v_day(2) type c,
         v_mon(2) type c,
         v_year(4) type c,
         v_ldate(10) type c,
         v_hdate(10) type c.
  DATA: LS_LINE TYPE SLIS_LISTHEADER.
  data: d_date like sy-datum.
  clear : v_ldate,
          v_hdate.
Header Information.
LIST HEADING LINE: TYPE H
  CLEAR LS_LINE.
  LS_LINE-TYP  = 'H'.
LS_LINE-KEY:  NOT USED FOR THIS TYPE
  LS_LINE-INFO = 'Bin Replenishment report for HMR'.
  APPEND LS_LINE TO LT_TOP_OF_PAGE.
STATUS LINE: TYPE S
  CLEAR LS_LINE.
  LS_LINE-TYP  = 'S'.
  LS_LINE-KEY  = TEXT-003.
LS_LINE-INFO = TEXT-003.
  APPEND LS_LINE TO LT_TOP_OF_PAGE.
STATUS LINE: TYPE S
  CLEAR LS_LINE.
  LS_LINE-TYP  = 'S'.
LS_LINE-KEY  = TEXT-003.
LS_LINE-INFO = TEXT-003.
  APPEND LS_LINE TO LT_TOP_OF_PAGE.
Get the data ( s_date_low) into proper format.
  v_year = s_date-low+0(4).
  v_mon = s_date-low+4(2).
  v_day = s_date-low+6(2).
  concatenate v_mon '/' v_day '/' v_year into v_ldate.
  clear : v_mon,
          v_year,
          v_day.
Get the data ( s_date_high) into proper format.
  v_year = s_date-high+0(4).
  v_mon  = s_date-high+4(2).
  v_day  = s_date-high+6(2).
  concatenate v_mon '/' v_day '/' v_year into v_hdate.
  clear : v_mon,
          v_year,
          v_day.
Delivery date
  if not s_date-low is initial .
    if not s_date-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Delivery date From:'.
      LS_LINE-INFO = v_ldate.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Delivery date To :'.
      LS_LINE-INFO =  v_hdate.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
  if not s_date-low is initial.
    if  s_date-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Delivery date :'.
      LS_LINE-INFO = v_ldate.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
Wave Drop
  if not S_SHIFT-LOW is initial.
    if not S_SHIFT-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Wave Drop From :'.
      LS_LINE-INFO = s_shift-low.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Wave Drop to :'.
      LS_LINE-INFO = s_shift-high.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
  if not S_SHIFT-LOW is initial.
    if S_SHIFT-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Wave Drop :'.
      LS_LINE-INFO = s_shift-low.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
     CLEAR LS_LINE.
     LS_LINE-TYP  = 'S'.
     LS_LINE-KEY  = 'Wave Drop to :'.
     LS_LINE-INFO = s_shift-high.
     APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
Department
  if not s_dept-low is initial .
    if not s_dept-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Department From :'.
      LS_LINE-INFO = s_dept-low.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Department to :'.
      LS_LINE-INFO = s_dept-high.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
  if not s_dept-low is initial .
    if  s_dept-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Department :'.
      LS_LINE-INFO = s_dept-low.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
Production Department
  if not S_PDEPT-LOW is initial.
    if not S_PDEPT-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Production Department From :'.
      LS_LINE-INFO = S_PDEPT-LOW.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Production Department to :'.
      LS_LINE-INFO = S_PDEPT-high.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
  if not S_PDEPT-LOW is initial.
    if  S_PDEPT-high is initial.
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = 'Production Department :'.
      LS_LINE-INFO = S_PDEPT-LOW.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    endif.
  endif.
ENDFORM.                    " COMMENT_BUILD
      FORM TOP_OF_PAGE                                              *
FORM TOP_OF_PAGE.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY       = GT_LIST_TOP_OF_PAGE
  I_LOGO                   =
  I_END_OF_LIST_GRID       =
ENDFORM.
      FORM USER_COMMAND                                             *
FORM user_command USING r_ucomm LIKE sy-ucomm
            rs_selfield TYPE slis_selfield.                 "#EC CALLED
  CASE R_UCOMM.
    WHEN '&IC1'.
      read table i_output index rs_selfield-tabindex.
      SET PARAMETER ID 'MAT' FIELD i_output-matnr.
      SET PARAMETER ID 'WRK' FIELD p_plant.
      if not i_output-matnr is initial.
        call transaction 'MD04' and skip first screen.
      endif.
  ENDCASE.
ENDFORM.
the above code i mentioned 1,2 ,3 values  ,1 will have green color,2 will have yellow color,3 will have red color.
Thanks
Seshu

Similar Messages

  • Tool Tip Text for field values in ALV report

    Hi,
    How to get the tool tip text for the field values in ALV report.
    Thanks & Regards,
    Pallavi.

    Hi,
    In fieldcatalog specify the TOOLTIP.
    <b>
    LVC_S_FCAT-TOOLTIP
    </b>
    In this speicfyteh tooltip you want.
    Then append this to the fieldcatalog.
    Hope this solves ur problem.

  • Display Color for sigle  CELL in ALV report

    Hi all,
    I have one doubt is it possible to make a particular cell as read color in ALV.
    Ex: I have one field which shows amount in my ALV report,My requirement is that when ever the amount is less then 'ZERO', I have to show that particular cell in read color.
    Regards
    Anil Kumar.N

    hi,
    here code for coloring a perticular cell
    TYPE-POOLS:slis.
    TABLES:mara,
           makt,
           marc.
    DATA:BEGIN OF itab OCCURS 0,
          matnr LIKE mara-matnr,
          maktx LIKE makt-maktx,
          werks LIKE marc-werks,
          mtart LIKE mara-mtart,
          matkl LIKE mara-matkl,
          meins LIKE mara-meins,
          ntgew LIKE mara-ntgew,
         rowcolor(4) TYPE c,
          cellcolors TYPE lvc_t_scol,
         END OF itab.
    DATA:t_fcat TYPE slis_t_fieldcat_alv,
         t_eve TYPE slis_t_event.
    DATA : st_layout TYPE slis_layout_alv.
    SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:mat FOR mara-matnr.  " no intervals no-extension.
    *PARAMETERS:mat LIKE mara-matnr.
    SELECTION-SCREEN:END OF BLOCK blk1.
    INITIALIZATION.
      PERFORM build_cata USING t_fcat.
      PERFORM build_event.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM display_data.
    *&      Form  build_cata
          text
         -->TEMP_FCAT  text
    FORM build_cata USING temp_fcat TYPE slis_t_fieldcat_alv.
      sy-tvar0 = sy-uname.
      WRITE sy-datum TO sy-tvar1.
      DATA:wa_fcat TYPE slis_fieldcat_alv.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-seltext_m = 'Material'.
      APPEND wa_fcat TO temp_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MAKTX'.
      wa_fcat-seltext_m = 'Description'.
      wa_fcat-fix_column = 'x'.
      wa_fcat-key = 'X'.                                     "To color a column
      APPEND wa_fcat TO temp_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'WERKS'.
      wa_fcat-seltext_m = 'Plant'.
      wa_fcat-key = ' '.
      APPEND wa_fcat TO temp_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MTART'.
      wa_fcat-seltext_m = 'Type'.
      APPEND wa_fcat TO temp_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MATKL'.
      wa_fcat-seltext_m = 'Group'.
      APPEND wa_fcat TO temp_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'MEINS'.
      wa_fcat-seltext_m = 'Measurement Unit'.
      APPEND wa_fcat TO temp_fcat.
      wa_fcat-tabname = 'ITAB'.
      wa_fcat-fieldname = 'NTGEW'.
      wa_fcat-seltext_m = 'Net Value'.
      APPEND wa_fcat TO temp_fcat.
    ENDFORM.                    "build_cata
    *&      Form  build_event
          text
    FORM build_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = t_eve
        EXCEPTIONS
          list_type_wrong = 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.                    "build_event
    *&      Form  data_retrieval
          text
    FORM data_retrieval.
      SELECT maramatnr  maramtart maramatkl marameins mara~ntgew
       maktmaktx  marcwerks
      INTO CORRESPONDING FIELDS OF TABLE itab
      FROM mara INNER JOIN makt ON
      maramatnr = maktmatnr
      INNER JOIN marc ON
      maramatnr = marcmatnr
      WHERE mara~matnr IN mat.
      SORT itab BY matnr.
      DELETE ADJACENT DUPLICATES FROM itab.
    ENDFORM.                    "data_retrieval
    *&      Form  display_data
          text
    FORM display_data.
    *******************************For setting Cell Color*******************************************
      DATA ls_cellcolor TYPE lvc_s_scol .
      st_layout-coltab_fieldname = 'CELLCOLORS'.
      READ TABLE itab INDEX 5 .
      ls_cellcolor-fname = 'MATNR' .
      ls_cellcolor-color-col = '1' .
      ls_cellcolor-color-int = '1' .
      APPEND ls_cellcolor TO itab-cellcolors .
      MODIFY itab INDEX 5 .
    st_layout-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZALV_DS'
          is_layout          = st_layout
          i_save             = 'A'
          it_fieldcat        = t_fcat
          it_events          = t_eve
        TABLES
          t_outtab           = itab
        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_data
    Please reward if useful...

  • Decimal point  for Price value in  ALV Report

    HI,
    I have created ALV report,
    I have 2 price fields in ALV report
    For first field i have to display  in the below format.
    If the value of the field is 3601152 then I have to display it as 36011.52 
    For second field I have to display in the below format
    if the  value is 2494 then I have to display it as 2495.00
    else if the value is 3498.73,then I need not to do anything.
    that means If there is no decimal point, then I have to keep decimal point.
    Thanks&Regards
    RamaDevi

    HI,
    you can work with search and concatenate.
    value1 = 3601152
    search value1 for '.' .
    if sy-subrc eq 0.
      concatenate value1(5) '.' value1(2)+5 into text.
    Or value1 = value1 / 100.
    endif.
    Regards
    Nicole

  • Red color for negative values with $ symbol in Excel

    Hi All,
    We have a custom XML Publisher Report developed using XML rtf template. There is a number field in that template and the field is number formatted with $. i.e. output will look like this.
    $100
    $200 ...
    the issue which we are facing is when that number field is having negative value, then it is displayed in red color.
    and the client dont want that red color to appear in excel.
    ex:
    -($100) is displayed in red color in the excel output. This should be displayed in black color.
    Can anyone help me on this..
    Thanks
    gtungala

    In excel, under format cells, under category -> Number, look under Negative Numbers to see if the selected option is a number format in red. I think selecting a regular format (in black) should fix the issue..
    Thanks!

  • Display Currency symbol with value in ALV Report

    Hi Experts,
    I need to display currency symbol with value in ALV Report like if currency type is dollar then $200.
    Here I am using field catalog type slis_t_fieldcat_alv and suing field merge catalog FM: 'REUSE_ALV_FIELDCATALOG_MERGE'
    I tried like this
        IF <fs_fieldcat>-fieldname = 'STPRS'.
          <fs_fieldcat>-seltext_s = 'Std Cost '.
          <fs_fieldcat>-seltext_m = 'Std Cost'.
          <fs_fieldcat>-seltext_l = 'Std Cost '
           <fs_fieldcat>-tabname = 'MBEW'.
          <fs_fieldcat>-ctabname = 'T001'.
          <fs_fieldcat>-cfieldname ='WAERS'.
          <fs_fieldcat>-datatype = 'CURR'.
        ENDIF.
    Please any one can suggest the solution for this.
    Advance Thanks.
    Regards,
    Bala Achari

    Hİ,
    Check this link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=24379571
    Take care.
    Çağatay

  • How to change a color for a row in ALV grid display

    Hi,
       how to change a color for a row in ALV grid display based on a condition.Any sample code plz

    Hello Ramya,
    Did you check in [SCN|How to color a row of  alv grid]
    Thanks!

  • Is there any transaction code for uploding logo in ALV reports.

    is there any transaction code for uploding logo in ALV reports.

    hi,
    call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
                i_logo             = 'Z_LOGO'.
    endform.
    Upload Logo for REUSE_ALV_COMMENTARY_WRITE
    For those who wish to upload and use a picture in your ALV abap reports.
    Steps for uploading Logo :-:
    1. Goto the transaction OAER
    2. Enter the class name as 'PICTURES'
    3. Enter the class type as 'OT'
    4. Enter the object key as the name of the logo you wish to give
    5. Execute
    6. Then in the new screen select Standard doc. types in bottom window
    Click on the Screen icon
    Now, it will ask for the file path where you have to upload the logo
    7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
    or
    Import Logo and Background Picture for Reporting
    In this step, you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management.
    From the SPRO:
    HR Funds and Position Management --> Dialog Control --> Customize Reporting Interface --> Import Logo and Background Picture for Reporting.
    Activities
    1. Enter the Name of your logo/background picture as an object key in the initial screen.
    2. Make sure that the class name is PICTURES, and the class type is OT.
    3. Choose Execute.
    4. Double-click the document type Picture on the Create tab page. A dialog box will appear in which you can enter the path in which the logo/background picture can be found.
    5. Enter the path and choose Open. The logo will be uploaded into the current R/3 System. If the logo/background picture is to be transported into other systems as well, choose Transport.
    6. Return to the initial screen and repeat the procedure after having entered the Name of your background picture as an object key.
    Please note that the logo/background picture can only be displayed in ALV-based reports with an HTML header. Manually programmed reports such as business distribution plans are not based on the ALV.
    If you have selected several initial objects, ALV-based reports in HR Funds and Position Management will automatically use a hiearchical-sequential display. A logo is not displayed here either. Note also that the logo cannot be printed (see print preview in program).
    Make sure that the logo does not exceed a height of 100 pixels because it would mean that the header of the report will be scrollable.

  • Hi  please send code for displaying index in alv report

    hi
    thanx in advance.
    code please for displaying index in alv report.
    thanx
    rocky

    add one more field to ur internal table
    index type i .
    before u display ALV
    loop at itab.
      itab-index = sy-tabix.
      modify itab index sy-tabix.
    endloop.
    Message was edited by:
            chandrasekhar jagarlamudi

  • 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

  • To display color for the rows in alv

    hi,
         i want to add colors to  all rows.for that i have declared an extra field in st_ekpo i.e  ' line_color(4) type c '.And in layout i passed it like this'   wa_layout-info_fieldname = 'line_color' .
    and finally i populated like this
    loop at it_ekpo into wa_ekpo.
    wa_ekpo-line_color = 'C410'.
    modify it_ekpo from wa_ekpo.
    endloop.
    but its not working.
    to add colors to all rows wat r the modifications i have to do.
    regards,
    pavan.

    hi,
    try like this
    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.
      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-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.
    Populate color variable with colour properties
    Char 1 = C (This is a color property)
    Char 2 = 3 (Color codes: 1 - 7)
    Char 3 = Intensified on/off ( 1 or 0 )
    Char 4 = Inverse display on/off ( 1 or 0 )
              i.e. wa_ekko-line_color = 'C410'
        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
    gd_layout-info_fieldname =      'LINE_COLOR'.
    u must write LINE_COLOR in uppercase....
    reward if useful...
    Edited by: Dhwani shah on Jan 8, 2008 10:12 AM

  • Right Align the Currency values in ALV report

    Hi Friends,
    I have developed a report and displayed the output using the ALV. I have columns for currency values in the output table.
    The fields for currency values are character fields. The values in the table for display, is properly right aligned (default for currency values). But in the output, the currency values are left aligned.
    Since I need blank lines in the output table after each entry, I have used the character fields in the output table so that I can clear them and append it to get the blank line.
    Please suggest me to get the currency values right aligned.
    Thanks in advance.

    try with this field in field catalog.
             just(1)        type c,        " (R)ight (L)eft (C)ent.
    for the currency field add this field too in field catalog. it will work.

  • Value in ALV report

    Hi experts,
    I have an ALV report.
    In the ALV report one of the field is Currency conversion rate to USD.
    For this i am fetching value from TCURR-UKURS.
    The value is taken into an internal table.
    I have seen in the internal table the value is coming correctly. like: suppose the value is 1,114.10000- in that perticulat field. then the same value is coming in my final internal table.
    But in the report display it is coming as /1,114.10000
    Please help me out
    regards,
    charles

    Check the field-reference what is your ALV-field pointing at. Maybe this reference is pointing at a field, which enables only positive numbers.
    And if you just modified it, don't forget about the ALV-cache, which stores a lot of setting about ALV grids while you are logged in.
    To clear ALV cache you can use a transaction (but I forgot it ), or you can log off and relogin to SAP.
    Happy developing
    Tamá

  • Color  for a Field in alv output

    Hi All,
    I use a field in the ALV grid output which needs to display color (red or green) depending on certain validations. Please tell me how to display color for this field. The program uses oops.
    Thanks.

    Hi
    1. add one more field to ur final internal table say COLOR(4)
    2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
    wa_layout-style_fieldname = 'COLOR'. "if its list
    3. read table itab index 3.
    itab-color = 'C410'.
    modify itab index 3
    4. see program SHOWCOLO for all color codes
    1. Add a field of data type CHAR(3) to the internal output table.
    2. Enter the color code in the appropriate field of the row to be colored in the internal
    output table:
    Code: 'Cxy'
    C = Color (all codes begin with 'C')
    x = color number ('1' - '9')
    y = highlight ('0' = off, '1' = on)
    3. Assign the internal output table color code field name to the IS_LAYOUT importing
    structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
    interface.
    To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, let’s modify declaration of our list data table “gt_list”.
    you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field “INFO_FNAME” of the layout structure.
    e.g.
    ps_layout-info_fname = <field_name_containing_color_codes>. “e.g. ‘ROWCOLOR’
    You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
    You can color an entire row as described in the next section. However, this method is less time consuming.
    Coloring Individual Cells
    This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by “more” is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
    The structure that should be included must be of type “LVC_T_SCOL”. If you want to color the entire row, this inner table should contain only one row with field “fname” is set to space, some color value at field “col”, “0” or “1” at fields “int” (intensified) and “inv” (inverse).
    If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field “fname”. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
    Reward points if useful
    Regards
    Anji

  • Adding color to few rows in ALV report output

    Hi,
    I have developed a ALV report program which displays the project details of the employees.In the output the rows containing the employees who have been part of the project should be displayed in different color.I have used necessary code for this but still the rows are not displayed in different color.
    Given below is my program.Please suggest me possible solution for this.
    REPORT  ZPROJ_ALL_DETAILS.
    TYPE-POOLS: SLIS.
    Tables: zheempl,zhealoc,zheproj,zheskil.
    types: begin of ty_zheempl,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu like zheempl-pu,
          name1 like zheempl-name1,
          end of ty_zheempl.
    types: begin of ty_zhealoc,
          project like zhealoc-project,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          role like zhealoc-role,
          end of ty_zhealoc.
    types: begin of ty_output,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu    like zheempl-pu,
          name1 like zheempl-name1,
          role like zhealoc-role,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          cellcolor(4) type c,
          end of ty_output.
    data: t_zheempl type standard table of ty_zheempl,
          t_zhealoc type standard table of ty_zhealoc,
          t_output type standard table of ty_output with header line.
    data: wa_zheempl type ty_zheempl,
          wa_zhealoc type ty_zhealoc,
          wa_output type ty_output.
    DATA : T_FIELDCAT TYPE slis_t_fieldcat_alv.
    Data : wa_fieldcat type slis_fieldcat_alv.
    Data: it_top TYPE slis_t_listheader,
          wa_top TYPE slis_listheader.
    Data: t_cellcolor TYPE lvc_t_scol WITH HEADER LINE,
          wa_cellcolor TYPE lvc_s_scol.
    Data: t_layout TYPE slis_layout_alv.
    *selection-screen
    selection-screen: begin of block b1 with frame title text-001.
    select-options: s_proj for wa_zhealoc-project,
                    s_empid   for wa_zheempl-empid.
    parameters:     p_date like sy-datum obligatory.
    selection-screen: end of block b1.
    selection-screen: begin of block b2 with frame title text-002.
    parameters:      p_prtosr  radiobutton group g1 default 'X',
                     p_prusly  radiobutton group g1.
    selection-screen: end of block b2.
    selection-screen: begin of block b3 with frame title text-003.
    parameters:      p_dwtodk as checkbox default 'X'.
    selection-screen: end of block b3.
    selection-screen: begin of block b4 with frame title text-004.
    parameters:      p_shwhis as checkbox default 'X'.
    selection-screen: end of block b4.
    Start-of-selection
      IF p_shwhis = 'X'.
    SELECT l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      where project IN s_proj
      AND endat < p_date
      OR endat > p_date.
       t_output-cellcolor = 'C310'.
       MODIFY t_output transporting cellcolor where endat < p_date.
      ELSE.
      select l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      WHERE project in s_proj
      AND   endat > p_date.
       ENDIF.
      wa_fieldcat-col_pos = '1'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'EMPID'.
      wa_fieldcat-seltext_m = 'Employee ID'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '2'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'NAME1'.
      wa_fieldcat-seltext_m = 'Name 1'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '3'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ROLE'.
      wa_fieldcat-seltext_m = 'Role of employee in the project'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '4'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'STDAT'.
      wa_fieldcat-seltext_m = 'Start Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '5'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ENDAT'.
      wa_fieldcat-seltext_m = 'End Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '6'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'GRADE'.
      wa_fieldcat-seltext_m = 'Salary Level'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '7'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'PU'.
      wa_fieldcat-seltext_m = 'Department Number'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '8'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'LOCATION'.
      wa_fieldcat-seltext_m = 'Work Location'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      t_layout-no_input = 'X'.
      t_layout-colwidth_optimize = 'x'.
      t_layout-info_fieldname = 'LINE_COLOR'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         i_callback_top_of_page            = 'TOP'
         is_layout                         = t_layout
         IT_FIELDCAT                       = T_FIELDCAT
         i_save                            = 'X'
        TABLES
          t_outtab                          = T_OUTPUT
      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.
    Form top.
      Refresh it_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Requestor'.
      wa_top-info = sy-uname.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Program'.
      wa_top-info = sy-repid.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Page'.
      wa_top-info = sy-pagno.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Date'.
      wa_top-info = sy-datum.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'H'.
      wa_top-info = 'Project Details'.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_top.
      ENDFORM.

    { REPORT  ZPROJ_ALL_DETAILS.
    TYPE-POOLS: SLIS.
    Tables: zheempl,zhealoc,zheproj,zheskil.
    types: begin of ty_zheempl,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu like zheempl-pu,
          name1 like zheempl-name1,
          end of ty_zheempl.
    types: begin of ty_zhealoc,
          project like zhealoc-project,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          role like zhealoc-role,
          end of ty_zhealoc.
    types: begin of ty_output,
          empid like zheempl-empid,
          grade like zheempl-grade,
          location like zheempl-location,
          pu    like zheempl-pu,
          name1 like zheempl-name1,
          role like zhealoc-role,
          stdat like zhealoc-stdat,
          endat like zhealoc-endat,
          cellcolor(4) type c,
          end of ty_output.
    data: t_zheempl type standard table of ty_zheempl,
          t_zhealoc type standard table of ty_zhealoc,
          t_output type standard table of ty_output with header line,
          t_output1 type standard table of ty_output with header line.
    data: wa_zheempl type ty_zheempl,
          wa_zhealoc type ty_zhealoc,
          wa_output type ty_output,
          wa_output1 type ty_output.
    DATA : T_FIELDCAT TYPE slis_t_fieldcat_alv.
    Data : wa_fieldcat type slis_fieldcat_alv.
    Data: it_top TYPE slis_t_listheader,
          wa_top TYPE slis_listheader.
    Data: t_cellcolor TYPE lvc_t_scol WITH HEADER LINE,
          wa_cellcolor TYPE lvc_s_scol.
    Data: t_layout TYPE slis_layout_alv.
    *selection-screen
    selection-screen: begin of block b1 with frame title text-001.
    select-options: s_proj for wa_zhealoc-project,
                    s_empid   for wa_zheempl-empid.
    parameters:     p_date like sy-datum obligatory.
    selection-screen: end of block b1.
    selection-screen: begin of block b2 with frame title text-002.
    parameters:      p_prtosr  radiobutton group g1 default 'X',
                     p_prusly  radiobutton group g1.
    selection-screen: end of block b2.
    selection-screen: begin of block b3 with frame title text-003.
    parameters:      p_dwtodk as checkbox default 'X'.
    selection-screen: end of block b3.
    selection-screen: begin of block b4 with frame title text-004.
    parameters:      p_shwhis as checkbox default 'X'.
    selection-screen: end of block b4.
    Start-of-selection
      IF p_shwhis = 'X'.
    SELECT l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      where project IN s_proj
      AND endat < p_date
      OR endat > p_date.
       t_output-cellcolor = 'C310'.
       MODIFY t_output transporting cellcolor where endat < p_date.
      ELSE.
      select l~empid
           l~grade
           l~location
           l~pu
           l~name1
           c~role
           c~stdat
           c~endat
      INTO TABLE t_output
      FROM ( zheempl AS l
      INNER JOIN zhealoc
      AS c ON lempid = cempid )
      WHERE project in s_proj
      AND   endat > p_date.
       ENDIF.
      wa_fieldcat-col_pos = '1'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'EMPID'.
      wa_fieldcat-seltext_m = 'Employee ID'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '2'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'NAME1'.
      wa_fieldcat-seltext_m = 'Name 1'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '3'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ROLE'.
      wa_fieldcat-seltext_m = 'Role of employee in the project'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '4'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'STDAT'.
      wa_fieldcat-seltext_m = 'Start Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '5'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'ENDAT'.
      wa_fieldcat-seltext_m = 'End Date'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '6'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'GRADE'.
      wa_fieldcat-seltext_m = 'Salary Level'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '7'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'PU'.
      wa_fieldcat-seltext_m = 'Department Number'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-col_pos = '8'.
      wa_fieldcat-tabname = 't_output'.
      wa_fieldcat-fieldname = 'LOCATION'.
      wa_fieldcat-seltext_m = 'Work Location'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat to t_fieldcat.
      CLEAR wa_fieldcat.
      t_layout-no_input = 'X'.
      t_layout-colwidth_optimize = 'x'.
      t_layout-info_fieldname = 'LINE_COLOR'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                = ' '
        I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         i_callback_top_of_page            = 'TOP'
         is_layout                         = t_layout
         IT_FIELDCAT                       = T_FIELDCAT
         i_save                            = 'X'
        TABLES
          t_outtab                          = T_OUTPUT
      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.
    Form top.
      Refresh it_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Requestor'.
      wa_top-info = sy-uname.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Program'.
      wa_top-info = sy-repid.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Page'.
      wa_top-info = sy-pagno.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'S'.
      wa_top-key = 'Date'.
      wa_top-info = sy-datum.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      wa_top-typ = 'H'.
      wa_top-info = 'Project Details'.
      APPEND wa_top to it_top.
      CLEAR wa_top.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = it_top.
      ENDFORM.}

Maybe you are looking for

  • How do I use the PXI_clk10 backplane clock? It's not there!

    Hi, folks! This might seem a trivial question, but I'm completely at a loss here. I have made an RT-project in LV8 which (among other things) samples data continuously from two cards located in a PXI-system. All 32 (16+16) differential channels are u

  • Not registering SD card?

    Hey there. Pretty much I have two issues, the first has already been solved but I'm just wondering of the chance of it occuring again? First issue being that the screen on the phone flickered, shut off and never came back on. The light at the top rem

  • Anyone use Distributed Directors?

    We are looking for high-availability solutions across our WAN. Has anyone implemented a wide area load balancing solution using the Cisco Distributed Director or similar product, such as F5 3DNS? These products use probes or other monitoring to deter

  • DW 8 - Table Height 100%

    What's the secret to get it to work? I have a table at the top of my site that contains a masthead graphic, below that - I have another table that I want to extend all the way down 100%. I have that table height set to 100% as I did when I had DW mx,

  • Can data be loaded from Cube to DSO

    Can data be loaded from Cube to DSO