How to use color in alv

HELLO,
can u tell me that i want to color column in alv so how to use it ingrid layout.
thanks.

*& Report  ZDEMO_ALVGRID                                               *
*& Example of a simple ALV Grid Report                                 *
*& The basic ALV grid, Enhanced to display each row in a different     *
*& colour                                                              *
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.
* There are a number of ways to create a fieldcat.
* For the purpose of this example i will build the fieldcatalog manualy
* by populating the internal table fields individually and then
* appending the rows. This method can be the most time consuming but can
* also allow you  more control of the final product.
* Beware though, you need to ensure that all fields required are
* populated. When using some of functionality available via ALV, such as
* total. You may need to provide more information than if you were
* simply displaying the result
*               I.e. Field type may be required in-order for
*                    the 'TOTAL' function to work.
  fieldcatalog-fieldname   = 'EBELN'.
  fieldcatalog-seltext_m   = 'Purchase Order'.
  fieldcatalog-col_pos     = 0.
  fieldcatalog-outputlen   = 10.
  fieldcatalog-emphasize   = 'X'.
  fieldcatalog-key         = 'X'.
*  fieldcatalog-do_sum      = 'X'.
*  fieldcatalog-no_zero     = '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'.
*  gd_layout-totals_only        = 'X'.
*  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
*                                         "click(press f2)
*  gd_layout-zebra             = 'X'.
*  gd_layout-group_change_edit = 'X'.
*  gd_layout-header_text       = 'helllllo'.
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
*            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
*            i_callback_user_command = 'USER_COMMAND'
*            i_grid_title           = outtext
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
*            it_special_groups       = gd_tabgroup
*            IT_EVENTS                = GT_XEVENTS
            i_save                  = 'X'
*            is_variant              = z_template
       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

