How to go to top of page?

I hate to be stupid, but I couldn't find a way to get to the top of my photo album and I can't see spending 30 minutes scrolling there. I went to 'Help' and it said go click "Home" or "End" and I don't have them on my keyboard. Anybody know how I navigate around in a photo album?

The last two keyboards that have come with my latest iMac (intel) and older PPC G5 had home and end keys. Our MacBook Pro also has those keys.

Similar Messages

  • 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 do I reorder top level pages in BC Site Map Settings?

    I created a desktop and mobile version of web site in muse and am hosting through BC.  The site map settings show the pages alphabetically.
    1. - Is there a way to reorder the root level parent pages other than alphabetically? I see I can add the sub-level pages under the top-level pages via drag and drop, but can't reorder any pages. As I'd like to publish the site map to my website but would be unacceptable to have it starts with a 404, Home is somewhere in the middle... 
    2. - That being said, does this make any difference for SEO?
    3. - Also, since I have made 2 versions of site (desktop and mobile) which contain same page names, they appear to be showing as dupes in site map settings function. How do I know which is which as reorder and include on site map?
    Thank you in advance..  

    Yeah that is an issue web developers have been facing for years.
    There are some work arounds that you can try:
    1: Use the Tooltip Composition for the drop menus and set the transition time to a bit longer time so it isn't quite as apparent there is a secondary menu.
    2: Set the menu widget to 'Manual' and add the link to the top level page to the drop menu as well.
    3: Don't have a drop menu - just have a seperate template for each section that has drop menus and then in that template add a manual menu widget and add a secone menu to that template on the side or below the other menu or where ever with just links to the pages in that section.
    There are probably a few more options but there is no way to really solve the problem with the way it is set up other than maybe creative menu link names. For example top level could say 'All Gizmos', then the drop menu links can say 'Gizmo One', Gizmo Two' etc.

  • 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.

  • How do I get top of page curl (IDCS4 to SWF doc) to show when inserted into DW?

    Is there a way to get the top & bottom of page curls to show on my web page the way they do in the html preview?  (With a transparant efffect?) I've attached the SWf file, if that helps.
    Thanx in advance for any advice.

    Hey, well thanks for responding.... but, if ANY other people who are novice web designers want to find out the answer to what, apparently, is a dumb question, a point in the right direction would be nice. Even if it was only a few people checking back to see if an answer was there, it means they want to know how - just as badly as I do.
    So, anyways, if you want to know how to make a page curl show up in your DW site, the answer isn't within DW, but somewhere else, correct?
    Thanks, for your time, BTW.

  • How to create own top of page in ALV

    Tell me how the our ownTop of page can create in ALV in ABAP hr
    and tell me the code for the all pls.
    Thankyou
    Regards,
    Nandha

    Here is a sample program.  Welcome to SDN!!!
    report zrich_0001
           no standard page heading.
    * Global ALV Data Declarations
    type-pools slis.
    data: begin of i_alv occurs 0,
          matnr type mara-matnr,
          matkl type mara-matkl,
          end of i_alv.
    * Miscellanous Data Declarations
    data: fieldcat type slis_t_fieldcat_alv,
          events   type slis_t_event,
          list_top_of_page type slis_t_listheader,
          top_of_page  type slis_formname value 'TOP_OF_PAGE'.
    start-of-selection.
      perform initialization.
      perform get_data.
      perform call_alv.
    end-of-selection.
    *  Form  Initialization
    form initialization.
      clear i_alv.       refresh i_alv.
      perform eventtab_build using events[].
    endform.
    *  Form  Get_Data
    form  get_data.
      select matnr into table i_alv
                  from mara up to 100 rows.
    endform.
    *  CALL_ALV
    form call_alv.
      data: variant type  disvariant.
      data: repid type sy-repid.
      repid = sy-repid.
      variant-report = sy-repid.
      variant-username = sy-uname.
      perform build_field_catalog.
      perform comment_build using list_top_of_page[].
    * Call ABAP List Viewer (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat        = fieldcat
                i_callback_program = repid
                is_variant         = variant
                it_events          = events[]
                i_save             = 'U'
           tables
                t_outtab           = i_alv.
    endform.
    * EVENTTAB_BUILD
    form eventtab_build using events type slis_t_event.
    * Registration of events to happen during list display
      data: tmp_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = events.
      read table events with key name = slis_ev_top_of_page
                               into tmp_event.
      if sy-subrc = 0.
        move top_of_page to tmp_event-form.
        append tmp_event to events.
      endif.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      clear: fieldcat. refresh: fieldcat.
      data: tmp_fc type slis_fieldcat_alv.
      tmp_fc-reptext_ddic = 'Material'.
      tmp_fc-fieldname    = 'MATNR'.
      tmp_fc-tabname      = 'I_ALV'.
      tmp_fc-outputlen    = 18.
      append tmp_fc to fieldcat.
      tmp_fc-reptext_ddic = 'Material Group'.
      tmp_fc-fieldname    = 'MATKL'.
      tmp_fc-tabname      = 'I_ALV'.
      tmp_fc-outputlen    = 10.
      append tmp_fc to fieldcat.
    endform.
    * COMMENT_BUILD
    form comment_build using list_top_of_page type
                                            slis_t_listheader.
      data: tmp_line type slis_listheader.
      clear tmp_line.
      tmp_line-typ  = 'H'.
      tmp_line-info = 'Here is a line of text'.
      append tmp_line to list_top_of_page.
      clear tmp_line.
      tmp_line-typ  = 'S'.
      tmp_line-key  = 'Key1'.
      tmp_line-info = 'Here is a value'.
      append tmp_line to list_top_of_page.
      clear tmp_line.
      tmp_line-typ  = 'S'.
      tmp_line-key  = 'Key2'.
      tmp_line-info = 'Here is another value'.
      append tmp_line to list_top_of_page.
    endform.
    * TOP_OF_PAGE
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = list_top_of_page.
    endform.
    Regards,
    Rich Heilman

  • 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 supress top of page in ALV during page breaks...

    Hello Experts,
    I am currently developing a report using the old ALV(REUSE_ALV_LIST_DISPLAY) since
    I need to have page breaks(using the SORT event) depending on the sort criteria. But
    I noticed that for every page break, the top of page automatically displays. I only
    need to display it one or depending on other factors.
    So how do we supress top of page event?
    Thank you guys and take care!

    Hi Viraylab,
    Try out like this ..
    1. Declare a global variable g_flag = 0.
    2. if g_flag = 1.
          top-of-page.
          your heading.....
          and default g_flag = 0.
       endif.
    3. *your Output
          Perform display.
    4. Form display.
           Your --- Code...
            g_flag = 1.
        endform.
    Regards,
    sg

  • Problem in ALV Top of Page

    Hi All,
    I am having a ALV report .Once i execute the report there will be ALV output once i click on the Material no((Hot spot)) in the output it ll take to the another ALV report.The problem is how to get the top of page in the second alv...The top of page in the second ALV should be different..
    Is it possible to do this?Pls reply asap.
    Thanks
    Raj.

    Hi Arun,
    It is not working in the way you have given.
    Hi All,
    Is there any way to do this ???
    Thanks
    Raj.

  • Issue with top of page event

    Hi All,
         In my Report i am printing both interactive and alv grid display in same report.means i have one check box it is then report print as a alv format otherwise classical format.
        But here i have small problem  i am trying  print in alv format its automatically trigger the top of page event thatsway a blank screen is generated so please tell how to skip the Top of page event.
    Regards,
    Venkatesh

    END-OF-SELECTION.
      SORT tab1 BY ebeln ebelp.
      DESCRIBE TABLE tab1 LINES tabln.
      IF tabln = 0.
        MESSAGE ID 'ME' TYPE 'I' NUMBER '260'.
        EXIT.
      ENDIF.
      SORT tab1 BY sortkey knttp ebeln ebelp.
    if P_ALV = 'X'.
      LOOP AT tab1.
        IF tab1-knttp = '1'.
              gs_final-str = text-k01.
              gs_final-kont1 = tab1-kont1.
              gs_final-kont2 = tab1-kont2.
          ELSEIF tab1-knttp = '2'.
              gs_final-str = text-k02.
              gs_final-kont1 = tab1-kont1.
              gs_final-kont2 = tab1-kont2.
          ELSEIF tab1-knttp = '3'.
           gs_final-str = text-k03.
              gs_final-kont1 = tab1-kont1.
              gs_final-kont2 = tab1-kont2.
          ELSEIF tab1-knttp = '4'.
              gs_final-str = text-k04.
              gs_final-kont1 = tab1-kont1.
              gs_final-kont2 = tab1-kont2.
          ELSEIF tab1-knttp = '5'.
              gs_final-str = text-k05.
              gs_final-kont1 = tab1-kont1.
              gs_final-kont2 = tab1-kont2.
          ELSEIF tab1-knttp = '6'.
              gs_final-str = text-k04.
              gs_final-kont1 = tab1-kont1.
          ELSEIF tab1-knttp IS INITIAL.
            gs_final-str = 'Stock without Account Assignment'.
          ENDIF.
           gs_final-ebeln = tab1-ebeln.
           gs_final-lifnr = tab1-lifnr.
           gs_final-name1 = tab1-name1.
           gs_final-aedat = tab1-aedat.
           gs_final-udate = tab1-udate.
           gs_final-inco1 = tab1-inco1.
           gs_final-inco2 = tab1-inco2.
           gs_final-ebelp = tab1-ebelp.
           gs_final-matnr = tab1-matnr.
           gs_final-txz01 = tab1-txz01.
           gs_final-paedt = tab1-paedt.
           gs_final-eindt = tab1-eindt.
           gs_final-eindt1 = tab1-eindt1.
           gs_final-labnr = tab1-labnr.                  "NWC-29042005
           gs_final-budat = tab1-budat.
           gs_final-menge = tab1-menge.
           gs_final-wemng = tab1-wemng.
           gs_final-meins = tab1-meins.
           gs_final-vbeln = tab1-vbeln.
           gs_final-tddat = tab1-tddat.
         IF NOT tab1-vbeln IS INITIAL.
          FORMAT COLOR 4 INTENSIFIED OFF.
          WRITE:/3 wa_tab1-vbeln.
          READ TABLE lines INDEX 1.
          MOVE lines-tdline TO l_text.
          CLEAR lines.
          READ TABLE lines INDEX 2.
          CONCATENATE l_text lines-tdline INTO l_text SEPARATED BY ' '.
          FORMAT COLOR 5 INTENSIFIED OFF.
          gs_final-l_text = l_text.
          SKIP.                                  "NWC-16092003
        ENDAT.
        APPEND gs_final to gt_final.
      ENDLOOP.
      PERFORM maintain_fieldcatlog.
      PERFORM Display_data.
    ELSE.
      LOOP AT tab1.
        MOVE tab1 TO wa_tab1.
        AT NEW kont1.
          RESERVE 5 LINES.
          FORMAT COLOR 3 INTENSIFIED.
          IF tab1-knttp = '1'.
            WRITE:/(20) text-k01, 20 ':  ', 22(30) tab1-kont1 NO-ZERO,
                                            60(74) tab1-kont2.
          ELSEIF tab1-knttp = '2'.
            WRITE:/(20) text-k02, 20 ':  ', 22(30) tab1-kont1 NO-ZERO,
                                            60(74) tab1-kont2.
          ELSEIF tab1-knttp = '3'.
            WRITE:/(20) text-k03, 20 ':  ', 22(30) tab1-kont1 NO-ZERO,
                                            60(74) tab1-kont2.
          ELSEIF tab1-knttp = '4'.
            WRITE:/(20) text-k04, 20 ':  ', 22(30) tab1-kont1 NO-ZERO,
                                            60(74) tab1-kont2.
          ELSEIF tab1-knttp = '5'.
            WRITE:/(20) text-k05, 20 ':  ', 22(30) tab1-kont1 NO-ZERO,
                                            60(74) tab1-kont2.
          ELSEIF tab1-knttp = '6'.
            WRITE:/(20) text-k04, 20 ':  ', 22(30) wa_tab1-kont1 NO-ZERO,
                    60  text-k02, 75 ':  ', 77(57) wa_tab1-kont2 NO-ZERO.
          ELSEIF tab1-knttp IS INITIAL.
            WRITE:/ 'Stock without Account Assignment'.
          ENDIF.
          WRITE 170 ' '.
          FORMAT COLOR INTENSIFIED OFF.
        ENDAT.
        AT NEW ebeln.
          RESERVE 4 LINES.
          FORMAT COLOR 1 INTENSIFIED OFF.
          WRITE:/ wa_tab1-ebeln,
                11 '  ',
                13 wa_tab1-lifnr,
                23 wa_tab1-name1,
                60 wa_tab1-aedat NO-ZERO,
                73 wa_tab1-udate NO-ZERO,
                86 wa_tab1-inco1,
                91(37) wa_tab1-inco2,
               170 ' '.
        ENDAT.
        AT NEW ebelp.
          RESERVE 3 LINES.
          FORMAT COLOR 2 INTENSIFIED OFF.
          WRITE:/2 wa_tab1-ebelp,
                 9 wa_tab1-matnr,
                30(40) wa_tab1-txz01,
                73(10) wa_tab1-paedt,
                84(10) wa_tab1-eindt,
                95(10) wa_tab1-eindt1 NO-ZERO,
                106(15) wa_tab1-labnr,                  "NWC-29042005
                122(10) wa_tab1-budat NO-ZERO,
                133(16) wa_tab1-menge NO-ZERO,
                150(16) wa_tab1-wemng NO-ZERO,
                167(3)  wa_tab1-meins,
                170 ' '.
        ENDAT.
        HIDE: tab1-ebeln, tab1-ebelp.
        I
          READ TABLE lines INDEX 1.
          MOVE lines-tdline TO l_text.
          CLEAR lines.
          READ TABLE lines INDEX 2.
          CONCATENATE l_text lines-tdline INTO l_text SEPARATED BY ' '.
          FORMAT COLOR 5 INTENSIFIED OFF.
          WRITE: /3(132) l_text,
                  170 ' '.
          SKIP.                                  "NWC-16092003
        ENDAT.
      ENDLOOP.
    ENDIF.
    AT LINE-SELECTION.
      CHECK NOT tab1-ebeln IS INITIAL.
      SET PARAMETER ID 'BES' FIELD tab1-ebeln.
      CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
      CLEAR tab1.
    TOP-OF-PAGE.
    if P_ALV ne 'X'.
      IF sy-pagno = 1.
        DETAIL.
        WRITE: /2 text-a01.
        RESERVE 1 LINES.
        SUMMARY.
        IF lifnr IS INITIAL.
          WRITE: /4 text-a02, 26 'All'.
        ELSE.
          LOOP AT lifnr WHERE sign = 'I'.
            IF lifnr-option = 'EQ'.
              WRITE : /4 text-a02, 26 lifnr-low.
            ELSE.
              WRITE: /4 text-a02, 26 'From', 32 lifnr-low,
                                   44 'to', 48 lifnr-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF matnr IS INITIAL.
          WRITE: /4 text-a14, 26 'All'.
        ELSE.
          LOOP AT matnr WHERE sign = 'I'.
            IF matnr-option = 'EQ'.
              WRITE : /4 text-a14, 26 matnr-low.
            ELSE.
              WRITE: /4 text-a14, 26 'From', 32 matnr-low,
                                   44 'to', 48 matnr-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF ebeln IS INITIAL.
          WRITE: /4 text-a03, 26 'All'.
        ELSE.
          LOOP AT ebeln WHERE sign = 'I'.
            IF ebeln-option = 'EQ'.
              WRITE : /4 text-a03, 26 ebeln-low.
            ELSE.
              WRITE: /4 text-a03, 26 'From', 32 ebeln-low,
                                   44 'to', 48 ebeln-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF aedat IS INITIAL.
          WRITE: /4 text-a04, 26 'All'.
        ELSE.
          LOOP AT aedat WHERE sign = 'I'.
            IF aedat-option = 'EQ'.
              WRITE : /4 text-a04, 26 aedat-low.
            ELSE.
              WRITE: /4 text-a04, 26 'From', 32 aedat-low,
                                   44 'to', 48 aedat-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF eindt IS INITIAL.
          WRITE: /4 text-a13, 26 'All'.
        ELSE.
          LOOP AT eindt WHERE sign = 'I'.
            IF eindt-option = 'EQ'.
              WRITE : /4 text-a13, 26 eindt-low.
            ELSE.
              WRITE: /4 text-a13, 26 'From', 32 eindt-low,
                                   44 'to', 48 eindt-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF bednr IS INITIAL.
          WRITE: /4 text-a15, 26 'All'.
        ELSE.
          LOOP AT bednr WHERE sign = 'I'.
            IF bednr-option = 'EQ'.
              WRITE : /4 text-a15, 26 bednr-low.
            ELSE.
              WRITE: /4 text-a15, 26 'From', 32 bednr-low,
                                   44 'to', 48 bednr-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        linno = sy-linno + 1.
        BACK.
        IF ekorg IS INITIAL.
          WRITE: /70 text-a11, 92 'All'.
        ELSE.
          LOOP AT ekorg WHERE sign = 'I'.
            IF ekorg-option = 'EQ'.
              WRITE : /70 text-a11, 92 ekorg-low.
            ELSE.
              WRITE: /70 text-a11, 92 'From', 98 ekorg-low,
                                   104 'to', 108 ekorg-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF ekgrp IS INITIAL.
          WRITE: /70 text-a12, 92 'All'.
        ELSE.
          LOOP AT ekgrp WHERE sign = 'I'.
            IF ekgrp-option = 'EQ'.
              WRITE : /70 text-a12, 92 ekgrp-low.
            ELSE.
              WRITE: /70 text-a12, 92 'From', 98 ekgrp-low,
                                   104 'to', 108 ekgrp-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF werks IS INITIAL.
          WRITE: /70 text-a05, 92 'All'.
        ELSE.
          LOOP AT werks WHERE sign = 'I'.
            IF werks-option = 'EQ'.
              WRITE : /70 text-a05, 92 werks-low.
            ELSE.
              WRITE: /70 text-a05, 92 'From', 98 werks-low,
                                   104 'to', 108 werks-high.
            ENDIF.
          ENDLOOP.
        ENDIF.
        IF pspid IS INITIAL.
          WRITE: /70 text-a06, 92 'All'.
        ELSE.
          LOOP AT pspid WHERE sign = 'I'.
            WRITE:/70 text-a06, 92 pspid-low.
          ENDLOOP.
        ENDIF.
        IF pspnr1 IS INITIAL.
          WRITE: /70 text-a07, 92 'All'.
        ELSE.
          LOOP AT pspnr1 WHERE sign = 'I'.
            WRITE:/70 text-a07, 92 pspnr1-low.
          ENDLOOP.
        ENDIF.
        IF elikz EQ 'X'.
          WRITE: /70 text-a08, 92 'Open PO only'.
        ELSEIF elikz IS INITIAL.
          WRITE: /70 text-a08, 92 'All PO'.
        ENDIF.
        IF stock EQ 'X'.
          WRITE: ', Common Stock Items'.
        ELSEIF pspnr IS INITIAL.
          WRITE: ', All Stock'.
        ENDIF.
        IF sy-linno >= linno.
          linno = sy-linno + 1.
        ENDIF.
        SKIP TO LINE linno.
        ULINE.
    ENDIF.
      FORMAT COLOR 1 INTENSIFIED OFF.
      WRITE:/ 'PO',
            12 'Vendor no.',
            25 'Company',
            60 'PO Crt dt',
            73 'Approved dt',
            86 'Incoterm',
           170 ' '.
      FORMAT COLOR 2 INTENSIFIED OFF.
      WRITE:/2 'Item',
             9 'Material',
            30 'Description',
            73 'Chged date',
            84 'Delv date',
            95 'OA date',
           106 'OA Number',                              "NWC-29042005
           122 'GR date',
           138 'Order Qty',
           158 'GR Qty',
           167 'UoM',
           170 ' '.
      FORMAT COLOR 4 INTENSIFIED OFF.
      WRITE:/2 'Ship notf #',
             15 'ETD.',
             26 'ETA',
             44 'Shipped Qty',
             57 'UoM',
            170 ' '.
      FORMAT COLOR 5 INTENSIFIED OFF.
      WRITE:/2 'Remarks',
           170 ' '.
      ULINE.
    ENDIF.
    form MAINTAIN_FIELDCATLOG .
    REFRESH gt_fieldcat.
    CLEAR gs_fieldcat.
    PERFORM fill_fieldcatlog USING:
            '01' '01' 'STR' 'GT_FINAL' 'Account Assignment',
            '01' '02' 'KONT1' 'GT_FINAL' 'Kont1',
            '01' '03' 'KONT2' 'GT_FINAL' 'Kont2',
            '01' '04' 'EBELN' 'GT_FINAL' 'PO',
            '01' '05' 'LIFNR' 'GT_FINAL' 'Vendor no',
            '01' '06' 'NAME1' 'GT_FINAL' 'Company',
            '01' '07' 'AEDAT' 'GT_FINAL' 'PO Crt dt',
            '01' '08' 'UDATE' 'GT_FINAL' 'Approved dt' ,
            '01' '09' 'INCO1' 'GT_FINAL' 'Incoterm Code',
            '01' '10' 'INCO2' 'GT_FINAL' 'Incoterm Text',
            '01' '11' 'EBELP' 'GT_FINAL' 'Item',
            '01' '12' 'MATNR' 'GT_FINAL' 'Material',
            '01' '13' 'TXZ01' 'GT_FINAL' 'Description',
            '01' '14' 'PAEDT' 'GT_FINAL' 'Chged date',
            '01' '15' 'EINDT' 'GT_FINAL' 'Delv date',
            '01' '16' 'EINDT1' 'GT_FINAL' 'OA date',
            '01' '17' 'LABNR' 'GT_FINAL' 'OA Number',
            '01' '18' 'BUDAT' 'GT_FINAL' 'GR date',
            '01' '19' 'MENGE' 'GT_FINAL' 'Order Qty',
            '01' '20' 'WEMNG' 'GT_FINAL' 'GR Qty',
            '01' '21' 'MEINS' 'GT_FINAL' 'UoM',
            '01' '22' 'VBELN' 'GT_FINAL' 'Ship notf #',
            '01' '23' 'TDDAT' 'GT_FINAL' 'ETD',
            '01' '24' 'LFDAT' 'GT_FINAL' 'ETA',
            '01' '25' 'LFIMG' 'GT_FINAL' 'Shipped Qty',
            '01' '26' 'VRKME' 'GT_FINAL' 'UoM',
            '01' '27' 'L_TEXT' 'GT_FINAL' 'Remarks'.
    endform.                    " MAINTAIN_FIELDCATLOG
    form FILL_FIELDCATLOG  using   lv_rowpos    TYPE sycurow
                                   lv_colpos    TYPE sycucol
                                   lv_fldnam    TYPE fieldname
                                   lv_tabnam    TYPE tabname
                                   lv_seltext   TYPE dd03p-scrtext_l.
      gs_fieldcat-row_pos   = lv_rowpos.
      gs_fieldcat-col_pos   = lv_colpos.
      gs_fieldcat-fieldname = lv_fldnam.
      gs_fieldcat-tabname   = lv_tabnam.
      gs_fieldcat-seltext_l = lv_seltext.
      APPEND gs_fieldcat TO gt_fieldcat.
      CLEAR gs_fieldcat.
    endform.                    " FILL_FIELDCATLOG
    form DISPLAY_DATA .
    DATA : lv_repid TYPE syrepid.
      lv_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = lv_repid
         it_fieldcat                       = gt_fieldcat
        TABLES
         t_outtab                          = gt_final
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2.
      IF sy-subrc <> 0.                              "#EC NEEDED
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    " DISPLAY_DATA

  • Top of Page Sequential/Hierarchical ALV using Class

    Hi Experts.
    I'd like to ask some codes on how to have the top-of-page function of the Sequential ALV using the CLASS cl_salv_hierseq_table.
    Points would be rewarded.
    Thanks!
    Message was edited by:
            Jay Cruz
    Message was edited by:
            Jay Cruz

    Hi Jay,
    Plz check out this code.
    REPORT BALVHT01 NO STANDARD PAGE HEADING.
    ALV
    TYPE-POOLS: SLIS.
    DB-Table
    TABLES: SCARR, SPFLI.
    Includes
    INCLUDE .
    CONSTANTS:
    GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
    DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          GS_LAYOUT   TYPE SLIS_LAYOUT_ALV,
          GS_KEYINFO  TYPE SLIS_KEYINFO_ALV,
          GT_SORT     TYPE SLIS_T_SORTINFO_ALV,
          GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
          GT_EVENTS   TYPE SLIS_T_EVENT.
    Data to be displayed
    DATA: BEGIN OF GT_SPFLI OCCURS 0.
            INCLUDE STRUCTURE SPFLI.
    DATA: ADD1,
          BOX,
          WERT TYPE P,
          LIGHTS.
    DATA: END OF GT_SPFLI.
    DATA: BEGIN OF GT_SCARR OCCURS 0.
            INCLUDE STRUCTURE SCARR.
    DATA: BOX,
          LIGHTS,
          EXPAND.
    DATA: END OF GT_SCARR.
    DATA: G_REPID LIKE SY-REPID.
    DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    Report Selections
    SELECT-OPTIONS CARRID FOR SCARR-CARRID.
    SELECTION-SCREEN SKIP 1.
    Parameters
    PARAMETERS: P_MAXROW TYPE I DEFAULT 50.
    SELECTION-SCREEN SKIP 1.
    Variante
    SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE TEXT-064.
    PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.
    SELECTION-SCREEN END OF BLOCK 0.
    Layout
    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-060.
    PARAMETERS:
                P_ZEBRA AS CHECKBOX DEFAULT ' ',
                P_NOCOLH AS CHECKBOX DEFAULT ' ',
                P_COLOPT AS CHECKBOX DEFAULT ' ',
                P_KEYHOT AS CHECKBOX DEFAULT ' ',
                P_NOINPT AS CHECKBOX DEFAULT ' '.
    SELECTION-SCREEN END OF BLOCK A.
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-061.
    PARAMETERS:
                P_LIGHTS AS CHECKBOX DEFAULT ' ',
                P_LIGHTC AS CHECKBOX DEFAULT ' '.
    SELECTION-SCREEN END OF BLOCK B.
    SELECTION-SCREEN BEGIN OF BLOCK C WITH FRAME TITLE TEXT-062.
    PARAMETERS:
                P_TOTONL AS CHECKBOX DEFAULT ' ',
                P_TOTEXT(60),
                P_STTEXT(60).
    SELECTION-SCREEN END OF BLOCK C.
    SELECTION-SCREEN BEGIN OF BLOCK D WITH FRAME TITLE TEXT-063.
    PARAMETERS:
                P_GPCE   AS CHECKBOX DEFAULT ' ',
                P_CHKBOX AS CHECKBOX DEFAULT ' ',
                P_EXPAND AS CHECKBOX DEFAULT ' ',
                P_DETPOP AS CHECKBOX DEFAULT ' '.
    SELECTION-SCREEN END OF BLOCK D.
    DATA:       G_BOXNAM TYPE SLIS_FIELDNAME VALUE  'BOX',
                G_EXPANDNAME TYPE SLIS_FIELDNAME VALUE  'EXPAND',
                P_F2CODE LIKE SY-UCOMM       VALUE  '&ETA',
                P_LIGNAM TYPE SLIS_FIELDNAME VALUE  'LIGHTS',
                G_SAVE(1) TYPE C,
                G_TABNAME_HEADER TYPE SLIS_TABNAME,
                G_TABNAME_ITEM   TYPE SLIS_TABNAME,
              g_default(1) type c,
                G_EXIT(1) TYPE C,
                GX_VARIANT LIKE DISVARIANT,
                G_VARIANT LIKE DISVARIANT.
    INITIALIZATION.
      G_REPID = SY-REPID.
      G_TABNAME_HEADER = 'GT_SCARR'.
      G_TABNAME_ITEM   = 'GT_SPFLI'.
    define keyinfo
      CLEAR GS_KEYINFO.
      GS_KEYINFO-HEADER01 = 'CARRID'.
      GS_KEYINFO-ITEM01   = 'CARRID'.
      PERFORM E01_FIELDCAT_INIT  USING GT_FIELDCAT[].
      PERFORM E03_EVENTTAB_BUILD USING GT_EVENTS[].
      PERFORM E04_COMMENT_BUILD  USING GT_LIST_TOP_OF_PAGE[].
      PERFORM E06_T_SORT_BUILD   USING GT_SORT[].
      PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].
    Schalter Varianten benutzerspezifisch/allgemein speicherbar setzen
    Set Options: save variants userspecific or general
      G_SAVE = 'A'.
      PERFORM VARIANT_INIT.
    Get default variant
      GX_VARIANT = G_VARIANT.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                I_SAVE     = G_SAVE
           CHANGING
                CS_VARIANT = GX_VARIANT
           EXCEPTIONS
                NOT_FOUND  = 2.
      IF SY-SUBRC = 0.
        P_VARI = GX_VARIANT-VARIANT.
      ENDIF.
    Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
      PERFORM F4_FOR_VARIANT.
    PAI
    AT SELECTION-SCREEN.
      PERFORM PAI_OF_SELECTION_SCREEN.
    START-OF-SELECTION.
      PERFORM SELECTION.
    END-OF-SELECTION.
      PERFORM E05_LAYOUT_BUILD USING GS_LAYOUT.     "wg. Parameters
    Call ABAP/4 List Viewer
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM       = G_REPID
              I_CALLBACK_PF_STATUS_SET = ' '
              I_CALLBACK_USER_COMMAND  = ' '
                IS_LAYOUT                = GS_LAYOUT
                IT_FIELDCAT              = GT_FIELDCAT[]
              IT_EXCLUDING             =
                IT_SPECIAL_GROUPS        = GT_SP_GROUP[]
                IT_SORT                  = GT_SORT[]
              IT_FILTER                =
              IS_SEL_HIDE              =
              I_SCREEN_START_COLUMN    = 0
              I_SCREEN_START_LINE      = 0
              I_SCREEN_END_COLUMN      = 0
              I_SCREEN_END_LINE        = 0
              i_default                = g_default
                I_SAVE                   = G_SAVE
                IS_VARIANT               = G_VARIANT
                IT_EVENTS                = GT_EVENTS[]
              IT_EVENT_EXIT            =
                I_TABNAME_HEADER         = G_TABNAME_HEADER
                I_TABNAME_ITEM           = G_TABNAME_ITEM
                IS_KEYINFO               = GS_KEYINFO
              IS_PRINT                 =
         IMPORTING
              E_EXIT_CAUSED_BY_CALLER  =
           TABLES
                T_OUTTAB_HEADER          = GT_SCARR
                T_OUTTAB_ITEM            = GT_SPFLI.
          FORM E01_FIELDCAT_INIT                                        *
    -->  E01_LT_FIELDCAT                                               *
    FORM E01_FIELDCAT_INIT USING E01_LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
      DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'ADD1'.
      LS_FIELDCAT-TABNAME      = G_TABNAME_ITEM.
      LS_FIELDCAT-REPTEXT_DDIC = '?'.
      LS_FIELDCAT-OUTPUTLEN    = 1.
      LS_FIELDCAT-NO_OUT       = 'X'.
      LS_FIELDCAT-INPUT        = 'X'.
      LS_FIELDCAT-SP_GROUP = 'A'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
              I_PROGRAM_NAME         =
                I_INTERNAL_TABNAME     = G_TABNAME_HEADER
                I_STRUCTURE_NAME       = 'SCARR'
              I_CLIENT_NEVER_DISPLAY = 'X'
           CHANGING
                CT_FIELDCAT            = E01_LT_FIELDCAT[].
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
              I_PROGRAM_NAME         =
                I_INTERNAL_TABNAME     = G_TABNAME_ITEM
                I_STRUCTURE_NAME       = 'SPFLI'
              I_CLIENT_NEVER_DISPLAY = 'X'
           CHANGING
                CT_FIELDCAT            = E01_LT_FIELDCAT[].
    geht am Anfang nicht !!!!
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'WERT'.
      LS_FIELDCAT-TABNAME      = G_TABNAME_ITEM.
      LS_FIELDCAT-REPTEXT_DDIC = 'Wert'(070).
      LS_FIELDCAT-OUTPUTLEN    = 4.
      LS_FIELDCAT-INTTYPE      ='P'.
      APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.
    ENDFORM.
          FORM E02_DATA_ADD                                             *
    -->  E02_LT_SFLIGHT                                                *
    FORM E02_DATA_ADD TABLES E02_LT_SPFLI STRUCTURE GT_SPFLI.
      LOOP AT E02_LT_SPFLI.
        IF SY-TABIX > 10.
          E02_LT_SPFLI-ADD1 = 'A'.
          E02_LT_SPFLI-BOX  = 'X'.
          E02_LT_SPFLI-LIGHTS = '3'.
        ELSE.
          IF SY-TABIX = 1.
            E02_LT_SPFLI-LIGHTS = '2'.
          ELSE.
            E02_LT_SPFLI-LIGHTS = '1'.
          ENDIF.
        ENDIF.
        E02_LT_SPFLI-WERT = SY-TABIX MOD 5.
        MODIFY E02_LT_SPFLI.
      ENDLOOP.
    ENDFORM.
          FORM E03_EVENTTAB_BUILD                                       *
    -->  E03_LT_EVENTS                                                 *
    FORM E03_EVENTTAB_BUILD USING E03_LT_EVENTS TYPE SLIS_T_EVENT.
      DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE = 1
           IMPORTING
                ET_EVENTS   = E03_LT_EVENTS.
      READ TABLE E03_LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                               INTO LS_EVENT.
      IF SY-SUBRC = 0.
        MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
        APPEND LS_EVENT TO E03_LT_EVENTS.
      ENDIF.
    ENDFORM.
          FORM E04_COMMENT_BUILD                                        *
    -->  E04_LT_TOP_OF_PAGE                                            *
    FORM E04_COMMENT_BUILD USING E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
    Listenüberschrift: Typ H
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  not used for this type
      LS_LINE-INFO = TEXT-001.
      APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
    Kopfinfo: Typ S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = TEXT-050.
      LS_LINE-INFO = TEXT-010.
      APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
      LS_LINE-KEY  = TEXT-051.
      APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
    Aktionsinfo: Typ A
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'A'.
    LS_LINE-KEY:  not used for this type
      LS_LINE-INFO = TEXT-002.
      APPEND LS_LINE TO  E04_LT_TOP_OF_PAGE.
    ENDFORM.
          FORM E05_LAYOUT_BUILD                                         *
    <->  E05_LS_LAYOUT                                                 *
    FORM E05_LAYOUT_BUILD USING E05_LS_LAYOUT TYPE SLIS_LAYOUT_ALV.
      E05_LS_LAYOUT-F2CODE            = P_F2CODE.
      E05_LS_LAYOUT-ZEBRA          = P_ZEBRA.
      E05_LS_LAYOUT-COLWIDTH_OPTIMIZE = P_COLOPT.
      IF P_CHKBOX = 'X'.
        E05_LS_LAYOUT-BOX_FIELDNAME     = G_BOXNAM.
        E05_LS_LAYOUT-BOX_TABNAME       = G_TABNAME_ITEM.
      ELSE.
        CLEAR E05_LS_LAYOUT-BOX_FIELDNAME.
        CLEAR E05_LS_LAYOUT-BOX_TABNAME.
      ENDIF.
      IF P_EXPAND = 'X'.
        E05_LS_LAYOUT-EXPAND_FIELDNAME     = G_EXPANDNAME.
      ELSE.
        CLEAR E05_LS_LAYOUT-EXPAND_FIELDNAME.
      ENDIF.
      E05_LS_LAYOUT-NO_INPUT          = P_NOINPT.
      E05_LS_LAYOUT-NO_COLHEAD        = P_NOCOLH.
      IF P_LIGHTS = 'X' OR P_LIGHTC = 'X'.
        E05_LS_LAYOUT-LIGHTS_FIELDNAME = P_LIGNAM.
        E05_LS_LAYOUT-LIGHTS_TABNAME   = G_TABNAME_ITEM.
      ELSE.
        CLEAR E05_LS_LAYOUT-LIGHTS_FIELDNAME.
        CLEAR E05_LS_LAYOUT-LIGHTS_TABNAME.
      ENDIF.
      IF P_GPCE = 'X'.
        E05_LS_LAYOUT-GROUP_CHANGE_EDIT = 'X'.
      ENDIF.
      E05_LS_LAYOUT-LIGHTS_CONDENSE = P_LIGHTC.
      E05_LS_LAYOUT-TOTALS_TEXT       = P_TOTEXT.
      E05_LS_LAYOUT-SUBTOTALS_TEXT    = P_STTEXT.
      E05_LS_LAYOUT-TOTALS_ONLY       = P_TOTONL.
      E05_LS_LAYOUT-KEY_HOTSPOT       = P_KEYHOT.
      E05_LS_LAYOUT-DETAIL_POPUP      = P_DETPOP.
    ENDFORM.
          FORM E06_T_SORT_BUILD                                         *
    -->  E06_LT_SORT                                                   *
    FORM E06_T_SORT_BUILD USING E06_LT_SORT TYPE SLIS_T_SORTINFO_ALV.
      DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.
      CLEAR LS_SORT.
      LS_SORT-FIELDNAME = 'CARRID'.
      LS_SORT-TABNAME   = G_TABNAME_HEADER.
      LS_SORT-SPOS      = 1.
      LS_SORT-UP        = 'X'.
      APPEND LS_SORT TO E06_LT_SORT.
      CLEAR LS_SORT.
      LS_SORT-FIELDNAME = 'CONNID'.
      LS_SORT-TABNAME   = G_TABNAME_ITEM.
      LS_SORT-SPOS      = 2.
      LS_SORT-DOWN      = 'X'.
      APPEND LS_SORT TO E06_LT_SORT.
    ENDFORM.
          FORM E07_SP_GROUP_BUILD                                       *
    -->  E07_LT_SP_GROUP                                               *
    FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.
      DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.
      CLEAR  LS_SP_GROUP.
      LS_SP_GROUP-SP_GROUP = 'A'.
      LS_SP_GROUP-TEXT     = TEXT-005.
      APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.
    ENDFORM.
          FORM SELECTION                                                *
    FORM SELECTION.
      SELECT * FROM SCARR INTO CORRESPONDING FIELDS OF TABLE GT_SCARR
                                                  WHERE CARRID IN CARRID.
      SELECT * FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE GT_SPFLI
                                                  UP TO P_MAXROW ROWS
                                                  WHERE CARRID IN CARRID.
      LOOP AT GT_SCARR.
        READ TABLE GT_SPFLI WITH KEY CARRID = GT_SCARR-CARRID.
        IF SY-SUBRC NE 0.
          DELETE GT_SCARR.
        ENDIF.
      ENDLOOP.
      PERFORM E02_DATA_ADD TABLES GT_SPFLI.
    ENDFORM.
          FORM TOP_OF_PAGE                                              *
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
    ENDFORM.
          FORM F4_FOR_VARIANT                                           *
    FORM F4_FOR_VARIANT.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                IS_VARIANT          = G_VARIANT
                I_SAVE              = G_SAVE
                I_TABNAME_HEADER    = G_TABNAME_HEADER
                I_TABNAME_ITEM      = G_TABNAME_ITEM
              it_default_fieldcat =
           IMPORTING
                E_EXIT              = G_EXIT
                ES_VARIANT          = GX_VARIANT
           EXCEPTIONS
                NOT_FOUND = 2.
      IF SY-SUBRC = 2.
        MESSAGE ID SY-MSGID TYPE 'S'      NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        IF G_EXIT = SPACE.
          P_VARI = GX_VARIANT-VARIANT.
        ENDIF.
      ENDIF.
    ENDFORM.
    *&      Form  PAI_OF_SELECTION_SCREEN
          text
    FORM PAI_OF_SELECTION_SCREEN.
      IF NOT P_VARI IS INITIAL.
        MOVE G_VARIANT TO GX_VARIANT.
        MOVE P_VARI TO GX_VARIANT-VARIANT.
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
             EXPORTING
                  I_SAVE     = G_SAVE
             CHANGING
                  CS_VARIANT = GX_VARIANT.
        G_VARIANT = GX_VARIANT.
      ELSE.
        PERFORM VARIANT_INIT.
      ENDIF.
    ENDFORM.                               " PAI_OF_SELECTION_SCREEN
    *&      Form  VARIANT_INIT
          text
    -->  p1        text
    <--  p2        text
    FORM VARIANT_INIT.
      CLEAR G_VARIANT.
      G_VARIANT-REPORT = G_REPID.
    ENDFORM.                               " VARIANT_INIT
    Regards,
    Kiran

  • How To Print Field Value in TOP-OF-PAGE During Line Selection.

    How To Print Field Value in TOP-OF-PAGE During Line Selection when double click on field.

    (If my memory serves me well (not used for long time ago)
    Assign values to system fields sy-tvar0 - sy-tvar9, they will replace the placeholders "&0" through "&9" in the list headers and column headers.
    TOP-OF-PAGE DURING LINE-SELECTION.
         WRITE: / 'Interactive Report &3'.
      WRITE record-vbeln TO sy-tvar3.
    Regards,
    Raymond

  • How to display values in top of page in ALV report

    Hai,
      This is my billing report program, i developed that object by using ALV but i could not able to use Top-of-page. please any one correct my code,
    *& Report  ZE0232_ALV_BILLING                                          *
    report  ze0232_alv_billing.
    type-pools: slis.
    data: repid like sy-repid.
    data: fieldcatalog type slis_t_fieldcat_alv,
          wa_fieldcatalog type slis_fieldcat_alv.
    data : ievent type slis_t_event,
    wevent type slis_alv_event.
    data: sal_text like tvkot-vtext,
          DIS_TEXT LIKE TVTWT-VTEXT,
          DIV_TEXT LIKE TSPAT-VTEXT.
    tables: vbrk.
    data: begin of i_vbrk occurs 0,
          vbeln like vbrk-vbeln,
          fkdat like vbrk-fkdat,
          erdat like vbrk-erdat,
          kunrg like vbrk-kunrg,
          name1 like kna1-name1,
          netwr like vbrk-netwr,
          stext like tvkot-vtext,
          dtext like tvtwt-vtext,
          divtext like tspat-vtext,
          end of i_vbrk.
    selection-screen begin of block billing with frame.
    parameters: salesorg like vbrk-vkorg.
    select-options: dischanl for vbrk-vtweg,
                    division for vbrk-spart,
                    bildat for vbrk-fkdat.
    selection-screen end of block billing.
    select vbeln fkdat erdat kunrg netwr from vbrk into corresponding fields of table i_vbrk where vkorg = salesorg
                                                                                    and vtweg in dischanl
                                                                                    and spart in division
                                                                                    and fkdat in bildat.
    select vtext from tvkot into sal_text where vkorg = salesorg and spras = 'EN'.
    endselect.
    select vtext from TVTWT into DIS_text where VTWEG IN dischanl and spras = 'EN'.
    endselect.
    select vtext from TSPAT into DIV_text where SPART IN DIVISION and spras = 'EN'.
    endselect.
    loop at i_vbrk.
      move: sal_text to i_vbrk-stext,
            DIS_TEXT TO I_VBRK-DTEXT,
            DIV_TEXT TO I_VBRK-DIVTEXT.
      modify i_vbrk.
    endloop.
    perform get_fieldcatalog.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
        i_callback_program                = repid
      I_GRID_TITLE                      =
        i_callback_top_of_page            = 'TOPS'
        it_fieldcat                       = fieldcatalog
      tables
        t_outtab                          = i_vbrk
    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  GET_FIELDCATALOG
          text
    <b>form tops.
      write :/ 'Hai Welcome'.
    endform.                    "tops</b>&----
    *&      Form  get_fieldcatalog
          text
    form get_fieldcatalog.
      wa_fieldcatalog-col_pos = '1'.
      wa_fieldcatalog-fieldname = 'VBELN'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'SALES DOCUMENT'.
    WA_fieldcatalog-rollname  = 'VBELN'.
      wa_fieldcatalog-hotspot   = 'X'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '2'.
      wa_fieldcatalog-fieldname = 'FKDAT'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'BILL DATE'.
    WA_fieldcatalog-rollname  = 'VBELN'.
    WA_fieldcatalog-hotspot   = 'X'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '3'.
      wa_fieldcatalog-fieldname = 'ERDAT'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'CREATED DATE'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '4'.
      wa_fieldcatalog-fieldname = 'KUNRG'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'CUSTOMER NO'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '5'.
      wa_fieldcatalog-fieldname = 'NAME1'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'CUSTOMER NAME'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '6'.
      wa_fieldcatalog-fieldname = 'NETWR'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'NET VALUE'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '7'.
      wa_fieldcatalog-fieldname = 'STEXT'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'SALES ORG'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '8'.
      wa_fieldcatalog-fieldname = 'DTEXT'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'DIS.CHANNEL'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
      wa_fieldcatalog-col_pos = '9'.
      wa_fieldcatalog-fieldname = 'DIVTEXT'.
      wa_fieldcatalog-tabname   = 'I_VBAK'.
      wa_fieldcatalog-seltext_m = 'DIVISION'.
      append wa_fieldcatalog to fieldcatalog.
      clear wa_fieldcatalog.
    endform.                    "GET_FIELDCATALOG

    HI see this report
    you can know how to write TOP-OF_PAGE code
    and insert LOGO also
    *& Report  ZTEST_ALV_LOGO
    REPORT  ztest_alv_logo.
    TYPE-POOLS : slis.
    *ALV Formatting tables /structures
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: gt_events   TYPE slis_t_event.
    DATA: gs_layout   TYPE slis_layout_alv.
    DATA: gt_page     TYPE slis_t_listheader.
    DATA: gs_page     TYPE slis_listheader.
    DATA: v_repid     LIKE sy-repid.
    *ALV Formatting work area
    DATA: w_fieldcat TYPE slis_fieldcat_alv.
    DATA: w_events   TYPE slis_alv_event.
    DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.
    INITIALIZATION.
      PERFORM build_events.
      PERFORM build_page_header.
    START-OF-SELECTION.
    *perform build_comment.     "top_of_page - in initialization at present
      SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.
    *perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
    *USING = Row, Column, Field name, display length, table name, heading
    *OR
      PERFORM build_fieldcat.
      gs_layout-zebra = 'X'.
    *top of page event does not work without I_callback_program
      v_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program                = v_repid
          i_structure_name                  = 'BSID'
       i_background_id                   = 'ALV_BACKGROUND'
          i_grid_title                      = 'This is the grid title'
      I_GRID_SETTINGS                   =
          is_layout                         = gs_layout
          it_fieldcat                       = gt_fieldcat[]
          it_events                         = gt_events[]
        TABLES
          t_outtab                          = gt_bsid.
    Form..............:  populate_for_fm
    Description.......:  Populates fields for function module used in ALV
    FORM populate_for_fm USING p_row
                               p_col
                               p_fieldname
                               p_len
                               p_table
                               p_desc.
      w_fieldcat-row_pos      = p_row.          "Row Position
      w_fieldcat-col_pos      = p_col.          "Column Position
      w_fieldcat-fieldname    = p_fieldname.    "Field name
      w_fieldcat-outputlen    = p_len.          "Column Lenth
      w_fieldcat-tabname      = p_table.        "Table name
      w_fieldcat-reptext_ddic = p_desc.         "Field Description
      w_fieldcat-input        = '1'.
      APPEND w_fieldcat TO gt_fieldcat.
      CLEAR w_fieldcat.
    ENDFORM.                    " populate_for_fm
    *&      Form  build_events
    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_user_command
                 INTO ls_event.
      IF sy-subrc = 0.
        MOVE slis_ev_user_command TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
      READ TABLE gt_events
                 WITH KEY name =  slis_ev_top_of_page
                 INTO ls_event.
      IF sy-subrc = 0.
        MOVE slis_ev_top_of_page TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
    ENDFORM.                    " build_events
    *&      Form  USER_COMMAND
    When user command is called it uses 2 parameters. The itab
    passed to the ALV is in whatever order it currently is on screen.
    Therefore, you can read table itab index rs_selfield-tabindex to get
    all data from the table. You can also check r_ucomm and code
    accordingly.
    FORM user_command USING  r_ucomm     LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      READ TABLE gt_bsid INDEX rs_selfield-tabindex.
    error checking etc.
      SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.
      CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
    ENDFORM.                    "user_command
    *&      Form  top_of_page
    Your own company logo can go here if it has been saved (OAOR)
    If the logo is larger than the size of the headings in gt_page,
    the window will not show full logo and will have a scroll bar. Thus,
    it is a good idea to have a standard ALV header if you are going to
    use logos in your top of page.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_page
          i_logo             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "top_of_page
    *&      Form  build_fieldcat
    *Many and varied fields are available here. Have a look at documentation
    *for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
    FORM build_fieldcat.
      w_fieldcat-fieldname  = 'BUDAT'.
      w_fieldcat-seltext_m  = 'Dte pst'.
      w_fieldcat-ddictxt(1) = 'M'.
      w_fieldcat-edit = 'x'.
    Can change the position of fields if you do not want them in order
    of the DDIC or itab
    w_fieldcat-row_pos = '1'.
    w_fieldcat-col_pos = '10'.
      APPEND w_fieldcat TO gt_fieldcat.
      CLEAR w_fieldcat.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_page_header
          gt_page is used in top of page (ALV subroutine - NOT event)
          *H = Header, S = Selection, A = Action
    FORM build_page_header.
    For Headers, Key is not printed and is irrelevant. Will not cause
    a syntax error, but is not used.
      gs_page-typ  = 'H'.
      gs_page-info = 'Header 1'.
      APPEND gs_page TO gt_page.
      gs_page-typ  = 'H'.
      gs_page-info = 'Header 2'.
      APPEND gs_page TO gt_page.
    For Selections, the Key is printed (bold). It can be anything up to 20
    bytes. It gets printed in order of code here, not by key value.
      gs_page-typ  = 'S'.
      gs_page-key  = 'And the winner is:'.
      gs_page-info = 'Selection 1'.
      APPEND gs_page TO gt_page.
      gs_page-typ  = 'S'.
      gs_page-key  = 'Runner up:'.
      gs_page-info = 'Selection 2'.
      APPEND gs_page TO gt_page.
    For Action, Key is also irrelevant.
      gs_page-typ  = 'A'.
      gs_page-info = 'Action goes here'.
      APPEND gs_page TO gt_page.
    ENDFORM.                    " build_page_header
    <b>Reward if useful</b>

  • How to declare top of page in alv report

    hi guru
    how to declare top of page in alv report
    thanks
    subhasis

    Hi,
    check this simple program.
    REPORT ZBHALV_LIST.
    TABLES:MARA.
    SELECT-OPTIONS: MATNR FOR MARA-MATNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    MATNR LIKE MARA-MATNR,
    ERSDA LIKE MARA-ERSDA,
    MTART LIKE MARA-MTART,
    MBRSH LIKE MARA-MBRSH,
    END OF ITAB.
    SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR
    IN MATNR.
    TYPE-POOLS SLIS.
    DATA:FCAT TYPE slis_t_fieldcat_alv.
    DATA:LAYOUT TYPE slis_layout_alv.
    DATA:EVE TYPE slis_t_event WITH HEADER LINE.
    DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    SORT-UP = 'X'.
    SORT-SPOS = 1.
    SORT-FIELDNAME = 'ERSDA'.
    SORT-tabname = 'MARA'.
    APPEND SORT.
    SORT-SPOS = 2.
    SORT-FIELDNAME = 'MTART'.
    SORT-tabname = 'MARA'.
    APPEND SORT.
    EVE-NAME = 'TOP_OF_PAGE'.
    EVE-FORM = 'TOPOFPAGE'.
    APPEND EVE.
    EVE-NAME = 'TOP_OF_LIST'.
    EVE-FORM = 'TOPOFLIST'.
    APPEND EVE.
    EVE-NAME = 'END_OF_LIST'.
    EVE-FORM = 'ENDOFLIST'.
    APPEND EVE.
    LAYOUT-ZEBRA = 'X'.
    LAYOUT-no_hline = 'X'.
    LAYOUT-NO_VLINE = 'X'.
    LAYOUT-window_titlebar = 'MATERIAL DETAILS'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_STRUCTURE_NAME =
    I_CLIENT_NEVER_DISPLAY = 'X'
    I_INCLNAME = SY-REPID
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE =
    CHANGING
    CT_FIELDCAT = FCAT
    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.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    IT_SORT = SORT[]
    IT_EVENTS = EVE[]
    TABLES
    T_OUTTAB = ITAB .
    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 TOPOFPAGE.
    REFRESH HEAD.
    HEAD-TYP = 'H'.
    HEAD-INFO = 'MATERIALS'.
    APPEND HEAD.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEAD[]
    I_LOGO =
    I_END_OF_LIST_GRID =
    ENDFORM.
    FORM TOPOFLIST.
    REFRESH HEAD.
    HEAD-TYP = 'H'.
    HEAD-INFO = 'MATERIALS-LISTTOP'.
    APPEND HEAD.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEAD[]
    I_LOGO =
    I_END_OF_LIST_GRID =
    ENDFORM.
    FORM ENDOFLIST.
    REFRESH HEAD.
    HEAD-TYP = 'H'.
    HEAD-INFO = 'MATERIALS-LISTEND'.
    APPEND HEAD.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEAD[]
    I_LOGO =
    I_END_OF_LIST_GRID =
    ENDFORM.
    Regards,
    Priyanka.

  • How to write ICONS in ALV TOP of Page

    Hai experts,
    How to ICON in ALV  Top of PAGE
    i want to wrire
    ICON_LED_RED for cancellation Invioce
    ICON_LED_GREEN for  Invioce
    but i pass this values to wa_header-info it comes  @5C@ @5B@
    thanks
    sitaram

    Hi...
       I think this code is help full for u....
    *& Report ZFI_TEST *
    REPORT ZFI_ICON_TEST MESSAGE-ID zz .
    *& TABLES DECLARATION *
    TABLES: vbak.
    *& TYPE POOLS DECLARATION *
    TYPE-POOLS: slis.
    *& INTERNAL TABLE DECLARATION *
    DATA: BEGIN OF itab OCCURS 0,
    icon TYPE icon-id, "itab-icon = '@08@' -> Green ; '@09@' -> Yellow ; '@0A@' -> Red
    vbeln LIKE vbak-vbeln,
    audat LIKE vbak-audat,
    vbtyp LIKE vbak-vbtyp,
    auart LIKE vbak-auart,
    augru LIKE vbak-augru,
    netwr LIKE vbak-netwr,
    waerk LIKE vbak-waerk,
    END OF itab.
    *INTERNAL TABLE FOR FIELD CATALOG
    DATA: wa_fieldcat TYPE slis_fieldcat_alv,
    it_fieldcat TYPE slis_t_fieldcat_alv.
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV
    WITH HEADER LINE,
    *INTERNAL TABLE FOR EVENTS
    DATA: it_event TYPE slis_t_event,
    wa_event TYPE slis_alv_event,
    *INTERNAL TABLE FOR SORTING
    it_sort TYPE slis_t_sortinfo_alv,
    wa_sort TYPE slis_sortinfo_alv,
    *INTERNAL TABLE FOR LAYOUT
    wa_layout TYPE slis_layout_alv.
    *& VARIABLE DECLARATION *
    DATA : v_repid TYPE sy-repid,
    v_pagno(4) TYPE n,
    v_date(8) TYPE c.
    *& CONSTANTS *
    CONSTANTS: c_x TYPE c VALUE 'X'.
    *& SELECTION SCREEN *
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
    s_vbtyp FOR vbak-vbtyp DEFAULT 'C'.
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-003.
    PARAMETERS: p_list RADIOBUTTON GROUP rad1 DEFAULT 'X'.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-004.
    PARAMETERS: p_grid RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN: END OF BLOCK b2.
    AT SELECTION-SCREEN.
    PERFORM validate_screen.
    *& START OF SELECTION *
    START-OF-SELECTION.
    CLEAR: itab, itab[].
    V_REPID = SY-REPID.
    PERFORM get_data.
    PERFORM display_data.
    *& END OF SELECTION *
    END-OF-SELECTION.
    *--DO ALV Process
    v_repid = sy-repid.
    *--Sort the Output Fields
    PERFORM sort_fields.
    *--Build Field catalog for the Output fields
    PERFORM BUILD_FIELDCAT.
    *--Set the Layout for ALV
    PERFORM set_layout.
    *& Form GET_DATA
    text
    TO GET THE DATA FROM TABLES INTO ITAB
    FORM get_data .
    SELECT vbeln
    audat
    vbtyp
    auart
    augru
    netwr
    waerk
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM vbak
    WHERE vbeln IN s_vbeln AND
    audat > '04.04.2005'
    AND netwr > 0.
    LOOP AT itab.
    IF itab-netwr < 10000.
    itab-icon = '@08@'.
    ELSEIF itab-netwr > 10000 AND itab-netwr < 100000.
    itab-icon = '@09@'.
    ELSEIF itab-netwr > 100000.
    itab-icon = '@0A@'.
    ENDIF.
    MODIFY itab INDEX sy-tabix.
    ENDLOOP.
    ENDFORM. " GET_DATA
    *& Form sort_fields
    FORM sort_fields .
    CLEAR wa_sort.
    wa_sort-fieldname = 'VBTYP'.
    wa_sort-spos = '1'.
    wa_sort-up = 'X'.
    APPEND wa_sort TO it_sort.
    CLEAR wa_sort.
    wa_sort-fieldname = 'NETWR'.
    wa_sort-spos = '2'.
    wa_sort-up = 'X'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO it_sort.
    ENDFORM. " sort_fields
    *& Form set_layout
    FORM set_layout .
    IF p_list = c_x .
    wa_layout-window_titlebar = 'LIST DISPLAY'(016).
    wa_layout-zebra = 'X'.
                    +
                    +
    ALV LIST DISPLAY
    PERFORM list_display TABLES itab.
              o
                    +
                    + ALV GRID DISPLAY
    ELSEIF p_grid = c_x.
    wa_layout-window_titlebar = 'GRID DISPLAY'(017).
    wa_layout-zebra = 'X'.
    PERFORM grid_display TABLES itab.
    ENDIF.
    ENDFORM. " set_layout
    *& Form list_display
    FORM list_display TABLES p_itab .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    is_layout = wa_layout
    it_fieldcat = it_fieldcat[]
    it_sort = it_sort[]
    i_save = 'U'
    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. " list_display
    *& Form GRID_DISPLAY
    FORM grid_display TABLES p_itab .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    is_layout = wa_layout
    it_fieldcat = it_fieldcat[]
    it_sort = it_sort[]
    it_events = it_event
    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. " GRID_DISPLAY
    *& Form VALIDATE_SCREEN
    text
    --> p1 text
    <-- p2 text
    FORM validate_screen .
    DATA: lv_vbeln LIKE vbak-vbeln.
    IF NOT s_vbeln IS INITIAL.
    SELECT vbeln
    INTO lv_vbeln
    UP TO 1 ROWS
    FROM vbak
    WHERE vbeln IN s_vbeln.
    ENDSELECT.
    IF sy-subrc <> 0.
    MESSAGE e000 WITH 'INVALID SALES DOC'.
    ENDIF.
    ENDIF.
    ENDFORM. " VALIDATE_SCREEN
    *& Form display_data
    text
    --> p1 text
    <-- p2 text
    FORM display_data .
    DEFINE m_fieldcat.
    add 1 to wa_fieldcat-col_pos.
    wa_fieldcat-fieldname = &1.
    wa_fieldcat-ref_tabname = 'VBAK'.
    wa_fieldcat-do_sum = &2.
    wa_fieldcat-cfieldname = &3.
    append wa_fieldcat to it_fieldcat.
    END-OF-DEFINITION.
    DATA:
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv.
    m_fieldcat 'ICON' '' ''.
    m_fieldcat 'VBELN' '' ''.
    m_fieldcat 'AUDAT' '' ''.
    m_fieldcat 'VBTYP' '' ''.
    m_fieldcat 'AUART' '' ''.
    m_fieldcat 'AUGRU' '' ''.
    m_fieldcat 'NETWR' 'C' 'WAERK'.
    m_fieldcat 'WAERK' '' ''.
    ENDFORM. " display_data[/code]
    Regards,
    Rahul
    Edited by: Rahul Reddy on Apr 14, 2008 12:33 PM

Maybe you are looking for

  • Problem with Oracle during installation of NW

    Hi all, I have to install SAP NW on one host(for example IP 192.168.2.2) with the Oracle being installed on different host(for example 192.168.2.3) but the installation od database instance fails. Installator can not connect to Oracle on different ho

  • Submit report and export to memory

    Hi I am using this code to submit report submit ZM005REP WITH S_BLEND IN R2 WITH S_GROUP IN R3 WITH S_WERKS IN r1 exporting list to memory and return. I am using LIST_FROM_MEMORY to read the list. I want to further use the values from this list for c

  • Have a ipod nano 5th gen., keep getting error message 13019!!!

    I have an ipod nano, 5th gen. Yesterday when I tried to sync music I received error code 13019. I tried unsyncing music, resyncing,...finally ended up restoring, resetting..nothing worked. All updates are current on itunes and ipod. This has never ha

  • UIElement getting disabled

    Hi, I am trying to create a wd view layout with multiple groups and ui elements within it. I accidentally clicked on 'deploy and run' before 'save metadata', when there were couple of compile errors in the view. After I did this, the group in which t

  • AdvancedDataGrid view Header color and text

    Hi, I want to change the color of datagrid header as well as change the color of header text(only) not entire column. i dont know how to do this .please help me boz i m new in flex.