Alv report colour display

hi
i have a requirment in my alv report ,i need to show values of material description i.e  only gsm values in different colour i. 296 GSM and corresponding below values 285 GSM,.below show is sample output onf my alv report.
materialno                              material deccription
                          GB CPB HWC 296 GSM 055.000 X 092.000
                          GB CPB HWC 296 GSM 082.000 X 117.000
                          GB CPB HWC 285 GSM 045.200 X 070.500
                          GB CPB HWC 285 GSM 045.200 X 070.500
                          GBCPB HWC 285 GSM 045.200 X 070.500
                          GB CPB HWC 285 GSM 045.200 X 070.500

Hi
i am sending you a code where i had colored one field
you can refer this program and you can understand very well where exactly what we have to do for colors
reward if usefull
REPORT zalv_with_colored_fields  .
TYPE-POOLS : slis.
DATA : BEGIN OF it_final1 OCCURS 0,
         carrid TYPE spfli-carrid,
         connid TYPE spfli-connid,
         cityfrom TYPE spfli-cityfrom,
         cityto TYPE spfli-cityto,
         cellcolors TYPE lvc_t_scol,
         END OF it_final1 .
DATA : BEGIN OF it_final OCCURS 0,
         carrid TYPE spfli-carrid,
         connid TYPE spfli-connid,
         cityfrom TYPE spfli-cityfrom,
         cityto TYPE spfli-cityto,
         END OF it_final .
DATA : git_cellcolors TYPE TABLE OF lvc_s_scol,
       gwa_color    TYPE lvc_s_scol,
       layout       TYPE slis_layout_alv.
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
       wa_fieldcat LIKE LINE OF it_fieldcat.
START-OF-SELECTION .
  SELECT carrid connid cityfrom cityto FROM spfli INTO TABLE it_final .
  wa_fieldcat-col_pos   = '0'.
  wa_fieldcat-tabname   = 'IT_FINAL' .
  wa_fieldcat-fieldname = 'CARRID' .
  wa_fieldcat-seltext_m = 'Carrier ID'(001) .
  APPEND wa_fieldcat TO it_fieldcat .
  wa_fieldcat-col_pos   = '1'.
  wa_fieldcat-tabname   = 'IT_FINAL' .
  wa_fieldcat-fieldname = 'CONNID' .
  wa_fieldcat-seltext_m = 'Flight Connection Number'(002) .
  APPEND wa_fieldcat TO it_fieldcat .
  wa_fieldcat-col_pos   = '2'.
  wa_fieldcat-tabname   = 'IT_FINAL' .
  wa_fieldcat-fieldname = 'CITYFROM' .
  wa_fieldcat-seltext_m = 'City from'(003) .
  APPEND wa_fieldcat TO it_fieldcat .
  wa_fieldcat-col_pos   = '3'.
  wa_fieldcat-tabname   = 'IT_FINAL' .
  wa_fieldcat-fieldname = 'CITYTO' .
  wa_fieldcat-seltext_m = 'City to'(004) .
  APPEND wa_fieldcat TO it_fieldcat .
  LOOP AT it_final .
    it_final1-carrid   = it_final-carrid.
    it_final1-connid   = it_final-connid.
    it_final1-cityfrom = it_final-cityfrom.
    it_final1-cityto   = it_final-cityto.
    CLEAR gwa_color.
  <b>  IF it_final-carrid    = 'AA' .
      gwa_color-fname     = 'CARRID'.
      gwa_color-nokeycol  = '1'.
     gwa_color-color-col = '6'.
      gwa_color-color-int = '1'.</b>
      APPEND gwa_color TO git_cellcolors.
      it_final1-cellcolors = git_cellcolors.
    ENDIF.
    IF it_final-carrid    = 'AZ' .
      gwa_color-fname     = 'CARRID'.
     gwa_color-nokeycol  = '1'.
      gwa_color-color-col = '5'.
      gwa_color-color-int = '1'.
      APPEND gwa_color TO git_cellcolors.
      it_final1-cellcolors = git_cellcolors.
    ENDIF.</b>
    REFRESH git_cellcolors.
    APPEND it_final1.
    CLEAR : it_final , it_final1 .
  ENDLOOP.
  layout-coltab_fieldname = 'CELLCOLORS'.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      is_layout   = layout
      it_fieldcat = it_fieldcat
    TABLES
      t_outtab    = it_final1.