Similar Messages

  • How to use colors in a progressbar

    hi!
    can you please telle me how to use colors in my application, i mean how should i use a color as a parameter such as :
    progressBar.setBackground(Color);
    in this examlpe, how shoul i pass the paremeter? in which codification, shall i pass it like this way :
    progressBar.setBackground(white);
    or shall i pass it in an other way !!
    please try to help me !

    Color.white, Color.red etc.
    http://java.sun.com/j2se/1.4.1/docs/api/index.html

  • How to use Color Splash Effect in Photoshop CS6?

    Hi everyone
    Can you guy help me out How to use Color Splash Effect in Photoshop CS6? I need to use in slide in my web
    Thanks

    You mean "leave part in color and make the rest black and white"?
    Just select or mask the part that should be B&W and desaturate, or use the B&W adjustment.
    Or you can add a B&W adjustment layer and mask out the parts that should stay in color.

  • How to use IT_special_groups in ALV Grid ?

    Hi Abapers,
    Am new to ALv's
    am passing almost all parameters to ALV_GRID FM..!
    i dont no how to use of options Groups , Filters and I_sel_hide .
    event i find an Demo example related to Groups ..
    but while displaying the out put i didnt find any Changes ?
    could any one give an Example with using GROUPS , Filters and SEL_INFO ?
    Pls help me out to resolve this problem ..!
    Thanks & Regrds
    Rajeshk

    Hi,
    you can group your ALV columns into various groups using field SP_GROUP in field catalog. You assign name to these groups in the table IT_SPECIAL_GROUPS. User can restrict column selection to one of these groups (using name from the table) on the current layout window. More info can be found in [SAP documentation|http://help.sap.com/saphelp_nw04/helpdata/en/a2/64f7a2ee4f11d2b484006094192fe3/frameset.htm]
    Probably as you know you can filter selected records in ALV (icon with funnel). You can use table IT_FILTER to set up this filter.
    I am not sure about I_SEL_HIDE but as far as I remember ALV can display selection criteria from report which call ALV FM. So I assume that you can use this table to control displaying of them.
    BTW there is a really nice [reference for ALV|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907?overridelayout=true].
    Cheers

  • How to use color chooser?

    hi, how to use the color chooser provided in the sun one studio?

    Still the wrong forum  - this forum is about writing plugins.

  • HOW TO USE OOBJECT ORIENTD ALV INSTED OF REUSE_ALV_GRID_DISPLAY

    Pls help me to implement the object oriented ALV Insted of REUSE_ALV_GRID_DISPLAY.
    Pls find the report below its working fine but we want the OBJECT ORIENTD ALV.
    THNAKS
    TYPE-POOLS: slis.                      " ALV Global types
    tables:pa0001,
           pa0315,
           pa0007,
           disvariant.
         Selection-Screen
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    *SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: s_pernr FOR pa0001-pernr  OBLIGATORY
    .            " Personnel No
    SELECT-OPTIONS: s_orgeh FOR pa0001-orgeh .           " Organization unit
    SELECT-OPTIONS: s_werks FOR pa0001-werks.            " Personnel Area
    SELECT-OPTIONS: s_plans FOR pa0001-plans.            " Position
    SELECT-OPTIONS: s_ebeln FOR pa0315-ebeln.            " Purchase order
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK b2k2 WITH FRAME TITLE text-002.
    *SELECT-OPTIONS: s_var FOR disvariant-variant.
    PARAMETERS: p_disva1 LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK b2k2.
                     Type Definition                                     *
    TYPES :
    BEGIN OF ty_pa0001_pa0002,
        pernr TYPE pa0001-pernr , " Personnel no.
        endda TYPE pa0001-endda , " end date
        begda TYPE pa0001-begda , " start date
        bukrs TYPE pa0001-bukrs , " company code
        werks TYPE pa0001-werks , " Personnnel area
        persg TYPE pa0001-persg , " Employee group
        persk TYPE pa0001-persk , " Employee subgroup
        btrtl TYPE pa0001-btrtl , " Personnnel subarea
        abkrs TYPE pa0001-abkrs , " Payroll area
        kostl TYPE pa0001-kostl , " cost center
        orgeh TYPE pa0001-orgeh , " Organizational Unit
        plans TYPE pa0001-plans , " Position
        nachn TYPE pa0002-nachn , " Last name
        vorna TYPE pa0002-vorna , " First name
        midnm TYPE pa0002-midnm , " Middle name
      END   OF ty_pa0001_pa0002 ,
    BEGIN OF ty_pa0315,
       pernr TYPE pa0315-pernr , " Personnel no.
       kostl TYPE pa0315-kostl , " Sending cost center
       lstar TYPE pa0315-lstar , " Activity type
       werks TYPE pa0315-werks , " Plant
       lifnr TYPE pa0315-lifnr , " Vendor number
       ebeln TYPE pa0315-ebeln , " Sending pruchase ord
       ebelp TYPE pa0315-ebelp , " Sending PO item
       lstnr TYPE pa0315-lstnr , " Activity number
    END   OF ty_pa0315,
    BEGIN  OF ty_pa0007,
      pernr TYPE pa0007-pernr,
      schkz TYPE pa0007-schkz,
    END  OF ty_pa0007,
    BEGIN OF ty_t527x,
    orgeh TYPE t527x-orgeh,
    orgtx TYPE t527x-orgtx,
    END OF ty_t527x,
    BEGIN OF ty_t528t,
    plans TYPE t528t-plans,
    plstx TYPE t528t-plstx,
    END OF ty_t528t,
    BEGIN OF ty_final,
      pernr   TYPE pa0001-pernr , " Personnel no.
      nachn   TYPE pa0002-nachn , " Last name
      vorna   TYPE pa0002-vorna , " First name
      midnm   TYPE pa0002-midnm , " Middle name
      bukrs   TYPE pa0001-bukrs , " company code
      werks   TYPE pa0001-werks , " Personnnel area
      persg   TYPE pa0001-persg , " Employee group
      persk   TYPE pa0001-persk , " Employee subgroup
      btrtl   TYPE pa0001-btrtl , " Personnnel subarea
      abkrs   TYPE pa0001-abkrs , " Payroll area
    kostl   TYPE pa0001-kostl , " cost center
      orgeh   TYPE pa0001-orgeh , " Organizational Unit
      orgtx   TYPE t527x-orgtx  , " Organizational text
      plans   TYPE pa0001-plans , " Position
      plstx   TYPE t528t-plstx  , " Position text
      schkz   TYPE pa0007-schkz , " Work schedule rule
      kostl   TYPE pa0315-kostl , " Sending cost center
      lstar   TYPE pa0315-lstar , " Activity type
      werks_p TYPE pa0315-werks , " Plant
      lifnr   TYPE pa0315-lifnr , " Vendor number
      ebeln   TYPE pa0315-ebeln , " Sending pruchase ord
      ebelp   TYPE pa0315-ebelp , " Sending PO item
      lstnr   TYPE pa0315-lstnr , " Activity number
      begda   TYPE pa0001-begda , " start date
      endda   TYPE pa0001-endda , " end date
    END  OF ty_final.
                     Data Declaration                                    *
    DATA :
      t_pa0001_pa0002 TYPE STANDARD TABLE OF ty_pa0001_pa0002 ,
      w_pa0001_pa0002 TYPE ty_pa0001_pa0002 ,
      t_pa0315 TYPE STANDARD TABLE OF ty_pa0315 ,
      w_pa0315 TYPE ty_pa0315 ,
      t_pa0007 TYPE STANDARD TABLE OF ty_pa0007 ,
      w_pa0007 TYPE ty_pa0007 ,
      t_t527x TYPE STANDARD TABLE OF ty_t527x ,
      w_t527x TYPE ty_t527x ,
      t_t528t TYPE STANDARD TABLE OF ty_t528t ,
      w_t528t TYPE ty_t528t ,
      t_final TYPE STANDARD TABLE OF ty_final ,
      w_final TYPE ty_final .
    START-OF-SELECTION .
      SELECT a~pernr
             a~endda
             a~begda
             a~bukrs
             a~werks
             a~persg
             a~persk
             a~btrtl
             a~abkrs
             a~kostl
             a~orgeh
             a~plans
             b~nachn
             b~vorna
             b~midnm
             INTO TABLE t_pa0001_pa0002
             FROM pa0001 AS a INNER JOIN pa0002 AS b
             ON apernr = bpernr
             WHERE a~pernr IN s_pernr
             AND   a~werks IN s_werks
             AND   a~orgeh IN s_orgeh
             AND   a~plans IN s_plans.
      SORT t_pa0001_pa0002 BY pernr .
      IF NOT t_pa0001_pa0002[] IS INITIAL .
        SELECT pernr
               kostl
               lstar
               werks
               lifnr
               ebeln
               ebelp
               lstnr
               FROM pa0315
               INTO TABLE t_pa0315
               FOR ALL ENTRIES IN t_pa0001_pa0002
               WHERE pernr = t_pa0001_pa0002-pernr
               AND   kostl = t_pa0001_pa0002-kostl
               AND   ebeln IN s_ebeln.
        SELECT pernr
               schkz
               FROM pa0007
               INTO TABLE t_pa0007
               FOR ALL ENTRIES IN t_pa0001_pa0002
               WHERE pernr = t_pa0001_pa0002-pernr.
        SELECT orgeh
               orgtx
               FROM t527x
               INTO TABLE t_t527x
               FOR ALL ENTRIES IN t_pa0001_pa0002
               WHERE orgeh = t_pa0001_pa0002-orgeh.
        SELECT plans
               plstx
               FROM t528t
               INTO TABLE t_t528t
               FOR ALL ENTRIES IN t_pa0001_pa0002
               WHERE plans = t_pa0001_pa0002-plans.
    ENDIF.
    Merging data of t_pa0001_pa0002,t_pa0315 & t_pa0007 into t_final.
    LOOP AT t_pa0001_pa0002 INTO w_pa0001_pa0002 .
    MOVE-CORRESPONDING w_pa0001_pa0002 TO w_final.
    READ TABLE t_pa0315 INTO w_pa0315 WITH KEY  pernr =
    w_pa0001_pa0002-pernr
    kostl = w_pa0001_pa0002-kostl.
        IF sy-subrc = 0.
          w_final-kostl   = w_pa0315-kostl.
          w_final-lstar   = w_pa0315-lstar.
          w_final-werks_p = w_pa0315-werks.
          w_final-lifnr   = w_pa0315-lifnr.
          w_final-ebeln   = w_pa0315-ebeln.
          w_final-ebelp   = w_pa0315-ebelp.
          w_final-lstnr   = w_pa0315-lstnr.
        ENDIF.
    READ TABLE t_pa0007 INTO w_pa0007 WITH KEY pernr =
    w_pa0001_pa0002-pernr.
      IF sy-subrc = 0.
         w_final-schkz = w_pa0007-schkz.
      ENDIF.
      READ TABLE t_t527x INTO w_t527x WITH KEY orgeh = w_pa0001_pa0002-orgeh
      IF sy-subrc = 0.
         w_final-orgtx = w_t527x-orgtx.
      ENDIF.
        READ TABLE t_t528t INTO w_t528t WITH KEY plans =
    w_pa0001_pa0002-plans.
      IF sy-subrc = 0.
         w_final-plstx = w_t528t-plstx.
      ENDIF.
    APPEND w_final to t_final.
    ENDLOOP.
    PERFORM f_display_data.
    FORM f_display_data.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    Build the field catalog
    m_fieldcat 'PERNR' 'PA0001'.
    m_fieldcat 'NACHN' 'PA0002'.
    m_fieldcat 'VORNA' 'PA0002'.
    m_fieldcat 'MIDNM' 'PA0002'.
    m_fieldcat 'BUKRS' 'PA0001'.
    m_fieldcat 'WERKS' 'PA0001'.
    m_fieldcat 'PERSG' 'PA0001'.
    m_fieldcat 'PERSK' 'PA0001'.
    m_fieldcat 'BTRTL' 'PA0001'.
    m_fieldcat 'ABKRS' 'PA0001'.
    m_fieldcat 'ORGEH' 'PA0001'.
    m_fieldcat 'ORGTX' 'T527X'.
    m_fieldcat 'PLANS' 'PA0001'.
    m_fieldcat 'PLSTX' 'T528T'.
    m_fieldcat 'SCHKZ' 'PA0007'.
    m_fieldcat 'KOSTL' 'PA0315'.
    m_fieldcat 'LSTAR' 'PA0315'.
    m_fieldcat 'WERKS' 'PA0315'.
    m_fieldcat 'LIFNR' 'PA0315'.
    m_fieldcat 'EBELN' 'PA0315'.
    m_fieldcat 'EBELP' 'PA0315'.
    m_fieldcat 'LSTNR' 'PA0315'.
    m_fieldcat 'BEGDA' 'PA0001'.
    m_fieldcat 'ENDDA' 'PA0001'.
    ls_fieldcat-col_pos = '1'.
    ls_fieldcat-fieldname = 'PERNR'.
    ls_fieldcat-tabname = 't_FINAL'.
    *ls_fieldcat-rollname = 'PERNR'.
    ls_fieldcat-ref_tabname  = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '2'.
    ls_fieldcat-fieldname = 'NACHN'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0002'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '3'.
    ls_fieldcat-fieldname = 'VORNA'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0002'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '4'.
    ls_fieldcat-fieldname = 'MIDNM'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0002'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '5'.
    ls_fieldcat-fieldname = 'BUKRS'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '6'.
    ls_fieldcat-fieldname = 'WERKS'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '7'.
    ls_fieldcat-fieldname = 'PERSG'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '8'.
    ls_fieldcat-fieldname = 'PERSK'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '9'.
    ls_fieldcat-fieldname = 'BTRTL'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '10'.
    ls_fieldcat-fieldname = 'ABKRS'.
    ls_fieldcat-tabname = 'T_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '11'.
    ls_fieldcat-fieldname = 'ORGEH'.
    ls_fieldcat-tabname = 'T_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '12'.
    ls_fieldcat-fieldname = 'ORGTX'.
    ls_fieldcat-tabname = 'T_FINAL'.
    ls_fieldcat-ref_tabname = 'T527X'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '13'.
    ls_fieldcat-fieldname = 'PLANS'.
    ls_fieldcat-tabname = 'T_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '14'.
    ls_fieldcat-fieldname = 'PLSTX'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'T528T'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '15'.
    ls_fieldcat-fieldname = 'SCHKZ'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0007'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '16'.
    ls_fieldcat-fieldname = 'KOSTL'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '17'.
    ls_fieldcat-fieldname = 'LSTAR'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '18'.
    ls_fieldcat-fieldname = 'WERKS'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '19'.
    ls_fieldcat-fieldname = 'LIFNR'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '20'.
    ls_fieldcat-fieldname = 'EBELN'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '21'.
    ls_fieldcat-fieldname = 'EBELP'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '22'.
    ls_fieldcat-fieldname = 'LSTNR'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0315'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '23'.
    ls_fieldcat-fieldname = 'BEGDA'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    ls_fieldcat-col_pos = '24'.
    ls_fieldcat-fieldname = 'ENDDA'.
    ls_fieldcat-tabname = 't_FINAL'.
    ls_fieldcat-ref_tabname = 'PA0001'.
    APPEND ls_fieldcat TO lt_fieldcat.
    CLEAR: ls_fieldcat.
    *DATA: v_repid TYPE sy-repid.
         v_repid = sy-repid.
    *Display the list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
         i_callback_program      = v_repid
         i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = lt_fieldcat
        TABLES
          t_outtab                = t_final.
    ENDFORM.                               " F_DISPLAY_DATA

    Hi,
    <b>Sample programs on ALV Grid</b>
    report zbnstest.
    * TABLES AND DATA DECLARATION.
    *TABLES: mara,makt.",marc.
    data syrepid like sy-repid.
    data sydatum(10). " LIKE sy-datum.
    data sypagno(3) type n.
    * WHEN USING MORE THAN ONE TABLE IN ALV WE NEEED TO DECLARE THE TYPE
    * GROUP (TYPE-POOLS--------->SLIS)
    type-pools : slis.
    * INTERNAL TABLE DECLARATION.
    * INTERNAL TABLE TO HOLD THE VALUES FROM THE MARA TABLE
    data: begin of t_mara occurs 0,
    matnr like mara-matnr,
    meins like mara-meins,
    mtart like mara-mtart,
    matkl like mara-matkl,
    end of t_mara.
    * INTERNAL TABLE TO HOLD THE CONTENTS FROM THE EKKO TABLE
    data : begin of t_marc occurs 0,
    matnr like mara-matnr,
    werks like marc-werks,
    minbe like marc-minbe.
    data: end of t_marc.
    * INTERNAL TABLE TO HOLD THE VALUES FROM MAKT TABLE.
    data : begin of t_makt occurs 0,
    matnr like mara-matnr,
    maktx like makt-maktx,
    spras like makt-spras,
    end of t_makt.
    * INTERNAL TABLE WHICH ACTUALLY MERGES ALL THE OTHER INTERNAL TABLES.
    data: begin of itab1 occurs 0,
    matnr like mara-matnr,
    meins like mara-meins,
    maktx like makt-maktx,
    spras like makt-spras,
    werks like marc-werks,
    minbe like marc-minbe,
    end of itab1.
    * THE FOLLOWING DECLARATION IS USED FOR DEFINING THE FIELDCAT
    * AND THE LAYOUT FOR THE ALV.
    * HERE AS slis_t_fieldcat_alv IS A INTERNAL TABLE WITHOUT A HEADER LINE
    * WE EXPLICITELY DEFINE AN INTERNAL TABLE OF THE SAME STRUCTURE AS THAT
    * OF slis_t_fieldcat_alv BUT WITH A HEADER LINE IN THE DEFINITION.
    * THIS IS DONE TO MAKE THE CODE SIMPLER.
    * OTHERWISE WE MAY HAVE TO DEFINE THE STRUCTURE AS IN THE NORMAL SAP
    * PROGRAMS.
    * IN THE FIELDCATALOG TABLE WE ACTUALLY PASS THE FIELDS FROM ONE OR
    * MORE TABLES AND CREATE A STRUCTURE
    * IN THE LAYOUT STRUCTURE WE BASICALLY DEFINE THE FORMATTING OPTIONS
    * LIKE DISPLAY IN THE ZEBRA PATTERN ,THE HOTSPOT OPTIONS ETC.
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
    fieldlayout type slis_layout_alv.
    * DECLARING THE EVENTTABLE INTERNL TABLE FOR USING EVENTS LIKE
    * TOP-OF-PAGE ETC.
    data : eventstab type slis_t_event with header line.
    * DECLARING AN INTERNAL TABLE TO HOLD THE DATA FOR THE TOP-OF-PAGE
    data : heading type slis_t_listheader with header line.
    data : heading1 type slis_t_listheader with header line.
    data : heading2 type slis_t_listheader with header line.
    data : heading3 type slis_t_listheader with header line.
    data : heading4 type slis_t_listheader with header line.
    data : heading5 type slis_t_listheader with header line.
    data : heading6 type slis_t_listheader with header line.
    data : heading7 type slis_t_listheader with header line.
    data : heading8 type slis_t_listheader with header line.
    * STRUCTURE TO PASS THE COLOR ATTRIBUTES FOR DISPLAY.
    data : colorstruct type slis_coltypes.
    * INITIALIZATION. *
    initialization.
    syrepid = sy-repid.
    sypagno = sy-pagno.
    clear fieldcatalog.
    * START-OF-SELECTION. *
    start-of-selection.
    * SUBROUTINE TO POPULATE THE COLORSTRUCT
    perform fill_colorstruct using colorstruct.
    * SUBROUTINE TO POPULATE THE FIELDS OF THE FIELD CATALOGUE
    perform populate_fieldcatalog.
    * SUBROUTINE TO SELECT DATA FROM VARIOUS TABLES AND POPULATE IT IN THE
    * INTERNAL TABLE.
    perform selectdata_and_sort.
    * SUBROUTINE TO POPULATE THE LAYOUT STRUCTURE.
    perform populate_layout using fieldlayout.
    * SUBROUTINE TO CALL THE FUNCTION MERGE TO ENSURE PROPER DISPLAY.
    perform merge_fieldcatalog.
    * SUBROUTINE TO POPULATE THE EVENTSTAB.
    perform fill_eventstab tables eventstab.
    * SUBROUTINE TO POPULATE THE HEADING TABLES.
    perform fill_headingtable tables heading using 'HEADING'.
    perform fill_headingtable tables heading1 using 'HEADING1'.
    perform fill_headingtable tables heading2 using 'HEADING2'.
    perform fill_headingtable tables heading3 using 'HEADING3'.
    perform fill_headingtable tables heading4 using 'HEADING4'.
    perform fill_headingtable tables heading5 using 'HEADING5'.
    perform fill_headingtable tables heading6 using 'HEADING6'.
    perform fill_headingtable tables heading7 using 'HEADING7'.
    perform fill_headingtable tables heading8 using 'HEADING8'.
    * SUBROUTINE TO DISPLAY THE LIST.
    perform display_alv_list.
    * FORMS
    * IN THIS SUBROUTINE WE POPULATE THE FIELDCATALOG TABLE WITH THE NAMES
    * OF THE TABLE,FIELDNAME,WHETHER IT IS KEY FIELD OR NOT,HEADING AND
    * COLUMN JUSTIFICATION.
    form populate_fieldcatalog.
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MATNR' 'X' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MEINS' ' '.
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MAKTX' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MTART' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MATKL' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'SPRAS' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'WERKS' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MINBE' ' ' .
    endform. " POPULATE_FIELDCATALOG
    * FORM FILL_FIELDS_OF_FIELDCATALOG *
    * --> FIELDCATALOG *
    * --> P_TABNAME *
    * --> P_FIELDNAME *
    * --> P_KEY *
    * --> P_KEY *
    form fill_fields_of_fieldcatalog tables fieldcatalog
    structure fieldcatalog
    using p_tabname
    p_fieldname
    p_key.
    * p_no_out.
    fieldcatalog-tabname = p_tabname.
    fieldcatalog-fieldname = p_fieldname.
    fieldcatalog-key = p_key.
    fieldcatalog-emphasize = '1234'.
    *fieldcatalog-no_out = p_no_out.
    append fieldcatalog.
    endform. " FILL_FIELDSOFFIELDCATALOG
    * FORM POPULATE_LAYOUT *
    * --> FIELDLAYOUT *
    form populate_layout using fieldlayout type slis_layout_alv.
    fieldlayout-f2code = '&ETA' .
    fieldlayout-zebra = 'X'.
    * FOR THE WINDOW TITLE.
    fieldlayout-window_titlebar = 'ALV with Events'.
    fieldlayout-colwidth_optimize = 'X'.
    fieldlayout-no_vline = ' '.
    *fieldlayout-no_input = 'X'.
    fieldlayout-confirmation_prompt = ''.
    fieldlayout-key_hotspot = 'X'.
    * This removes the column headings if the flag is set to 'X'
    fieldlayout-no_colhead = ' '.
    *fieldlayout-hotspot_fieldname = 'MAKTX'.
    fieldlayout-detail_popup = 'X'.
    * fieldlayout-coltab_fieldname = 'X'.
    endform. " POPULATE_LAYOUT
    * FORM SELECTDATA_AND_SORT *
    form selectdata_and_sort.
    select matnr meins mtart matkl from mara
    into corresponding fields of t_mara
    up to 500 rows .
    select matnr maktx spras from makt
    into corresponding fields of t_makt
    where matnr = t_mara-matnr and
    spras = sy-langu.
    select matnr werks minbe from marc
    into corresponding fields of t_marc
    where matnr = t_mara-matnr.
    append t_marc.
    endselect.
    append t_makt.
    endselect.
    append t_mara.
    endselect.
    perform populate_itab1.
    sort itab1 by matnr.
    endform. " SELECTDATA_AND_SORT
    * FORM MERGE_FIELDCATALOG *
    form merge_fieldcatalog.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
    i_program_name = syrepid
    i_internal_tabname = 'ITAB1'
    * i_structure_name = 'COLORSTRUCT'
    * I_CLIENT_NEVER_DISPLAY = 'X'
    i_inclname = syrepid
    changing
    ct_fieldcat = fieldcatalog[]
    exceptions
    inconsistent_interface = 1
    program_error = 2
    others = 3.
    endform. " MERGE_FIELDCATALOG
    * IN THIS FUNCTION THE MINIMUM PARAMETERS THAT WE NEED TO PASS IS AS
    * FOLLOWS:-
    * i_callback_program --> CALLING PROGRAM NAME
    * i_structure_name --> STRUCTURE NAME.
    * is_layout --> LAYOUT NAME.
    * it_fieldcat ---> BODY OF THE FIELD CATALOGUE INTERNAL TABLE
    form display_alv_list.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    * I_INTERFACE_CHECK = ' '
    i_callback_program = syrepid
    * I_CALLBACK_PF_STATUS_SET = ' '
    * I_CALLBACK_USER_COMMAND = ' '
    i_structure_name = 'ITAB1'
    is_layout = fieldlayout
    it_fieldcat = fieldcatalog[]
    * IT_EXCLUDING =
    * IT_SPECIAL_GROUPS =
    * IT_SORT =
    * IT_FILTER =
    * IS_SEL_HIDE =
    * I_DEFAULT = 'X'
    * THE FOLLOWING PARAMETER IS SET AS 'A' INORDER TO DISPLAY THE STANDARD
    * TOOL BAR
    i_save = 'A'
    * IS_VARIANT = ' '
    it_events = eventstab[]
    * IT_EVENT_EXIT =
    * IS_PRINT =
    * I_SCREEN_START_COLUMN = 0
    * I_SCREEN_START_LINE = 0
    * I_SCREEN_END_COLUMN = 0
    * I_SCREEN_END_LINE = 0
    * IMPORTING
    * E_EXIT_CAUSED_BY_CALLER =
    * ES_EXIT_CAUSED_BY_USER =
    tables
    t_outtab = itab1
    exceptions
    program_error = 1
    others = 2.
    endform. " DISPLAY_ALV_LIST
    *& Form POPULATE_ITAB1
    * text
    * --> p1 text
    * <-- p2 text
    form populate_itab1.
    loop at t_mara.
    loop at t_makt where matnr = t_mara-matnr.
    loop at t_marc where matnr = t_mara-matnr.
    move-corresponding t_mara to itab1.
    move-corresponding t_makt to itab1.
    move-corresponding t_marc to itab1.
    append itab1.
    endloop.
    endloop.
    endloop.
    endform. " POPULATE_ITAB1
    *& Form FILL_EVENTSTAB
    * text
    * -->P_EVENTSTAB text *
    form fill_eventstab tables p_eventstab structure eventstab.
    * WHEN THE FOLLOWING FUNCTION IS CALLED THE SYSTEM POPULATES THE
    * INTERNAL TABLE EVENTSTAB WITH A LIST OF EVENTS NAME.
    * AS SHOWN BELOW WHEN USING I_LIST_TYPE = 0 THE FUNCTION RETURNS 14
    * EVENTS NAME.
    call function 'REUSE_ALV_EVENTS_GET'
    exporting
    i_list_type = 0
    importing
    et_events = p_eventstab[]
    exceptions
    list_type_wrong = 1
    others = 2.
    * BY CALLING THE ABOVE FUNCTION WE FIRST POPULATE THE EVENTSTAB WITH
    * THE PREDEFINED EVENTS AND THEN WE MOVE THE FORM NAME AS SHOWN BELOW.
    * WE ASSIGN A FORM NAME TO THE EVENT AS REQUIRED BY THE USER.
    * FORM NAME CAN BE ANYTHING.THE PERFORM STATEMENT FOR THIS FORM
    * IS DYNAMICALY CALLED.
    read table p_eventstab with key name = slis_ev_top_of_page.
    if sy-subrc = 0 .
    move 'TOP_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_top_of_coverpage.
    if sy-subrc = 0 .
    move 'TOP_OF_COVERPAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_end_of_coverpage .
    if sy-subrc = 0 .
    move 'END_OF_COVERPAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_foreign_top_of_page.
    if sy-subrc = 0 .
    move 'FOREIGN_TOP_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_foreign_end_of_page.
    if sy-subrc = 0 .
    move 'FOREIGN_END_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_list_modify.
    if sy-subrc = 0 .
    move 'LIST_MODIFY' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_top_of_list.
    if sy-subrc = 0 .
    move 'TOP_OF_LIST' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_end_of_page.
    if sy-subrc = 0 .
    move 'END_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_end_of_list .
    if sy-subrc = 0 .
    move 'END_OF_LIST' to p_eventstab-form.
    append p_eventstab.
    endif.
    endform. " FILL_EVENTSTAB
    *& Form FILL_HEADINGTABLE
    * text
    * -->P_HEADING text *
    form fill_headingtable tables p_heading structure heading
    using tablename.
    case tablename.
    when 'HEADING'.
    p_heading-typ = 'H'.
    concatenate
    ' REPORT NAME:-' syrepid
    ' ABB Industry Pte Ltd' into p_heading-info.
    append p_heading.
    write sy-datum using edit mask '__/__/____' to sydatum.
    concatenate
    ' DATE:-' sydatum ' USER: ' sy-uname 'PAGE NO:' sypagno
    into p_heading-info.
    append p_heading.
    when 'HEADING1'.
    p_heading-typ = 'H'.
    p_heading-info = 'TOP-OF-COVER-PAGE'.
    append p_heading.
    when 'HEADING2'.
    p_heading-typ = 'H'.
    p_heading-info = 'END-OF-COVER-PAGE'.
    append p_heading.
    when 'HEADING3'.
    p_heading-typ = 'H'.
    p_heading-info = 'FOREIGN-TOP-OF-PAGE'.
    append p_heading.
    when 'HEADING4'.
    p_heading-typ = 'H'.
    p_heading-info = 'FOREIGN-END-OF-PAGE'.
    append p_heading.
    * WHEN 'HEADING5'.
    * P_HEADING-TYP = 'H'.
    * P_HEADING-INFO = 'LIST-MODIFY'.
    * APPEND P_HEADING.
    when 'HEADING6'.
    p_heading-typ = 'H'.
    p_heading-info = 'END-OF-PAGE'.
    append p_heading.
    when 'HEADING7'.
    p_heading-typ = 'H'.
    p_heading-info = 'END-OF-LIST'.
    append p_heading.
    when 'HEADING8'.
    p_heading-typ = 'H'.
    p_heading-info = 'TOP-OF-LIST'.
    append p_heading.
    endcase.
    endform. " FILL_HEADINGTABLE
    * FORM TOP_OF_PAGE *
    form top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading[]
    exceptions
    others = 1.
    endform.
    *& Form FILL_COLORSTRUCT
    * text
    * -->P_COLORSTRUCT text *
    form fill_colorstruct using p_colorstruct type slis_coltypes .
    p_colorstruct-heacolfir-col = 6.
    p_colorstruct-heacolfir-int = 1.
    p_colorstruct-heacolfir-inv = 1.
    endform. " FILL_COLORSTRUCT
    * FORM TOP_OF_COVERPAGE *
    form top_of_coverpage.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading1[]
    exceptions
    others = 1.
    endform.
    * FORM END_OF_COVERPAGE *
    form end_of_coverpage.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading2[]
    exceptions
    others = 1.
    endform.
    * FORM FOREIGN_TOP_OF_PAGE *
    form foreign_top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading3[]
    exceptions
    others = 1.
    endform.
    * FORM FOREIGN_END_OF_PAGE *
    form foreign_end_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading4[]
    exceptions
    others = 1.
    endform.
    * FORM LIST_MODIFY *
    *FORM LIST_MODIFY.
    * CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    * EXPORTING
    * IT_LIST_COMMENTARY = HEADING5[]
    * EXCEPTIONS
    * OTHERS = 1.
    *ENDFORM.
    * FORM END_OF_PAGE *
    form end_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading6[]
    exceptions
    others = 1.
    endform.
    * FORM END_OF_LIST *
    form end_of_list.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading7[]
    exceptions
    others = 1.
    endform.
    * FORM TOP_OF_LIST *
    form top_of_list.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading8[]
    exceptions
    others = 1.
    endform.
    *--- End of Program
    Regards
    Sudheer

  • How to use top_of_page in alv

    Regarding  I want to use given below format in TOP_OF_PAGE using  FUNCTION MODULE ALV_DISPLAY_GRID  HOW TO WRITE THE CODE THIS FORMAT ..
    COMPANY NAME     IFRS Balance      Time 10:53:23      Date 29.09.2010
    FRANCE
    Closing period 31.12.2009          MGERAUD001                   Page 1
    Reporting period 01-16 2010

    Hi,
    Use this code ....
    * Internal table for Top of Page info. in ALV Display
    data :   i_alv_top_of_page TYPE slis_t_listheader.
    * To build the Page header
      PERFORM sub_build_header.
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .
    * This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort                  = i_sort
    *      it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    *    MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.
    *&      Form  sub_build_header
    *       To build the header
    *       No Parameter
    FORM sub_build_header .
    * Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    * Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.
    * Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.
    ENDFORM.                    " sub_build_header
    *       FORM sub_alv_top_of_page
    *       Call ALV top of page
    *       No parameter
    FORM sub_alv_top_of_page.                                   "#EC CALLED
    * To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page
    Regards,
    Amitava

  • How to use color chart in FCX

    How would I use a color chart in FCXP?  I used to color correct using RGB values but FCXP doesn't show RGB.  How do others do it?

    I'm a lazy hobbyist, no Macbeth in use, but I bought for cheap  a White Balance plug-in from fcpeffects.com
    (they constantly offer discounts, if I remember correctly, I paid 19$).
    Then, it adds a color-picker in FCPX:
    ... if this is what you're looking for.
    Plan B)
    Use a roundtrip to DaVici Resolve, which is perhaps better suited for professional color correction than a 19$plugin
    The nice automatisms to fetch&match a Macbeth-board like other color-correction tools offer, we still have to wait for… maybe Mr Riddles forthcoming Color Finale has that feature? Next week we know...

  • How to use filter for alv display in webdynpro

    hi,
         i have use select-options and what ever data is coming from the data base i display it using alv.
    i also want to include functionality like filter and all that , that comes in normal alv.please guide me how can i do it.
    thanks

    hi please remind  that this is not the proper forum for this ...go to this
    Expert Forums » ABAP Development » UI Programming

  • How to use color picker or RGB values in the hue-saturation colorize adjustment

    I have a monochromatic adornment that I want to match to the color of a logo.  I am attempting to use the colorize option of a hue saturation adjustment layer to match color.  But I cannot quite get the colors to match.  I know the RGB values of the color, but how do these translate into the Hue/Sat/Lightness numbers of the adjustment dialog?  I tried using the correlating H/S/B values fro9m the color picker but that did not work.
    Any suggestions?

    Thanks Zeno.  Creating a layer with the color and using the blend mode worked fine.  But as I stated in the original post, using the H/S/B (there is no HSL) values from the color picker does not work when you place them into the H/S/L values in the hue-adjustment layer with (or without) the colorize box checked.  But your first suggestion worked like a charm.  Thank you.

  • How to use color labels in Bridge to inform conditional treatment in PS?

    I'm trying to find a way of using the color labels in Bridge ('select', etc.) to allow conditional use in Photoshop javascript.
    So, for example, all the images tagged with red will be sized to 600px, while those tagged with green will be sized to 400px.
    Any ideas?
    Ian

    A search of the forum for ExternalObject should find you plenty of reference…?
    You just need to load library…
    Retrieve your value…
    Do your Photoshop process ( use switch or if/else )
    Unload the library
    Done…
    If you struggle post back I may be able to help…

  • How to use CL_SALV_WD_UIE_TEXT_VIEW in ALV

    Hi,
    I want to create a text field in an ALV-Table can I use CL_SALV_WD_UIE_TEXT_VIEW.
    Greetings,
    Marcus

    Hi marcus,
    Yes you can, set it as the celleditor of the column.
    DATA:
      zlo_controller TYPE REF TO iwci_salv_wd_table,
      zlo_model     TYPE REF TO cl_salv_wd_config_table,
      zlo_textview TYPE REF TO cl_salv_wd_uie_text_view,
      zls_column  TYPE salv_wd_s_column_ref.
    CREATE OBJECT zlo_textview.
    zlo_controller = wd_this->wd_cpifc_alv( ).
    zlo_model = zlo_controller->get_model( ).
    zlt_columns = zlo_model->if_salv_wd_column_settings~get_columns( ).
    LOOP AT zlt_columns INTO zls_column.
      CASE zls_column-id.
        WHEN OTHERS.
          zls_column-r_column->set_cell_editor( zlo_textview ).
      ENDCASE.
    ENDLOOP.
    Regards,
    Jos

  • How to use usercommand in alv report

    pls let me know  as soon as as possible

    Hello Baig,
    in function module...
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            I_INTERFACE_CHECK        = ' '
            I_CALLBACK_PROGRAM       = ' '
            I_CALLBACK_PF_STATUS_SET = ' '
    <b>
    *         I_CALLBACK_USER_COMMAND  = ' '
    </b>
            I_STRUCTURE_NAME         =
            IS_LAYOUT                =
            IT_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
            I_BYPASSING_BUFFER       =
            I_BUFFER_ACTIVE          =
       IMPORTING
            E_EXIT_CAUSED_BY_CALLER  =
            ES_EXIT_CAUSED_BY_USER   =
         TABLES
              t_outtab                 =
       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.
    in bold parameters, you need to give one routine name in caps with single quotes.
    and write your own user command in that routine.
    Example:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    FORM USER_COMMAND USING R_COMMAND TYPE SY-UCOMM SELFLD TYPE SLIS_SELFIELD.
    Statements.
    ENDFORM.
    Reward if Helpful
    Regards
    Sasidhar Reddy Matli.
    Message was edited by:
            Sasidhar Reddy Matli
    Message was edited by:
            Sasidhar Reddy Matli

  • How to use subtotal in ALV report

    hi all,
    I need to find subtotal say for Event_ID(type numc) and this should come in the ALV grid intial screen itself.
    I have coded like
      gs_sort1-spos       = '1'.
      gs_sort1-fieldname  = 'EVENT_ID'.
      gs_sort1-up         = 'X'.
      gs_sort1-subtot     = 'X'.
      APPEND gs_sort1 TO gt_sort1.
    and declare gt_sort1 in FM' REUSE_ALV_GRID_DISPLAY'.. but I am  not getting the subtotal in the ALV screen
    points will be rewarded
    thanks in advance
    it is urgent

    Hi Jayasree,
    Plerase check this program
    REPORT z_demo_alv_sort.
    * This program lists orders (VBAK) with sort and sub-total for        *
    * 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG)            *
    TABLES : vbak.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECT-OPTIONS :
      s_vkorg FOR vbak-vkorg,              " Sales organization
      s_kunnr FOR vbak-kunnr,              " Sold-to party
      s_vbeln FOR vbak-vbeln.              " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA:
      BEGIN OF gt_vbak OCCURS 0,
        vkorg LIKE vbak-vkorg,             " Sales organization
        kunnr LIKE vbak-kunnr,             " Sold-to party
        vbeln LIKE vbak-vbeln,             " Sales document
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
        waerk LIKE vbak-waerk,             " Document currency
      END OF gt_vbak.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
    *      Form  f_read_data
    FORM f_read_data.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
               FROM vbak
                 UP TO p_max ROWS
              WHERE kunnr IN s_kunnr
                AND vbeln IN s_vbeln
                AND vkorg IN s_vkorg.
    ENDFORM.                               " F_READ_DATA
    *      Form  f_display_data
    FORM f_display_data.
      DEFINE m_fieldcat.
        add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname   = &1.
        ls_fieldcat-ref_tabname = 'VBAK'.
        ls_fieldcat-do_sum      = &2.
        ls_fieldcat-cfieldname  = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        add 1 to ls_sort-spos.
        ls_sort-fieldname = &1.
        ls_sort-up        = 'X'.
        ls_sort-subtot    = &2.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,
        lt_sort     TYPE slis_t_sortinfo_alv,
        ls_sort     TYPE slis_sortinfo_alv,
        ls_layout   TYPE slis_layout_alv.
      m_fieldcat 'VKORG' ''  ''.
      m_fieldcat 'KUNNR' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'NETWR' 'X' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
      m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
      m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
      m_sort 'VBELN' ''.                   " Sort by vbeln
      ls_layout-cell_merge = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                is_layout   = ls_layout
                it_fieldcat = lt_fieldcat
                it_sort     = lt_sort
           TABLES
                t_outtab    = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA
    Hope this helps...
    Best regards,
    raam

  • REUSE_ALV_VARIANT_F4' how to use it when we iuse it

    what is the use of function module REUSE_ALV_VARIANT_F4'.
    pls tell the purpodse.
    pls tell how to use this in alv report .pls give some example program .

    Hi..
        Display variant selection dialog box
    <b>Functionality</b>
        Possible entries help, if the variant is defined explicitly as an input
        field on a screen. The selection must be specified by at least partially
        filling the parameter structure IS_VARIANT.
    <b> Variant information</b>
    Description
         This structure is only relevant if display variants are to be saved
         and/or read.
         Variant information including the name of the list output variant.
         The access path must be specified in the fields REPORT (required field),
         HANDLE (optional) and/or LOG_GROUP (optional) to allow ALV to read
         display variants.
         If display variants are also to be saved, the parameter I_SAVE must also
         be entered.
         See also the documentation of the IMPORTING parameter I_SAVE.
         A variant is identified uniquely by:
         o   the program to which it is assigned (REPORT)
         o   the handle if, e.g. several lists with various structures and data
             are called (HANDLE) in a program (I_CALLBACK_PROGRAM)
             The handle is a unique user-assigned CHAR(4) field, which assigns
             the call to the current internal output table structure.
             Example:
             Various lists can be output in program x, depending on a user
             action.
             Display variants are to be able to be defined for each of these
             lists.
    <b>Header Table Name</b>
    Description
        Name of the internal table in the program containing the output data of
        the highest hierarchy level.
    <b>Item Table Name</b>
        Name of the internal table in the program containing the output data of
        the lowest hierarchy level.
    <b>Field catalog</b> containing descriptions of the list output fields (usually
    a subset of the internal output table fields).
    A field catalog is required for every ALV list output.
    The field catalog for the output table is built-up in the caller's
    coding. The build-up can be completely or partially automated by calling
    the REUSE_ALV_FIELDCATALOG_MERGE module

