How to devide the top of page in alv grid display

hi all
in the alv grid display am getting the page number and total number of pages in the left hand side
but what i need is i need in the right hand side
how to get that

Hi,
PLease refer to the code below:
*& Report  ZDEMO_ALVGRID                                               *
*& Example of a simple ALV Grid Report                                 *
*& The basic requirement for this demo is to display a number of       *
*& fields from the EKKO table.                                         *
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,
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   = '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-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 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 = 'EBELN'.
*     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-ebeln.
*     Sxecute transaction ME23N, and skip initial data entry screen
      CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
    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.
Thanks,
Sriram Ponna.

Similar Messages

  • How to give colors to the top-of-page in ALV Grid

    How to give colors to the top-of-page in ALV Grid
    in table GT_LIST_TOP_OF_PAGE i am filling 3 rows ,i need 3 different colors to be displyed on top-of-page(one color to one row)
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    I_LOGO = 'ENJOYSAP_LOGO'
    IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    please help mee

    HI Kranthi,
    Check out teh foll. link,
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    Hope this helps.

  • How to give colors to the top-of-page in ALV List Display

    how to give colors to the top-of-page in ALV List Display....

    Check this blog.........
    It provides your required output...........
    /people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid
    See the point 7 for complete code...
    Regards,
    Pavan

  • Top of page in ALV GRID display

    Hi All,
    Is it possible to have a top of page in ALV grid display?
    If yes, then how?
    Thanks and Regards,
    Sirisha

    hi
    check out the following code:
    report  z_alv2 line-count 20.
    type-pools : slis.
    type-pools : icon.
    tables:
    lfa1, lfb1, lfm1.
    selection-screen begin of block b1  with frame title text-001.
    select-options:
    s_lifnr for lfa1-lifnr, "VENDOR
    s_bukrs for lfb1-bukrs, "COMPANY CODE
    s_ekorg for lfm1-ekorg, "PURCHASING ORGANIZATION
    s_ktokk for lfa1-ktokk. "ACCOUNT GROUP
    selection-screen end of block b1.
    selection-screen begin of block b2  with frame title text-002.
    parameters: r1 radiobutton group g1,
                r2 radiobutton group g1.
    selection-screen end of block b2.
    data:
          v_repid like sy-repid,
          begin of itab occurs 0,
          lifnr like lfa1-lifnr,
          bukrs like lfb1-bukrs,
          ekorg like lfm1-ekorg,
          ktokk like lfa1-ktokk,
          name1 like lfa1-name1,
          stras like lfa1-stras,
          ort01 like lfa1-ort01,
          regio like lfa1-regio,
          pfort like lfa1-pfort,
          pstlz like lfa1-pstlz,
          pstl2 like lfa1-pstl2,
          telf1 like lfa1-telf1,
          end of itab.
    data : itab_event type slis_t_event,
           wa_event   type slis_alv_event.
    data : itab_fld_cat  type slis_t_fieldcat_alv,
           wa_fldcat     type slis_fieldcat_alv.
    data : wa_layout     type slis_layout_alv.
    start-of-selection.
    *PERFORM GET_VARIANT.
    PERFORM data_validation.
      perform select_data.
      perform get_events using itab_event .
      perform fieldcatmerge.
      if r1 = 'X'.
        perform alvlistdisplay.
      elseif r2 = 'X' .
        perform alvgriddisplay.
      endif.
    *&      Form  DATA_VALIDATION
          text
    -->  p1        text
    <--  p2        text
    form data_validation .
      data: v_count type i.
      if s_lifnr is initial and
         s_bukrs is initial and
         s_ekorg is initial and
         s_ktokk is initial.
        message e000(z13325).
      Enter any value in the Selection Screen
      endif.
      select count(*) from lfa1 where lifnr in s_lifnr.
      if sy-subrc <> 0.
        message e000(z13325).
      Enter any value in the Selection Screen
      endif.
      select count(*) from lfb1 where lifnr in s_bukrs.
      if sy-subrc <> 0.
        message e000(z13325).
      Enter any value in the Selection Screen
      endif.
      select count(*) from lfm1 where lifnr in s_ekorg.
      if sy-subrc <> 0.
        message e000(z13325).
      Enter any value in the Selection Screen
      endif.
      select count(*) from lfa1 where lifnr in s_ktokk.
      if sy-subrc <> 0.
        message e000(z13325).
      Enter any value in the Selection Screen
      endif.
    endform.                    " DATA_VALIDATION
    *&      Form  SELECT_DATA
          text
    -->  p1        text
    <--  p2        text
    form select_data .
      select a~lifnr
             b~bukrs
             c~ekorg
             a~ktokk
             a~name1
             a~stras
             a~ort01
             a~regio
             a~pfort
             a~pstlz
             a~pstl2
             a~telf1
          into corresponding fields of table itab
          from lfa1 as a inner join lfb1 as b
                         on alifnr = blifnr
                         inner join lfm1 as c
                         on alifnr = clifnr
                         where a~lifnr in s_lifnr
                         and b~bukrs in s_bukrs
                         and c~ekorg in s_ekorg
                         and a~ktokk in s_ktokk.
      sort itab by lifnr bukrs ekorg.
    endform.                    " SELECT_DATA
    *&      Form  FIELDCATMERGE
          text
    -->  p1        text
    <--  p2        text
    form fieldcatmerge .
      v_repid = sy-repid.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
       exporting
         i_program_name               =  v_repid
         i_internal_tabname           =  'ITAB'
        I_STRUCTURE_NAME             =
        I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = v_repid
        I_BYPASSING_BUFFER           =
        I_BUFFER_ACTIVE              =
        changing
          ct_fieldcat                  = itab_fld_cat
       exceptions
         inconsistent_interface       = 1
         program_error                = 2
         others                       = 3.
      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.                    " FIELDCATMERGE
    *&      Form  ALVLISTDISPLAY
          text
    -->  p1        text
    <--  p2        text
    form alvlistdisplay .
      v_repid = sy-repid.
      call function 'REUSE_ALV_LIST_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        = ' '
      I_STRUCTURE_NAME               =
          is_layout                      = wa_layout
          it_fieldcat                    = itab_fld_cat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
          i_default                      = 'X'
       I_SAVE                         = 'A'
      IS_VARIANT                     =
          it_events                      = itab_event
       IT_EVENT_EXIT                 = itab_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
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
        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.                    " ALVLISTDISPLAY
    *&      Form  ALVGRIDDISPLAY
          text
    -->  p1        text
    <--  p2        text
    form alvgriddisplay .
      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           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'GRID DISPLAY'
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = WS_LAYOUT1
          it_fieldcat                       =  itab_fld_cat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
          it_events                         = itab_event
       IT_EVENT_EXIT                     = itab_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_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        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.                    " ALVGRIDDISPLAY
    *&      Form  GET_EVENTS
          text
    -->  p1        text
    <--  p2        text
    form get_events using itab_event type slis_t_event.
      call function 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      I_LIST_TYPE           = 0
       importing
          et_events             = itab_event
       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.
    read table itab_event with key name = slis_ev_top_of_page into wa_event
      if sy-subrc = 0.
        wa_event-form = 'FRM_TOP_OF_PAGE'.
        modify itab_event from wa_event index sy-tabix.
      endif.
    endform.                    " GET_EVENTS
    *&      Form  FRM_TOP_OF_PAGE
          text
    form frm_top_of_page.
    write : 130 'Time:'  ,sy-uzeit  .
      write :/2 'User: ', sy-uname.
      write: 59 sy-title, 130 'Page:' , sy-pagno.
      write:/ 'this is swathi and this is top of page '.
    endform.                    "FRM_TOP_OF_PAGE
    Reward points if helpful.
    Regards
    Swathi

  • TOP OF PAGE in ALV Grid Display in ECC 6.0

    Hi,
    I have an issue with top of page in Alv grid display
    in ECC 6.0. I searched  the forum for this, but
    couldnt fine any solution.
    I am using Reuse_alv_commentary_write to display the header.
    It's working fine in 4.7E but the same code is not working in
    ECC 6.0. The header is shown as  empty.
    I tried to execute some other programs with same FM and
    even standard SAP Prgrms too, even they raise the same issue
    the top of page is empty.
    Please suggest any other FM or approach to use in ECC 6.0 to get the top of page.
    Thanks in advance
    Kaavya.

    hiii
    use following code
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                = ' '
    *     I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = sy-repid
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
         I_CALLBACK_TOP_OF_PAGE            = 'F0020_TOP_OF_PAGE'
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
         i_structure_name                  = 'I_OUTPUT'
    *     I_BACKGROUND_ID                   = ' '
    *     I_GRID_TITLE                      =
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT                       = wa_layout
         it_fieldcat           = i_fieldcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS                 =
    *     IT_SORT                           =
    *     IT_FILTER                         =
    *     IS_SEL_HIDE                       =
         i_default                         = 'X'
         i_save                            = 'X'
         is_variant                        = wa_variant
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT                          =
    *     IS_REPREP_ID                      =
    *     I_SCREEN_START_COLUMN             = 0
    FORM f0020_top_of_page.
      DATA: i_listheader TYPE slis_t_listheader WITH HEADER LINE,
            w_date like sy-datum.
      move:
        'H'   TO i_listheader-typ,
        '                 Corporation'   TO i_listheader-info.
    *    text-021    TO i_listheader-info.
    *write: 'Camtura Corporations'.
      APPEND i_listheader.
      WRITE sy-datum TO w_date.
      move:
        'S'   TO i_listheader-typ,
        'Execution date'   TO i_listheader-key,
        w_date     TO i_listheader-info.
      APPEND i_listheader.
    regards
    twinkal

  • How to gve the colors to the TOP-OF-PAGE in ALV Grid Disply..

    i want to give 3 different colors in the top-of-page(there are three different lines each line should disply in different colors)...
      plaese tell me how can i do that...........

    Hi
    Try like this...
    form build_events.
      clear   gv_event.
      refresh i_events.
    Get the ALV events
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = i_events
        exceptions
          list_type_wrong = 1
          others          = 2.
      if sy-subrc = 0.
        sort i_events by name.
      endif.
    Form for Top-of-Page ---------------------------------*
      read table i_events with key name = slis_ev_top_of_page
                                          into gv_event
                                          binary search.
      if sy-subrc = 0.
        move gc_top_of_page to gv_event-form.
        modify i_events from gv_event index sy-tabix.
      endif.
    Form for End-of-List ---------------------------------*
      read table i_events with key name = slis_ev_end_of_list
                                          into gv_event
                                          binary search.
      if sy-subrc = 0.
        move gc_end_of_list to gv_event-form.
        modify i_events from gv_event index sy-tabix.
      endif.
    Specify the ALV layout
      wa_layout-max_linesize = gv_linsz.
      wa_layout-min_linesize = gv_linsz.
    endform.                    " build_events
    form top_of_page_d.                                        
      format color col_heading.
      write: / 'Satyanarayana'
      format color col_total.
      write: / 'Sayana'.
      format reset.
    endform.
    Satya.

  • Can we create the longer lines in the top-of-page in ALV Grid

    Dear Experts,
    I want to display longer characters in the TOP-OF-PAGE in the ALV GRID .
    ( more than 60 character up to 150 ).
    Is there any possible FM.
    Kindly provide.
    Regards
    R.Rajendran

    hI rANGA,
    I think upto 60 char is possible.
    Thanks
    Vincent

  • How to get the SAVE Layout  ICON on ALV Grid display report

    Hi,
      I am using the standard ALV Layout, and I do not get the SAVE LAYOUT Icon on the Menubar, where I could save the report Layout.I am using the layout routine as,
    FORM layout_build USING   u_lf_layout TYPE slis_layout_alv.
      u_lf_layout-box_fieldname       = 'SELK'.  " Checkbox
      u_lf_layout-zebra               =  'X'.
      u_lf_layout-colwidth_optimize   =  'X'.
      u_lf_layout-confirmation_prompt =  'X'.
      u_lf_layout-get_selinfos        =  'X'.
      u_lf_layout-f2code              =  '&ETA' .
      u_lf_layout-detail_titlebar     =  'Delivery Due List'.
      u_lf_layout-key_hotspot         =  'X'.
      u_lf_layout-info_fieldname      =  'COL'.
    ENDFORM.                    " layout_build
    Is there anything that I am missing. Please suggest.Many thanks for your help.
    Regards,
    Mira

    Hi,
    i think you've forgotten param. <b>i_save</b>
      x_save = 'X'.
      gs_variant-report     = sy-repid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_STRUCTURE_NAME = 'ZTAB01'
                IS_VARIANT       = gs_variant
                IS_layout        = lay
                I_SAVE           = x_save
           TABLES
                T_OUTTAB         = gridtab
           EXCEPTIONS
                OTHERS           = 1.
    regards Andreas

  • How i can show the selection screen input field in the top of page in alv

    hi ,
              how i can show the selection screen input field in the top of page in alv  grid output.
    tell me the process

    Hi,
    excample from my program:
    FORM topof_page.
      DATA: l_it_header   TYPE TABLE OF slis_listheader WITH HEADER LINE,
            l_info        LIKE l_it_header-info.
      DATA: l_it_textpool TYPE TABLE OF textpool WITH HEADER LINE.
      DATA: l_key LIKE l_it_textpool-key.
      READ TEXTPOOL c_repid INTO l_it_textpool LANGUAGE sy-langu.
      DEFINE m_selinfo.
        if not &1 is initial.
          clear l_it_header.
          l_it_header-typ   = 'S'.
          l_key = '&1'.
          translate l_key to upper case.
          read table l_it_textpool with key key = l_key.
          if sy-subrc = 0.
            shift l_it_textpool-entry left deleting leading space.
            l_it_header-key = l_it_textpool-entry  .
          endif.
          loop at &1.
            case &1-option.
              when 'EQ'
                or 'BT'
                or 'CP'.
                write &1-low to l_it_header-info.
              when others.
                write &1-low to l_it_header-info.
                concatenate &1-option
                            l_it_header-info
                       into l_it_header-info
                       separated by space.
            endcase.
            if not &1-high is initial.
              write &1-high to l_info left-justified.
              concatenate l_it_header-info
                          l_info
                     into l_it_header-info
                     separated by space.
            endif.
            if &1-sign = 'E'.
              concatenate ']'
                          l_it_header-info
                     into l_it_header-info.
            endif.
            append l_it_header.
            clear: l_it_header-key,
                   l_it_header-info.
          endloop.
        endif.
      END-OF-DEFINITION.
      m_selinfo: s_trmdat,
                 s_trmext,
                 s_trmint,
                 s_fkdat,
                 s_delno,
                 s_vbeln,
                 s_deact,
                 s_kdmat.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = l_it_header[].
    ENDFORM.
    I hope, this will help you.
    Regards
    Nicole

  • How to print the top of page part along with the ALV list and generate PDF

    HI all,
             I have created one ALV by using oops concept .
             and also am able to get the top of page where I have One standard logo on the right hand side
             and some details on the left side .
               Now my requirement is to while printing the list the logo and other top of page details should appear
               In the PDF output but currently while am pressing the print preview button only the alv data is coming
              am already using the method
        handle_top_of_page
          FOR EVENT print_top_of_page
                 OF cl_gui_alv_grid,
    may be am missing something ... How to get the top of page along with the logo printed ?

    Hi  Surya,
    After generating the grid display  click on print button,
    a spool number is generated. capture the spool number and convert it to pdf using the fm:
    CONVERT_ABAPSPOOLJOB_2_PDF  and save the file
    Hope this will solve your problem.
    Regards,
    R K.

  • How to declare top of page in alv grid disply

    Hi
    Can any ine let me know how to declare the top -of -page??
    Arun Joseph

    Hi , check this one u will get easily .
    *& Report  ZMM_ANNEXURE4_ALV
    REPORT  ZMM_ANNEXURE4_ALV1.
    TYPE-POOLS SLIS .
    TABLES : J_1IEXCHDR,
             J_1IEXCDTL,
             J_1IGRXSUB,  " FOR QTY
             LFA1,    " Vendor Master
             ADRC,    " Vendor Address
             MSEG,    " Batch - Identification Marks
             MKPF.    "
    DATA : IT_J_1IEXCHDR LIKE J_1IEXCHDR OCCURS 0 WITH HEADER LINE.
    DATA : IT_MSEG LIKE MSEG OCCURS 0 WITH HEADER LINE.
    DATA : IT_J_1IEXCDTL LIKE J_1IEXCDTL OCCURS 0 WITH HEADER LINE.
    DATA : IT_J_1IGRXSUB LIKE J_1IGRXSUB OCCURS 0 WITH HEADER LINE.
    DATA : IT_MSGE LIKE MSEG OCCURS 0 WITH HEADER LINE.
    DATA : IT_LFA1 LIKE LFA1 OCCURS 0 WITH HEADER LINE.
    DATA : IT_ADRC LIKE ADRC OCCURS 0 WITH HEADER LINE.
    DATA : IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE.
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          it_listheader type slis_t_listheader,
          it_events     type slis_t_event,
          it_fieldcat type slis_t_fieldcat_alv,
          gd_tab_group type slis_t_sp_group_alv,
          IS_layout    type slis_layout_alv,
          SELL_MODE TYPE SLIS_T_SP_GROUP_ALV,
          gd_repid     like sy-repid.
    INCLUDE <symbol>.
    INCLUDE <icon>.
    *DATA : TEXT1(100) TYPE C.
    *DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : V_FIELDCAT  TYPE SLIS_FIELDCAT_ALV.
    DATA : V_QTY LIKE EKPO-MENGE.
    DATA : V_VAL LIKE MARA-NTGEW.   " For calculation of Qty
    DATA : V_VAL1 TYPE STRING.      " For calculation of Qty
    DATA : V_Q  TYPE STRING.        " Variable for calculating
                                    " burning loss
    DATA : V_WST TYPE STRING.       " Variable 4 WasteM.
    DATA : V_WST1 TYPE STRING.      " Variable 4 WasteM.
    DATA : V_SCPGN LIKE MSEG-MENGE.
    DATA : V_WUNIT TYPE STRING.
    DATA : V_QFPG1 TYPE STRING.
    DATA : V_QFPG2 TYPE STRING.
    DATA : V_AQTY TYPE STRING.
    DATA : V_QTYR LIKE J_1IEXCDTL-MENGE.
    DATA : V_QTYR1 TYPE STRING.
    DATA : V_UNTQT TYPE STRING.
    DATA : V_MEINS LIKE MSEG-MEINS.
    DATA : V_MEINS1 LIKE MSEG-MEINS.
    DATA : V_SCPGN1 TYPE STRING.
    DATA : V_WSTMQ LIKE MSEG-MENGE.
    DATA : V_WSTMQ1 TYPE STRING.
    DATA : V_QFPGN LIKE MARA-NTGEW.
    DATA : V_VALQ LIKE MARA-NTGEW.
    DATA : V_UNITQ LIKE MARA-MEINS.
    DATA : V_WGHT TYPE STRING.
    DATA : V_WGHT1 TYPE STRING.
    DATA : V_CHARG LIKE MSEG-CHARG.
    DATA: TEXT   TYPE STRING.
    DATA: TEXT1  TYPE STRING.
    DATA: TEXT2  TYPE STRING.
    DATA :TEXT3  TYPE STRING.
    DATA :TEXT4  TYPE STRING.
    DATA:dat_frt(30).
    SELECTION-SCREEN ************
    SELECTION-SCREEN COMMENT /80(50) VER.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE tit2.
    SELECT-OPTIONS: P_CHLN FOR IT_J_1IEXCDTL-EXNUM. "NO-EXTENSION
                                      "NO INTERVALS OBLIGATORY.
    SELECT-OPTIONS: P_DATE FOR IT_J_1IEXCHDR-BUDAT. "NO-EXTENSION
                                      "NO INTERVALS OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK blk2.
    SELECTION-SCREEN COMMENT /72(60) run.
    DATA : BEGIN OF IT_FINAL OCCURS 1,
            BUDAT  type d,   "1 Date of issue
            MAKTX(40)  TYPE C,   "2Material Desc
            CHAPID(22) TYPE C,
            MENGE(18)   TYPE C,   "4 Qty removed weight
            CHARG(25)  TYPE C,         "5 Identification Marks
            ADRS(55)  TYPE C," 6For Vendor Address
            EXNUM  LIKE J_1IEXCHDR-EXNUM,   "7 Challan No. & Date
            ADDLDATA1(40) TYPE C, "8 NatureProcessReq
           DOCNO  LIKE J_1IEXCHDR-DOCNO,   "10 Document No.
            CPUDT  TYPE D,  "9 Date of Receipt
            V_QTY1(40)   TYPE C,    "10QtyofProcessedFinishedGoods
            BURNING(12) TYPE C,             "11 Burning Loss
            WST_M(20) TYPE c,    "12 Qty of waste material
            ADDLDATA2(18) TYPE C,"13 Invoice No.&Date
            V_PARTIC(25)  TYPE C," 14Particulars of Payment
           ADDLDATA2 LIKE J_1IEXCHDR-ADDLDATA2,"15 Invoice No.&Date
    END OF IT_FINAL.
    PERFORM INITIALZATION1.
    PERFORM GET_DATA.
    PERFORM CALL_FORM.
    *&      Form  INITIALZATION
          text
    -->  p1        text
    <--  p2        text
    form INITIALZATION1 .
         CLEAR  IT_FINAL.
         CLEAR  IT_J_1IEXCHDR.
         CLEAR  IT_MSEG.
         CLEAR  IT_J_1IEXCDTL.
         CLEAR  IT_J_1IGRXSUB.
         CLEAR  IT_ADRC.
         CLEAR  V_Q.
         CLEAR  V_SCPGN.
         CLEAR  V_WST.
         CLEAR  V_QFPG1.
         CLEAR  V_QFPG2.
         CLEAR  V_VAL.
         CLEAR  V_VAL1.
         CLEAR  V_AQTY.
         CLEAR  V_WUNIT.
         CLEAR  V_QTYR.
         CLEAR  V_UNTQT.
         CLEAR  V_SCPGN1.
         CLEAR  V_MEINS.
         CLEAR  V_WSTMQ.
         CLEAR  V_WSTMQ1.
         CLEAR  V_QFPGN.
         CLEAR  V_VALQ.
         CLEAR  V_UNITQ.
         CLEAR  V_WGHT.
         CLEAR  V_WGHT1.
         CLEAR  IT_FINAL[].
         CLEAR  IT_J_1IEXCHDR[].
         CLEAR  IT_MSEG[].
         CLEAR  IT_J_1IEXCDTL[].
         CLEAR  IT_J_1IGRXSUB[].
    endform.                    " INITIALZATION
    *****INITIALIZATION
    INITIALIZATION.
      tit2 = 'Selection Criteria'.
      CONCATENATE sy-datum6(2) '.' sy-datum4(2) '.' sy-datum+0(4) INTO
                    dat_frt.
      CONCATENATE 'User ID : ' sy-uname ' Client ID : ' sy-mandt
                    ' Run Date : ' dat_frt
                    INTO run SEPARATED BY space.
      ver = 'Developed by CMC Limited. '.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_DATA .
    IF P_DATE <> ''.
    SELECT *
             FROM J_1IEXCHDR
             INTO TABLE IT_J_1IEXCHDR
             WHERE BUDAT IN P_DATE AND
                   TRNTYP = '57FC' AND    " Transaction type
                   SRGRP = 40.            " Series Group
    ENDIF.
    IF P_CHLN <> ''.
        SELECT *
             FROM J_1IEXCHDR
             INTO TABLE IT_J_1IEXCHDR
             WHERE EXNUM IN P_CHLN AND
                   TRNTYP = '57FC' AND    " Transaction type
                   SRGRP = 40.            " Series Group
    ENDIF.
          select *
                   FROM J_1IEXCDTL
                   INTO TABLE IT_J_1IEXCDTL
                         WHERE EXDAT IN P_DATE    " Document No.
                         AND TRNTYP  = '57FC'.
                         " Transaction type for subcontracting
    LOOP AT IT_J_1IEXCHDR.
    MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
    select MATNR  MAKTX CHAPID MENGE MEINS ADDLDATA1 EXNUM
      FROM J_1IEXCDTL
      INTO (IT_J_1IEXCDTL-MATNR, IT_FINAL-MAKTX,
            IT_FINAL-CHAPID,V_QTYR,  V_UNTQT,
            IT_J_1IEXCDTL-ADDLDATA1, IT_J_1IEXCDTL-EXNUM)
            WHERE DOCNO = IT_J_1IEXCHDR-DOCNO    " Document No.
    AND TRNTYP  = '57FC'
    " Transaction type for subcontracting
    AND   RDOC2 = IT_J_1IEXCHDR-RDOC.           " Material Doc No.
       IT_FINAL-MAKTX      =  IT_J_1IEXCDTL-MAKTX.   " Material Desc
       IT_FINAL-CHAPID     =  IT_J_1IEXCDTL-CHAPID.  " Tariff Clasifi
        IT_FINAL-MENGE      =  IT_J_1IEXCDTL-MENGE.
       IT_FINAL-MEINS      =  IT_J_1IEXCDTL-MEINS.
       IT_FINAL-ADDLDATA1  =  IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
    V_QTYR1 = V_QTYR.
    CONCATENATE V_QTYR1 V_UNTQT INTO IT_FINAL-MENGE SEPARATED BY ''.
    IF V_UNTQT = 'EA'.
          SELECT SINGLE NTGEW GEWEI        " VALUE, UNIT
                 FROM   MARA
                 INTO  (V_VALQ, V_UNITQ)
                 WHERE MATNR = IT_J_1IEXCDTL-MATNR.
                 V_WGHT = V_VALQ * V_QTYR.
                 V_WGHT1 = V_WGHT.
    CONCATENATE V_WGHT1 V_UNITQ INTO V_WGHT1 SEPARATED BY ''.
    CONCATENATE IT_FINAL-MENGE V_WGHT1 INTO IT_FINAL-MENGE
    SEPARATED BY ' / '.
       ENDIF.
       SELECT SINGLE CHARG                " Batch No.
               FROM MSEG
               INTO V_CHARG
                WHERE MBLNR = IT_J_1IEXCHDR-RDOC  AND  " Material Doc No.
                     MATNR = IT_J_1IEXCDTL-MATNR AND
                     SHKZG = 'H'.   " H- CREDIT
        IT_FINAL-CHARG = V_CHARG.
        CLEAR V_CHARG.
        SELECT SINGLE REC_QTY MBLNR  " Qtywaste material,mat docno.
              FROM J_1IGRXSUB
              INTO (IT_J_1IGRXSUB-REC_QTY, IT_J_1IGRXSUB-MBLNR)
              WHERE EXNUM  = IT_J_1IEXCHDR-EXNUM." AND
                EXC_ZEILE = IT_J_1IEXCHDR-ZEILE.
         SELECT SINGLE MENGE         " QTY OF WASTE MATERIAL
               FROM  MSEG
               INTO  V_SCPGN        " VARIABLE STORING QTY OF WASTE MTRL.
               WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
                     AND BWART = 545.
         V_WST = V_SCPGN.
    SELECT SINGLE MENGE MEINS        " QTY OF WASTE MATERIAL
               FROM  MSEG
               INTO  (V_WSTMQ, V_MEINS) "VARIABLE STORING QTYOFWASTEMTRL.
               WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
                     AND BWART = 101.
               V_WSTMQ1 = V_WSTMQ.
    CONCATENATE V_WSTMQ1 V_MEINS INTO V_SCPGN1.
    ADDING UNIT 'KG' INTO WASTE MATERIAL.
    CONCATENATE V_WST 'KG' INTO IT_FINAL-WST_M.
        SELECT SINGLE MATNR
                FROM MSEG
                INTO IT_MSEG-MATNR
                WHERE MBLNR = IT_J_1IGRXSUB-MBLNR
                AND BWART = 101.
    IF RECEIVED QTY IS IN EA THEN IT SHOULD COME IN KG ALSO
         SELECT SINGLE NTGEW GEWEI        " VALUE, UNIT
                FROM MARA
                INTO (V_VAL, V_WUNIT)
                WHERE MATNR = IT_MSEG-MATNR.
                V_VAL1 = V_VAL.
    CONCATENATE V_VAL1 V_WUNIT INTO V_QFPG1 SEPARATED BY ''.
               IT_FINAL-V_QTY1 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
                V_QFPG2 = V_VAL * IT_J_1IGRXSUB-REC_QTY.
                V_QFPGN = V_QFPG2.
    CONCATENATE V_QFPG2 V_WUNIT INTO V_QFPG2.
                V_AQTY = IT_J_1IGRXSUB-REC_QTY.
    IF V_QFPGN <> 0.
    CONCATENATE V_SCPGN1 V_QFPG2 INTO IT_FINAL-V_QTY1 SEPARATED BY ' / '.
    ELSE.
           IT_FINAL-V_QTY1 = V_SCPGN1.
    ENDIF.
    BURNING LOSS
    *Burning Loss = Qty-removed - ( Qty of processed finished goods +
                                   Qty of waste material)
    V_Q = V_QTYR - ( V_QFPGN + V_SCPGN ).
    IF V_Q GE 0.
    CONCATENATE V_Q 'KG' INTO IT_FINAL-BURNING
    SEPARATED BY ''.
    ELSE.
          V_Q = 0.
          IT_FINAL-BURNING = V_Q.
    ENDIF.
    MOVE-CORRESPONDING IT_J_1IEXCHDR TO IT_FINAL.
    IT_FINAL-ADDLDATA1  =  IT_J_1IEXCDTL-ADDLDATA1. " Nature of proc
    APPEND IT_FINAL.
    endselect.
    LOOP AT IT_FINAL.
        SELECT SINGLE adrnr                          "Adress Number
               FROM lfa1
               INTO IT_LFA1-adrnr
               WHERE lifnr = IT_J_1IEXCHDR-LIFNR.
       SELECT              " Vendor Address
              SINGLE name1 street city1 post_code1 tel_number fax_number
              house_num1
              FROM adrc
              INTO (IT_ADRC-name1,IT_ADRC-street,IT_ADRC-city1,
              IT_ADRC-post_code1,
              IT_ADRC-tel_number,IT_ADRC-fax_number,IT_ADRC-house_num1)
              WHERE addrnumber = it_lfa1-adrnr.
    CONCATENATION OF VENDOR NAME & ADDRESS INTO ONE FIELD i.e ADRS.
       CONCATENATE IT_ADRC-NAME1 IT_ADRC-STREET IT_ADRC-CITY1
                   IT_ADRC-POST_CODE1
                   INTO IT_FINAL-ADRS SEPARATED BY ''.
         MODIFY IT_FINAL.
    ENDLOOP.
    ***************CLEAR STATEMENT
         CLEAR  IT_FINAL.
         CLEAR  IT_J_1IEXCHDR.
         CLEAR  IT_MSEG.
         CLEAR  IT_J_1IEXCDTL.
         CLEAR  IT_J_1IGRXSUB.
         CLEAR  IT_ADRC.
         CLEAR  V_Q.
         CLEAR  V_SCPGN.
         CLEAR  V_WST.
         CLEAR  V_QFPG1.
         CLEAR  V_QFPG2.
         CLEAR  V_VAL.
         CLEAR  V_VAL1.
         CLEAR  V_AQTY.
         CLEAR  V_WUNIT.
         CLEAR  V_QTYR.
         CLEAR  V_UNTQT.
         CLEAR  V_SCPGN1.
         CLEAR  V_MEINS.
         CLEAR  V_WSTMQ.
         CLEAR  V_WSTMQ1.
         CLEAR  V_QFPGN.
         CLEAR  V_VALQ.
         CLEAR  V_UNITQ.
         CLEAR  V_WGHT.
         CLEAR  V_WGHT1.
    ENDLOOP.
    CLEAR  IT_J_1IEXCHDR[].
    CLEAR  IT_MSEG[].
    CLEAR  IT_J_1IEXCDTL[].
    CLEAR  IT_J_1IGRXSUB[].
    endform.                    " GET_DATA
    ADD
    form alv_events using events type slis_t_event.
      data : wa_events type slis_alv_event.
      clear wa_events.
      wa_events-name = 'TOP_OF_PAGE'.
      wa_events-form = 'TOP_OF_PAGE'.
      append wa_events to it_events.
    endform.                    "alv_events
    *FORM FOR TOP OF PAGE
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheader.
    endform.                    "top_of_page
    FORM fill_fieldcat  USING f d o t to p c.
      data wa_fieldcat type slis_fieldcat_alv.
      statics pos like sy-index value 1.
      pos = pos + 1.
      clear wa_fieldcat.
      MOVE : 1     TO   WA_FIELDCAT-ROW_POS,
             POS   TO   WA_FIELDCAT-COL_POS,
             F     TO   WA_FIELDCAT-FIELDNAME,
             D     TO   WA_FIELDCAT-SELTEXT_L,
             O     TO   WA_FIELDCAT-OUTPUTLEN,
             T     TO   WA_FIELDCAT-TABNAME,
             TO    TO   WA_FIELDCAT-DO_SUM,
             P     TO   WA_FIELDCAT-FIX_COLUMN,
             C     TO   WA_FIELDCAT-EMPHASIZE.
    move : 1     to   wa_fieldcat-row_pos,
            pos   to   wa_fieldcat-col_pos,
            f     to   wa_fieldcat-fieldname,
            d     to   wa_fieldcat-seltext_l,
            o     to   wa_fieldcat-outputlen,
            t     to   wa_fieldcat-tabname,
            to    to   wa_fieldcat-do_sum,
            p     to   wa_fieldcat-fix_column.
      append wa_fieldcat to it_fieldcat.
    ENDFORM.                    " fill_fieldcat
    *&      Form  CALL_FORM
          text
    -->  p1        text
    <--  p2        text
    form CALL_FORM .
    perform alv_header using it_listheader.
    perform alv_events using it_events.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               =  SY-REPID
       I_INTERNAL_TABNAME           =  'IT_FINAL'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = SY-REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        ct_fieldcat                  = IT_FIELDCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    For Columns Heading
    LOOP AT IT_FIELDCAT INTO V_FIELDCAT.
        CASE V_FIELDCAT-FIELDNAME.
          WHEN 'BUDAT'.
              V_FIELDCAT-SELTEXT_L = 'Date of Issue'.
          WHEN 'MAKTX'.
              V_FIELDCAT-SELTEXT_L = 'Description of goods (inputs)'.
          WHEN 'CHAPID'.
              V_FIELDCAT-SELTEXT_L = 'Tarrif Classification'.
          WHEN 'MENGE'.
              V_FIELDCAT-SELTEXT_L =  'Quantity Removed '.
          WHEN 'CHARG'.
              V_FIELDCAT-SELTEXT_L = 'Identification Marks, If any'.
          WHEN 'ADRS'.
             V_FIELDCAT-SELTEXT_L =
               'Premises/Factory to which goods removed'.
          WHEN 'EXNUM'.
             V_FIELDCAT-SELTEXT_L = 'Challan No.'.
          WHEN 'ADDLDATA1'.
             V_FIELDCAT-SELTEXT_L = 'Nature of Processing required'.
          WHEN 'CPUDT'.
           V_FIELDCAT-SELTEXT_L = 'Date of Receipt'.
          WHEN 'V_QTY1'.
              V_FIELDCAT-SELTEXT_L = 'Qty of Processed Finished Goods '.
          WHEN 'BURNING'.
              V_FIELDCAT-SELTEXT_L = 'Process Loss'.
          WHEN 'WST_M'.
         V_FIELDCAT-SELTEXT_L = 'Quantity of Waste Material'.
          WHEN 'ADDLDATA2'.
                 V_FIELDCAT-SELTEXT_L = 'Invoice No. & Date'.
          WHEN 'V_PARTIC'.
                 V_FIELDCAT-SELTEXT_L = 'Particulars of Payment of Duty'.
            V_FIELDCAT-REF_FIELDNAME = 'ERSDA'.
            V_FIELDCAT-REF_TABNAME   = 'J_1IEXCDTL'.
            WHEN OTHERS. CONTINUE.
        ENDCASE.
        V_FIELDCAT-SELTEXT_S = V_FIELDCAT-SELTEXT_L.
        V_FIELDCAT-SELTEXT_M = V_FIELDCAT-SELTEXT_L.
        MODIFY IT_FIELDCAT FROM V_FIELDCAT.
    ENDLOOP.
    perform fill_layout_structure.
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = sy-repid
       I_CALLBACK_TOP_OF_PAGE            = 'TOP-OF-PAGE'
       IS_LAYOUT                         = IS_LAYOUT
       IT_FIELDCAT                       =  IT_FIELDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
       I_SAVE                            = 'A'
      IS_VARIANT                        =
       IT_EVENTS                         = 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_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          =  IT_FINAL
    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_FORM
    *&      Form  FILL_LAYOUT_STRUCTURE
          text
    -->  p1        text
    <--  p2        text
    form FILL_LAYOUT_STRUCTURE .
    data: wa_event       type slis_alv_event,
          wa_listheader  type slis_t_listheader.
      clear is_layout.
      is_layout-zebra = 'X'.
    SELL_MODE = 'D'.
    endform.                    " FILL_LAYOUT_STRUCTURE
    *&      Form  ALV_HEADER
          text
         -->P_IT_LISTHEADER  text
    form ALV_HEADER  using    p_it_listheader.
    data : wa_listheader  type slis_listheader.
      TEXT = 'Annexure - IV'.
      clear wa_listheader.
      wa_listheader-typ = 'H'.
      move  TEXT  to  wa_listheader-info.
      append wa_listheader to it_listheader.
    TEXT1 = 'Account of Removal of inputs or partially processed goods'.
      clear wa_listheader.
      wa_listheader-typ = 'S'.
      move  TEXT1
      to  wa_listheader-info.
      append wa_listheader to it_listheader.
    TEXT2 = 'under Sub Rule 5a of Rule of CENVAT Credit Rules, 2002'.
      clear wa_listheader.
      wa_listheader-typ = 'S'.
      move  TEXT2  to  wa_listheader-info.
      append wa_listheader to it_listheader.
    TEXT3 = '(to be maintened by assessee who sends raw '.
    clear wa_listheader.
      wa_listheader-typ = 'S'.
      move  TEXT3  to  wa_listheader-info.
      append wa_listheader to it_listheader.
    TEXT4 = 'materials/semifinished  goods.'.
    clear wa_listheader.
      wa_listheader-typ = 'S'.
      move  TEXT4  to  wa_listheader-info.
      append wa_listheader to it_listheader.
    endform.                    " ALV_HEADER
    Regards,
    Gulrez Alam

  • How to trigger top-of-page in ALV Grid

    How to trigger Top-Of-Page in ALV Grid...
    can any one plese send the sample code...
    thanks.

    here is sample code. try this. u need to build an internal table and then call function commentary write and pass that internal table.
    *&      Form  TOP_OF_PAGE
          Top_of_page
    FORM top-of-page.                                           "#EC CALLED
    *ALV Header declarations
      DATA: lit_header TYPE slis_t_listheader,
            lwa_header TYPE slis_listheader.
    Title
      lwa_header-typ  = 'H'.
      lwa_header-info = text-013.
      APPEND lwa_header TO lit_header.
      CLEAR lwa_header.
    BOM Number
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
        EXPORTING
          input  = p_matnr
        IMPORTING
          output = gv_matnr.
    Pass BOM number
      lwa_header-typ  = 'S'.
      lwa_header-key = text-014.
      lwa_header-info = gv_matnr .
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header ,
             gv_matnr .
    BOM description
      lwa_header-typ  = 'S'.
      lwa_header-key = text-015 .
      lwa_header-info = gv_maktx .
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header.
    start/end date format MM/DD/YY
      lwa_header-typ  = 'S'.
      lwa_header-key = text-016 .
      CONCATENATE s_erdat-low+4(2) '/'
                  s_erdat-low+6(2) '/'
                  s_erdat-low(4) ' - '
                  s_erdat-high+4(2) '/'
                  s_erdat-high+6(2) '/'
                  s_erdat-high(4)
                  INTO lwa_header-info.
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header.
    Run Date of Report format MM/DD/YY
      lwa_header-typ  = 'S'.
      lwa_header-key = text-017 .
      CONCATENATE  sy-datum+4(2) '/'
                   sy-datum+6(2) '/'
                   sy-datum(4) INTO lwa_header-info .
      APPEND lwa_header TO lit_header.
      CLEAR: lwa_header.
    call function REUSE_ALV_COMMENTARY_WRITE to use TOP_OF_PAGE event.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = lit_header.
    ENDFORM .                              " FORM top-of-page.

  • How to merge rows with similar values in alv grid display in webdynpro

    Hi experts,
                   i want to know about how to merge rows with similar values in alv grid display of webdynpro.grouping rows is possible in table display in webdynpro but i am not able to do row grouping in the alv grid display in webdynpro.
    kindly suggest.
    thanks ,
    Anita.

    Hi Anita,
    did you find a solution for this? I have opened a Thread, if you know the answer maybe you could help me out:
    Is there an ALV function similar to the TABLE Row grouping?
    Thanx in advanced!!!
    Kind Regards,
    Gerardo J

  • How to write strings with an underline on the TOP-OF-PAGE of ALV

    How to write strings with an underline on the TOP-OF-PAGE of ALV

    if u r using classes and methods it can be done
    but if u r using normal fms and then u have to use HTML_TOP_OF_PAGE but the drawback for this it cannot be printed when the report is printed .

  • Error in top-of-page in ALV GRID

    Friwnds  i am trying out a simple alv grid display program with
    top of page .
    But the top-of-page is coming blank with no logo and text.
    Please help me .
    Below is the full program.
    REPORT  zalv_griddisplaypic.
    TYPE-POOLS : slis.
    DATA : itab TYPE STANDARD TABLE OF spfli,
           it_fcat TYPE slis_t_fieldcat_alv,
           wa_fcat TYPE slis_fieldcat_alv,
            drepid LIKE sy-repid.
    START-OF-SELECTION.
      SELECT carrid
             connid FROM spfli INTO corresponding fields of TABLE itab UP TO 10 ROWS.
    END-OF-SELECTION.
      wa_fcat-fieldname = 'CARRID'.
      wa_fcat-row_pos   = '1'.
      wa_fcat-col_pos = 1 .
      wa_fcat-emphasize = 'X'.
      wa_fcat-just = 'C'.
      wa_fcat-outputlen = 15.
      wa_fcat-seltext_m = 'CARRIER NO'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      wa_fcat-fieldname = 'CONNID'.
      wa_fcat-row_pos   = '1'.
      wa_fcat-col_pos = 2 .
      wa_fcat-emphasize = 'X'.
      wa_fcat-just = 'C'.
      wa_fcat-outputlen = 20.
      wa_fcat-seltext_m = 'CONNECTION NO'.
      APPEND wa_fcat TO it_fcat.
      CLEAR wa_fcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = drepid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
         i_callback_top_of_page            = 'TOP-OF-PAGE1'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      = 'LOKESH'
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
         it_fieldcat                       = it_fcat
      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_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        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.
    *&      Form  top-of-page1
          text
    FORM TOP-OF-PAGE1.
    data: header type slis_t_listheader,
          wa     type slis_listheader,
          v1 type char10.
    TITLE AREA
    wa-typ = 'S'.
    wa-info = 'ALV GRID DISPLAY'.
    append wa to header.
    clear wa.
      WRITE sy-datum TO v1 USING EDIT MASK '__/__/_____'.
      wa-typ = 'S'.
      wa-info = v1.
      wa-key = 'DATE :'.
      APPEND wa TO header.
      CLEAR wa.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        it_list_commentary       = header
       I_LOGO                   = 'ENJOYSAP_LOGO'
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "top-of-page1

    try to this code.........
    REPORT zalv_griddisplaypic.
    TYPE-POOLS : slis.
    DATA : itab TYPE STANDARD TABLE OF spfli,
    DATA  GT_HEADER  TYPE SLIS_T_LISTHEADER.
    it_fcat TYPE slis_t_fieldcat_alv,
    wa_fcat TYPE slis_fieldcat_alv,
    drepid LIKE sy-repid.
    START-OF-SELECTION.
    SELECT carrid
    connid FROM spfli INTO corresponding fields of TABLE itab UP TO 10 ROWS.
    END-OF-SELECTION.
    PERFORM BUILD_HEADER USING GT_HEADER.
    wa_fcat-fieldname = 'CARRID'.
    wa_fcat-row_pos = '1'.
    wa_fcat-col_pos = 1 .
    wa_fcat-emphasize = 'X'.
    wa_fcat-just = 'C'.
    wa_fcat-outputlen = 15.
    wa_fcat-seltext_m = 'CARRIER NO'.
    APPEND wa_fcat TO it_fcat.
    CLEAR wa_fcat.
    wa_fcat-fieldname = 'CONNID'.
    wa_fcat-row_pos = '1'.
    wa_fcat-col_pos = 2 .
    wa_fcat-emphasize = 'X'.
    wa_fcat-just = 'C'.
    wa_fcat-outputlen = 20.
    wa_fcat-seltext_m = 'CONNECTION NO'.
    APPEND wa_fcat TO it_fcat.
    CLEAR wa_fcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    i_callback_program = drepid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    i_callback_top_of_page = 'TOP-OF-PAGE1'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE = 'LOKESH'
    I_GRID_SETTINGS =
    IS_LAYOUT =
    it_fieldcat = it_fcat
    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_HTML_HEIGHT_TOP = 0
    I_HTML_HEIGHT_END = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    IR_SALV_FULLSCREEN_ADAPTER =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    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.
    *& Form top-of-page1
    text
    FORM BUILD_HEADER USING HEADER TYPE SLIS_T_LISTHEADER.
    data: header type slis_t_listheader,
    wa type slis_listheader,
    v1 type char10.
    TITLE AREA
    wa-typ = 'S'.
    wa-info = 'ALV GRID DISPLAY'.
    append wa to header.
    clear wa.
    WRITE sy-datum TO v1 USING EDIT MASK '__/__/_____'.
    wa-typ = 'S'.
    wa-info = v1.
    wa-key = 'DATE :'.
    APPEND wa TO header.
    CLEAR wa.
    endform.
    form top_of_page1.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = gt_header
    I_LOGO = 'ENJOYSAP_LOGO'
    I_END_OF_LIST_GRID=.
    endform.

Maybe you are looking for

  • Mac Mini Ram

    does the mac mini have buffered or unbuffered ram. i have the original 512mb and i want to upgrade to 1gb, i have found buffered and unbuffered for the same price, whats the difference and which is better for the mac mini ? thanx

  • Buying a new iphone with a contract and using current 3g sim card for it.

    I have the iphone 3g and recently my screen got cracked. Is it possible to just buy another iphone from a Apple store and put my sim card into the new phone? I'm not too sure if they allow you to just buy the phone without the whole contract thingie.

  • Adobe DPS and web content viewer issues

    Having an issue with the tablet and web content viewer version of this particular article. I've create two separate documents one for iPad and one for iPhone, reuploaded the article and recreate the entire article all in the hopes that it would resol

  • Friends, I Lost my IPAD2, on jun23 2011, somebody find it

    Friends, I Lost my IPAD2, on jun23 2011, somebody find it

  • Deleting element from binary search tree

    please could u tell me what is the wrong with this deleting function ..      private  BTNode deleteElement(int a,BTNode curNode)           BTNode s,q,p;           if (curNode==null)           return curNode;           HasId curObject =(HasId)curNode.