Similar Messages

  • ALV report which displays Delivery and Invoice details..by linking vbfa.

    Hi...
    I wants to develop an ALV Report, which displays Delivery details as well as Invoice details for a range of given sale orders.
    For this report I am using Tables : VBAK,VBAP,LIKP,LIPS,VBFA tables .
    Here VBFA is a table for Document flow how to link this with report ??
    Please reply.
    Regards ,
    ASHOK
    Moderator message : Not enough re-search before posting, spec dumping not allowed. Thread locked.
    Edited by: Vinod Kumar on Aug 1, 2011 9:58 AM

    VBFA has VBELV and POSNV can be used to map VBAP (sales order item) i.e.
    VBFA-VBELV = VBAP-VBELN AND
    VBFA-POSNV = VBAP-POSNV
    with VBTYP_N = J Values available in VBFA-VBELN and VBFA-POSNN will be LIPS -VBELN and LIPS-POSNR
    VBTYP_N/ VBTYP_V = J stands for delivery and C stands for order
    Nitesh

  • ALV Report to display the status of the requests raised through ESS

    Hi All,
    We have to develop a ALV report to display the status of the requests raised through ESS
    for Leave, Travel & Event Management, Travel and Appraisal workflows.
    ESS Travel, ESS TEM, ESS Apraisal workflows are associted with SAP Business Objects.
    we are using the function module SWI_WORKITEMS_OF_OBJTYPE_GET to get
    the top level work item id's by passing the object type like PDRELA_025, BUS2089.
    By using SWP_WORKFLOW_LOG_READ function we are getting the workflow log
    by passing top level work item id's as imort parameter. 
    The report output should have the following fields
    Initiator, Initiator Personal No, Request Type( Leave, Travel etc.. )
    Date of application of the request, Status ( Approved by RM, Rejected etc )
    Name of the Approver, Approved / Rejected Date.
    The logic should be work for all the above ESS workflows and should be generalized.
    Can any one please let me know the procedure to get the required information from the workflow log.
    It would be great if any one suggest on the same how to proceed further to get the information as mentioned above.
    Thanks & Regards,
    Jagadeeswara Rao Balla.

    Hello,
    You can get most of that information from fm SAP_WAPI_GET_HEADER, input is workitem_id.
    regards
    Rick Bakker
    Hanabi Technology

  • How to devolped an Interactive ALV Report to display sales orders

    hi,
             how to devolped an Interactive ALV Report to display sales orders pertaining to the selected Customers and item details in the secondary list.For this report what are the tables and fields wehave to used give with example.
    thank you
    radhakrishna

    Hi,
    look via se38 for BCALV* and SALV*.
    Try ABAPDOCU.
    Regards, Dieter

  • Update SAP tables after ALV report is displayed

    Hi All,
    I have to display a ALV report using function module REUSE_ALV_GRID_DISPLAY.
    After the report is displayed, user can edit some of the flds in the report, and the fields need to updated in the table. How do I proceed to accomplish this.
    Is it possible to use FM 'REUSE_ALV_DRID_DISPLAY' to do this or we need to use OOPS ALV to do this. 
    I searched for this in this forum, but couldnt get.
    Thanks in advance,
    Ananth

    You can use the REUSE_ALV_GRID_DISPLAY. and can make it a changable. You can specify the column to be changable. Once the user enters data into that coloumn the interna table automatically gets populated with the values.
    I have done a similar program. However you might need to copy some standard GUI status based on your requirements.
    Whats ur mail ID. I can send you the program I have developed.
    Shreekant

  • ALV-Header colour display

    hi i  need to display my header of alv in colour format...
    can u tell me function module what is used for this requirement.....
    advance thanks ........................urgent

    Hi Dasr,
      What do you mean by header of ALV? Do you mean column header or a box where we can write our own text?
    Regards,
    kiran i

  • ALV report to display data based upon radio button.

    i am new to abap, I have a requirement its like there are three radio buttons , r1 r2 r3  If i click r1 datas of r1 should display
    if i click r2 datas of r1 and r2 should display if i click r3 datas of r1 r2 and r3 should display , its ALV report. Please give me solution.

    Hi
    You can use by having the radio buttons in the same group. For ex i'm stating if want to have r radio buttons for change, display and create and you select it with a push button you can code it as ..
    //////SAMPLE CODE
    SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-003 NO INTERVALS.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: SRCE RADIOBUTTON GROUP ELE.
    SELECTION-SCREEN COMMENT 3(15) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: VARIN RADIOBUTTON GROUP ELE.
    SELECTION-SCREEN COMMENT 3(15) TEXT-005.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: ATTR RADIOBUTTON GROUP ELE.
    SELECTION-SCREEN COMMENT 3(15) TEXT-006.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: DOCU RADIOBUTTON GROUP ELE.
    SELECTION-SCREEN COMMENT 3(15) TEXT-007.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS: TXELE RADIOBUTTON GROUP ELE.
    SELECTION-SCREEN COMMENT 3(15) TEXT-008.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN PUSHBUTTON 1(15)  TEXT-009 USER-COMMAND DISPL.
    SELECTION-SCREEN PUSHBUTTON 18(15) TEXT-010 USER-COMMAND CHNGE.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK BLOCK1.
    *PARAMETERS : XXX LIKE T100A-ARBGB MATCHCODE OBJECT YCL_T100A.
    AT SELECTION-SCREEN.
    CASE SY-UCOMM.
    WHEN 'CREAT'.
      MESSAGE I000(YCL_MC01) WITH 'Create'. // or insert your alv code here
    WHEN 'DISPL'.
      MESSAGE I000(YCL_MC01) WITH 'Display'. // or insert your alv code here
    WHEN 'CHNGE'.
      MESSAGE I000(YCL_MC01) WITH 'Change'. // or insert your alv code here
    ENDCASE.
    //////SAMPLE CODE
    In same you can code it.
    Hope this is useful to you.
    Regards
    Vinodh

  • Displaying selection screen details in Alv Report  output display as Header

    Hi all,
    May be somebody knows how I can show selected values with select-options in top_of_page using REUSE_ALV_GRID_DISPLAY.
    This shoud work for all the reports and diff selection screens .
    I need one dynamic process which will for display any report selection screen selected details.(Basically varient information of report).
    Small example if possible, please.
    Thanks in advance,
    Rimas

    Hi Thiru,
    Thanks for the input.
    This is my exact requirement.
    Hi Experts,
    I would like to Display / Print  Select-options selected details in ALV Header.
    Ex: Say suppose here i enter kunnr as 1000
                                            lifnr as    2000 to 4000
                                            p_langu as  'EN'.
                                           p_dir  as 'C:\TEMP,
                                           p_upda as 'X'
    for selection screen below.                    
    SELECTION-SCREEN :BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS : s_kunnr FOR kna1-kunnr.
    SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr.
    PARAMETER      : p_lanuge LIKE t002-spras DEFAULT sy-langu.
    PARAMETER: p_dir  LIKE rlgrap-filename
               DEFAULT text-003 LOWER CASE.
    PARAMETERS: p_upd AS CHECKBOX DEFAULT 'X'.
    I dont want to Hard code selection screen values like
    DATA: header TYPE slis_t_listheader,
    wa TYPE slis_listheader,
    wa-typ = 'S'(093).
      wa-key = s_lifnr .
      wa-info = 'Vendor no".
      APPEND wa TO header.
    I want dynamic process for all of my selection screen values selected
    hard code may be it will be fine small selection screen it will work.
    Fur that i got one process to get dynamically through fm
    Ex: DATA: irsparams TYPE rsparams OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = program
    TABLES
    selection_table = irsparams
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    loop at irsparams.
    write : / irsparams-SELNAME.
    write : / irsparams-SIGN.
    write : / irsparams-OPTION.
    write : / irsparams-LOW.
    write : / irsparams-HIGH.
    endloop.
    I have done my requirement partially but i am failed to achive my full  requirement.
    Because
    rsparams  strcture is diff from  slis_t_listheader.
    Can any one help me for further assistence to display irsparams strcture data in alv header.
    Thanks
    Nag

  • ALV report : to display description in two lines.

    Hi all,
    In a ALV grid display,  I want to print description(40 characters) of a field in two lines(20 characters in each).
    Please suggest me how to achive the same.
    Thanks in advance.

    make the description field of 20 char legth in your final internal table.
    while passing data to your final internal table, pass all fields along with 20chars from description to one line of final table and in the same loop add another row with all fields blank but the description with rest of the fields..
    loop at it_1 into it_s.
    is_final-desc = it_s-desc+0(20).
    apppend is_fianl to it_final.
    clear is_final.
    is_fianl-desc = it_1-desc+20(20).
    apppend is_fianl to it_final.
    clear it_s.
    endloop.

  • ALV reports- list display

    Hi,
    I need to download a report and save it to  a unix directory defined by a variant. Please help me out with this.

    check this..
    for the unit directory use this..
    *-- Read the Values entered in the selection screen.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-repid
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = it_scrfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    for writing the file use this...
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      if sy-subrc ne 0.
        message e368(00) with 'Error opening output file:' p_file.
      endif.
      LOOP AT it_final INTO wa_final .
        TRANSFER wa_final TO p_file .
      ENDLOOP.
      IF sy-subrc = 0.
        MESSAGE s043 WITH 'Data downloaded succesfully'(014).
      ENDIF.
      CLOSE DATASET p_file.

  • Displaying special characters in ALV report.

    Hi Experts,
    Can we display special characters in ALV reports? Special characters such as tick mark.(Like in character map(Font Bookshelf  Symbol 7) of windows ).
    I tried with icons in ALV report, I was able to display tick icon in the ALV report, but when we export the report in to a excel, the icons comes in as Hexadecimal code.
    Can any we display special characters like tick in ALV report or display the icons in excel aswell?
    I will be gratefull for the <urgency reduced by moderator> response.
    Regards,
    Sharath.
    Edited by: Thomas Zloch on May 10, 2011 10:26 AM

    Sharath,
    I think it is possible to do so.
    Please check this link.
    http://www.sapfans.com/forums/viewtopic.php?f=13&t=322569
    Thanks,
    Guru.

  • How to read complete line displayed thru ALV report on double click? urgent

    Hi guys,
    An ALV report is displayed using 'REUSE_ALV_LIST_DISPLAY' and i have a requirement such that i have to read the line item on which double click is done.
    I have to fetch the line item, field by field and not by characters. I have attached the function code and all using PF status.
    Please tell me an approach as how to fetch the line item on which double click is done.
    Points will be rewarded.
    Regards
    Rahul

    Hi  ..
    i did  report  with  belnr  , bukrs  ,  Gjahr  . which will  call the  transcation code  FB03 displaing thedocument  ...
    please  cut and  paste the report  it will work ..
    REPORT  zdemo_alvgrid                 .
    TABLES:   bkpf . "  ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    BUKRS   like  bkpf-BUKRS,
    BELNR like  bkpf-BELNR,
    GJAHR like  bkpf-GJAHR,
    BLART like  bkpf-BLART,
    BLDAT like  bkpf-BLDAT,
    BUDAT like  bkpf-BUDAT,
    MONAT like  bkpf-MONAT,
    XBLNR like  bkpf-XBLNR ,
    *  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,
    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,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    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   = 'BUKRS'.
      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   = 'BELNR'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      fieldcatalog-outputlen   = 10.
       fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
        append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'GJAHR'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
        append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLART'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLDAT'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUDAT'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MONAT'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'XBLNR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
    *  fieldcatalog-do_sum      = 'X'.
    *  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).
    *  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_events
                is_print                = gd_prntparams
                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.
    select BUKRS
    BELNR
    GJAHR
    BLART
    BLDAT
    BUDAT
    MONAT
    XBLNR  up to 10 rows
      from bkpf
      into table it_ekko.
    *select ebeln ebelp statu aedat matnr menge meins netpr peinh
    * up to 10 rows
    *  from ekpo
    *  into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    * Form  TOP-OF-PAGE                                                 *
    * ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    * Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    * Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    * Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    endform.
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'BELNR'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD   wa_ekko-bELNR  .
          SET PARAMETER ID 'MES' FIELD   wa_ekko-bUKRS  .
          SET PARAMETER ID 'DES' FIELD    wa_ekko-GJAHR .
    *     Sxecute transaction ME23N, and skip initial data entry screen
    *      CALL TRANSACTION 'FB03' AND SKIP first screen.
    SUBMIT RFBUEB00
    *        WITH ALCUR ...
    *        WITH ARCHOBJ ...
    *        WITH ARCH_SEL ...
    *        WITH ARUSETYP ...
    *        WITH AUTBEXNO ...
    *        WITH AUTH_BUK ...
    *        WITH AUTH_LDR ...
    *        WITH BR_AWKEY ...
    *        WITH BR_AWSYS ...
    *        WITH BR_AWTYP ...
            WITH BR_BELNR =  wa_ekko-bELNR
    *        WITH BR_BLART ...
    *        WITH BR_BLDAT ...
    *        WITH BR_BUDAT ...
            WITH BR_BUKRS =    wa_ekko-bUKRS
    *        WITH BR_CPUDT ...
            WITH BR_GJAHR  =  wa_ekko-GJAHR
    *        WITH BR_RLDNR ...
    *        WITH BR_SEQ ...
    *        WITH BR_USNAM ...
    *        WITH BR_XBLNR ...
    *        WITH EXCDT ...
    *        WITH P_STATS ...
    *        WITH STATISTK ...
    *        WITH STATUSD ...
    *        WITH STATUSL ...
    *        WITH STATUSM ...
    *        WITH STATUSS ...
    *        WITH STATUSV ...
    *        WITH TCODE ...
    *        WITH UNAME ...
    *        WITH XEMUCNV ...
    *        WITH XUSEAR ...
    *        WITH XUSEAS ...
    *        WITH XUSEDB
            AND RETURN  .
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
    *       Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
    *       Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    reward points if it is  usefull ...
    Girish

  • Automatic Display of NEW Data in ALV Report using Classes and Methods

    Hi,
    I have developed a ALV Report for displaying data from a set of DB tables using ABAP OO, Classes and Methods. The requirement is to have the report output to be automatically updated with the new entries from the DB table at a regular frequency of tiem may be every two minutes.
    Could anyone please tell me how can this be acheived.
    Thanks and regards,
    Raghavendra Goutham P.

    Yes its possible.
    Take a look at this thread
    Auto refresh of ALV Grid, without user interaction
    Or Rich's blog
    /people/rich.heilman2/blog/2005/10/18/a-look-at-clguitimer-in-46c
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • ALV report display

    Can the fields on the ALV report be displayed in a certain column or is it can only be displayed left justified for alpha field and right justified for numeric field?

    Use COL_POS to set the position and use JUST to justify the field in field catalog
    (R)ight
    (L)eft
    (C)ent.

  • ALV .  How to remove the sort buttons on toolbar in ALV report?

    Hi,experts
      As you know, in default case , the alv report will display two sort buttons(ascending ,descending) on its toolbar , So How to remove the sort buttons on toolbar in ALV report?
      Thanks for your help .

    Hi guixin,
    1. Before calling REUSE_ALV_LIST_DISPLAY
    2. Write this code :
    data : excl type SLIS_T_EXTAB.
    data : exclwa type SLIS_EXTAB.
    exclwa = '&OUP'.
    append exclwa to excl.
    exclwa = '&ODN'.
    append exclwa to excl.
    3. Then while calling the FM,
       pass this parameter also .
    IT_EXCLUDING     = excl
    It will work fantastic.
    regards,
    amit m.

Maybe you are looking for