Maybe you are looking for

  • IPod not syncing, very strange and different problem compared to others

    I have an 80 GB iPod Classic, when i plug it in to sync with my computer. The computer makes the noise showing that the computer recognizes a USB port being used, however iTunes immediately freezes up while the iPod sits in limbo on its screen saying

  • WHT & APP

    Hi Experts, - In APP, Bank determination-->available amounts. when this field gets updated, I think it does not update after each payment run. Pl correct me? - What significance of WHT Key & Business place in WHT? please send your thoughts and assign

  • RAC Install fails with "OCR upgrade failed with (-1073741819) on 10.2.0

    I am trying to install RAC 10.2.0 with two Server 2003 R2 nodes connected to a fiber channel SAN. I have set up the shared storage, created the extended partitions, and setup the unformatted no drive letter volumes. Both servers see the unformatted v

  • How to edit iPhoto slideshow?

    In iPhoto '11 version 9.2.1 how can I add additional text slides to the photos after a slide show has been set up with some text slides initially entered? I am using the Places theme, and when I select the thumbnails at the top the Text Slide buttom

  • Bt line slamming

    I woke up today to find I have no internet or broadband. Called Sky (the company I work for and have no intentions of leaving) only to be told BT took the line over on 7th of march! I have receive no communication from either company, have no broadba