How to write top-of-page in include structure

Hi,
how write top-of-page event, perform & form routines in include program. but include is under Function & function.
when i am writing those statement get the error massage.
the error massgae is : (incorrect nesting : before the statement 'top-of-page'the structure introduced by Function must be concluded by Endfunction).
Edited by: sandhya kiran on Nov 6, 2008 5:50 PM

hi,
in program error not occured.
but same program i am use in smartforms-programline it's give error like
" Incorrect nesting: Before the statement "FORM", the structure introduced by "FUNCTION" must be concluded by "ENDFUNCTION" . . ."
Thanks In Advance.
Regards .
Sam

Similar Messages

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

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

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

  • How to write code for page up and page down buttons on alv screen?

    Hi,
    Page up and page down buttons are not working in general alv report. Thease buttons are in disable mode. But is stnd. transactions (tcode : fbl5n)  these are enabled and working properly, but we can't debug this with /h
    How to write code for page up and page down buttons on alv screen?

    Poonam,
    On doing the screen debugging it took me over to    Include LSTXWFCC ,kindly check the below code.
    module cc_display.
      fcode = sy-ucomm(4).
      case sy-ucomm(4).
        when 'P--'.
          perform cc_firstpage.
        when 'P-'.
          perform cc_prevpage.
        when 'P+'.
          perform cc_nextpage.
        when 'P++'.
          perform cc_lastpage.
        when 'EX--'.
          perform cc_firstcopy.
        when 'EX-'.
          perform cc_prevcopy.
        when 'EX+'.
          perform cc_nextcopy.
        when 'EX++'.
          perform cc_lastcopy.
    I guess it can give you some lead.
    K.Kiran.

  • HOW MANY TIMES TOP OF PAGE WILL BE EXECUTED ?

    HOW MANY TIMES TOP OF PAGE WILL BE EXECUTED IF THERE ARE MULTIPLE PAGES AND MULTIPLE WRITE COMMANDS IN A REPORT, SAY THERE ARE 10 PAGES TO BE PRINTED.
    BEST REGARDS,
    RYAN.

    if you process n times then n times the top of page will be executed.

  • 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 provide top of page in ALV reports

    Hi....
    here is requirement.
    i entered some 1000 to 2000 in the selection screen.
    now i want to display the same in output list.
    that is the <b></b>output from 1000 to 2000 are displayed with 1000 records<b></b>
    like this i want to display in top of list in alv report.
    how to do this requirement.
    thanks and regards,
    k.swaminath reddy.

    hi,
    check this one
    *& Report  ZALV_FIELD_GRID1
    REPORT  ZALV_FIELD_GRID1
            NO STANDARD PAGE HEADING.
    TABLES MARA.
    type-pools :slis.
    TYPES : BEGIN OF TMARA ,
            MATNR LIKE MARA-MATNR,
            MEINS LIKE MARA-MEINS,
            ERSDA LIKE MARA-ERSDA,
            color(4) type c,
            SEL type c,
            LIGHT TYPE C,
            END OF TMARA.
    TYPES: BEGIN OF TMAKT,
           MATNR LIKE MAKT-MATNR,
           MAKTX LIKE MAKT-MAKTX,
           MAKTG LIKE MAKT-MAKTG,
           SEL TYPE C,
           COLOR(4),
           END OF TMAKT.
    DATA:  ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
           ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
           wa_fieldcat type slis_fieldcat_alv,
           fieldcat type slis_fieldcat_alv occurs 0,
           i_layout type slis_layout_alv,
           WA_LISTHEADER TYPE SLIS_LISTHEADER ,
           i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
           V_EVENTS TYPE SLIS_T_EVENT ,
           WA_EVENT TYPE SLIS_ALV_EVENT,
           I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
           I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
           SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
           PRINT_CONT type slis_print_alv.
    SELECTION SCREE
    selection-screen  begin of block screen1  with frame title TEXT-001.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN COMMENT /32(35) COMM1.
    SELECTION-SCREEN ULINE /27(35).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS MATNR FOR MARA-MATNR.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN ULINE.
    SELECTION-SCREEN COMMENT /30(50) COMM2.
    SELECTION-SCREEN ULINE /27(40).
    SELECTION-SCREEN SKIP.
    SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
    SELECTION-SCREEN SKIP.
    selection-screen  end of block screen1.
        INITIALIZATION
    INITIALIZATION.
      MATNR-low = '23'.
      MATNR-high = '1000'.
      MATNR-option = 'BT'.
      MATNR-sign = 'I'.
      APPEND MATNR.
      ERSDA-low = '20030124'.
      ERSDA-high = '20050302' .
      APPEND ERSDA.
      PERFORM FILLFIELD.
      PERFORM FILLLAYOUT.
      PERFORM build_print_params.
      PERFORM FILL_SORT.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
            SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      comm1 ='SELECT MATERIAL NUMBER  RANGE'.
      comm2 ='SELECT MATERIAL CREATION DATE'.
               START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM READDATA.
      PERFORM POPDATA.
    *&      Form  READDATA
          text
    FORM READDATA .
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = MATNR-LOW
        IMPORTING
          OUTPUT = MATNR-LOW.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = MATNR-HIGH
        IMPORTING
          OUTPUT = MATNR-HIGH.
      SELECT MATNR
             ERSDA
             MEINS
             FROM MARA
             INTO CORRESPONDING FIELDS OF
            TABLE ITAB
            WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
      LOOP AT ITAB.
        data id_color type i VALUE 1.
        data id_colors(2) type c.
        IF ITAB-MATNR < '000000000000000100'.
          ITAB-LIGHT = '1'.
        ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
       '000000000000000100' .
          ITAB-LIGHT = '2'.
        ELSE.
          ITAB-LIGHT = '3'.
        ENDIF.
        id_color = id_color + 1.
        if id_color > 7.
          id_color = 1.
        endif.
        id_colors = id_color.
        concatenate 'C' id_colors '10' into itab-color.
        modify itab.
        CLEAR ITAB.
      endloop.
    ENDFORM.                    " READDATA
         Form  FILLFIELD
    FORM FILLFIELD .
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-KEY = 'X'.
      WA_FIELDCAT-COL_POS = '1'.
      WA_FIELDCAT-outputlen   = 20.
      WA_FIELDCAT-HOTSPOT = 'X'.
      wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
    *WA_FIELDCAT-EMPHASIZE = 'C210'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-COL_POS = '2'.
    *WA_FIELDCAT-EMPHASIZE = 'C510'.
      WA_FIELDCAT-outputlen   = 10.
      wa_fieldcat-seltext_m = 'UNIT'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'ERSDA'.
      WA_FIELDCAT-COL_POS = '3'.
      WA_FIELDCAT-outputlen   = 15.
    *WA_FIELDCAT-EDIT_MASK  = 'DD.MM.YYYY'.
    *WA_FIELDCAT-EMPHASIZE = 'C710'.
      wa_fieldcat-seltext_m = 'CREAT DATE'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
    ENDFORM.                    "FILLFIELD
          Setup print parameters
    form build_print_params.
      PRINT_CONT-reserve_lines = '3'.   "Lines reserved for footer
      PRINT_CONT-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
         Form  POPDATA
    FORM POPDATA .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                 =  sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND            = 'USER-COMMAND'
         I_CALLBACK_TOP_OF_PAGE             = 'TOPPAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                       = I_TITLE_MARA
      I_GRID_SETTINGS                   =
         IS_LAYOUT                          = I_LAYOUT
         IT_FIELDCAT                        = fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        IT_SORT                           =  SORT[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                          = V_EVENTS
      IT_EVENT_EXIT                     =
       IS_PRINT                          = PRINT_CONT
        TABLES
          T_OUTTAB                          = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    ENDFORM.                    " POPDATA
         Form  TOPPAGE
    FORM TOPPAGE.
      REFRESH I_LISTHEADER.
      DATA: ld_lines type i,
            ld_linesc(10) type c,
            I_DATE(10) TYPE C,
            I_INFO LIKE WA_LISTHEADER-INFO.
      WA_LISTHEADER-TYP = 'H'.
      WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = 'DATE :'.
      CONCATENATE SY-DATUM+6(2) '.'
                           SY-DATUM+4(2) '.'
                           SY-DATUM(4) INTO I_DATE.
      WA_LISTHEADER-INFO = I_datE.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      describe table ITAB lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
                        into I_INFO separated by space.
      WA_LISTHEADER-TYP  = 'A'.
      WA_LISTHEADER-INFO = I_INFO.
      append WA_LISTHEADER to I_LISTHEADER.
      clear: WA_LISTHEADER , I_INFO.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_LISTHEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "TOPPAGE
         Form  FILLLAYOUT
    FORM FILLLAYOUT .
      i_layout-zebra = 'X'.
      i_layout-info_fieldname = 'COLOR'.
      i_layout-box_fieldname = 'SEL'.
      I_LAYOUT-lights_fieldname = 'LIGHT'.
      I_LAYOUT-EDIT ='X'.
      I_LAYOUT-colwidth_optimize = 'X'.
      I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
      I_LAYOUT-no_totalline = 'X'.
    ENDFORM.                    "FILLLAYOUT
        Form  FILL_SORT
    FORM FILL_SORT .
      SORT-DOWN = 'X'.
      SORT-SPOS = 1.
      SORT-FIELDNAME = 'MATNR'.
      SORT-tabname = 'MARA'.
      APPEND SORT.
    ENDFORM.                    " FILL_SORT
         Form  EVENT_CALL
    FORM EVENT_CALL .
      DATA: I_EVENT LIKE V_EVENTS.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE = 0
        IMPORTING
          ET_EVENTS   = V_EVENTS.
      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.                    " EVENT_CALL
        Form  POPULATE_EVENT
    FORM POPULATE_EVENT .
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
        WA_EVENT-NAME.
    READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
                                          INTO WA_EVENT.
    IF SY-SUBRC = 0.
       move 'END_OF_PAGE' to WA_EVENT-FORM.
       MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
       WA_EVENT-NAME.
      endif.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    FORM END_OF_PAGE.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    ENDFORM.
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          CASE RS_SELFIELD-FIELDNAME.
            when 'MATNR'.
              read table itab with key matnr = RS_SELFIELD-VALUE.
              if sy-subrc = 0.
                PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
                PERFORM BUILD_FIELDCATLOG_MAKT.
                PERFORM FILLLAYOUT_MAKT.
                PERFORM DISPLAY_ALV_MAKT.
                CLEAR RS_SELFIELD.
              ENDIF.
          ENDCASE.
      ENDCASE.
    ENDFORM.                    "user_command
         Form  DATA_RETRIEVAL_MAKT
    FORM DATA_RETRIEVAL_MAKT USING TMATNR .
      SELECT MATNR
             MAKTX
             MAKTG
             UP TO 100 ROWS
             FROM MAKT
             INTO TABLE ITAB1
             WHERE SPRAS = 'EN' AND MATNR = TMATNR.
      LOOP AT ITAB1.
        data id_color type i VALUE 1.
        data id_colors(2) type c.
        id_color = id_color + 1.
        if id_color > 7.
          id_color = 1.
        endif.
        id_colors = id_color.
        concatenate 'C' id_colors '10' into itab1-color.
        modify itab1.
        CLEAR ITAB1.
      ENDLOOP.
    ENDFORM.                    "DATA_RETRIEVAL_MAKT
         Form  FILLLAYOUT_MAKT
    FORM FILLLAYOUT_MAKT .
      CLEAR I_LAYOUT.
      i_layout-zebra = 'X'.
      i_layout-info_fieldname = 'COLOR'.
      i_layout-box_fieldname = 'SEL'.
      I_LAYOUT-EDIT ='X'.
      I_LAYOUT-colwidth_optimize = 'X'.
      I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
    ENDFORM.                    " LAYOUT_MAKT
        Form  BUILD_FIELDCATLOG_MAKT
    FORM BUILD_FIELDCATLOG_MAKT .
      REFRESH FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-KEY = 'X'.
      WA_FIELDCAT-COL_POS = '1'.
    *WA_FIELDCAT-EDIT_MASK  = 'DD.MM.YYYY'.
      WA_FIELDCAT-EMPHASIZE = 'C510'.
      wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT-COL_POS = '2'.
      WA_FIELDCAT-EMPHASIZE = 'C710'.
      wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
      WA_FIELDCAT-FIELDNAME = 'MAKTG'.
      WA_FIELDCAT-COL_POS = '3'.
      WA_FIELDCAT-EMPHASIZE = 'C210'.
      wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
      APPEND WA_FIELDCAT TO FIELDCAT.
      clear wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATLOG_MAKT
         Form  DISPLAY_ALV_MAKT
    FORM TOP-OF-PAGE.
      REFRESH I_LISTHEADER.
      DATA: ld_lines type i,
            ld_linesc(10) type c,
            I_DATE(10) TYPE C,
            I_INFO LIKE WA_LISTHEADER-INFO.
      WA_LISTHEADER-TYP = 'H'.
      WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      WA_LISTHEADER-TYP = 'S'.
      WA_LISTHEADER-KEY = 'DATE :'.
      CONCATENATE SY-DATUM+6(2) '.'
                           SY-DATUM+4(2) '.'
                           SY-DATUM(4) INTO I_DATE.
      WA_LISTHEADER-INFO = I_datE.
      APPEND WA_LISTHEADER TO I_LISTHEADER.
      CLEAR WA_LISTHEADER.
      describe table ITAB1 lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
                        into I_INFO separated by space.
      WA_LISTHEADER-TYP  = 'A'.
      WA_LISTHEADER-INFO = I_INFO.
      append WA_LISTHEADER to I_LISTHEADER.
      clear: WA_LISTHEADER , I_INFO.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = I_LISTHEADER
          I_LOGO             = 'ENJOYSAP_LOGO'.
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.                    "TOP-OF-PAGE
    *&      Form  DISPLAY_ALV_MAKT
          text
    FORM DISPLAY_ALV_MAKT .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = SY-REPID
          I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
          I_GRID_TITLE           = I_TITLE_MAKT
          IS_LAYOUT              = I_LAYOUT
          IT_FIELDCAT                       = fieldcat
        TABLES
          T_OUTTAB               = ITAB1
        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_MAKT
    <b>rewards point</b>
    regards
    Ashok kumar

  • 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 make top of page in alv  to be printed.

    hello expert:
    i used following function to output alv.
    but after been printed into spool, i cannot find the top of page.
    how to set the print parameter to print the top of ALV.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
          is_layout                   = wa_layout
          it_fieldcat                 = it_fieldcat
        TABLES
          t_outtab                    = it_comp
        EXCEPTIONS
          program_error               = 1
          OTHERS                      = 2.
    thank you and best regards,
    Kevin Gao

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
       I_INTERFACE_CHECK           = ' '
         i_bypassing_buffer          = 'X'
       I_BUFFER_ACTIVE             = ' '
         i_callback_program          = sy-repid
       I_CALLBACK_PF_STATUS_SET    = ' '
       I_CALLBACK_USER_COMMAND     = ' '
       I_CALLBACK_TOP_OF_PAGE      = 'HTML_TOP_OF_PAGE'
        I_CALLBACK_HTML_TOP_OF_PAGE = 'HTML_TOP_OF_PAGE'
       I_CALLBACK_HTML_END_OF_LIST = ' '
        i_structure_name            = <DYN_WA>
       I_BACKGROUND_ID             = ' '
       I_GRID_TITLE                =
       I_GRID_SETTINGS             =
         is_layout                   = gds_layout
         it_fieldcat                 = gdt_field_cata
       IT_EXCLUDING                =
       IT_SPECIAL_GROUPS           =
        it_sort                     = gdt_sortinfo
       IT_FILTER                   =
       IS_SEL_HIDE                 =
       I_DEFAULT                   = 'X'
         i_save                      = 'X'
         is_variant                  = gt_var
         it_events                   = gdt_eventcat
       IT_EVENT_EXIT               =
        IS_PRINT                    = gds_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                    = <dyn_table>
       EXCEPTIONS
         program_error               = 1
         OTHERS                      = 2 .
    *&      Form  html_top_of_page
    FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
      DATA: text TYPE sdydo_text_element.
      CALL METHOD document->add_gap
        EXPORTING
          width = 100.
      text =  'Company Code Data'.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'HEADING'.
      CALL METHOD document->new_line.
      CALL METHOD document->new_line.
      CALL METHOD document->new_line.
      text = 'User Name : '.
      CALL METHOD document->add_text
        EXPORTING
          text         = text
          sap_emphasis = 'Strong'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 6.
      text = sy-uname.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'Key'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
      text = 'Date : '.
      CALL METHOD document->add_text
        EXPORTING
          text         = text
          sap_emphasis = 'Strong'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 6.
      text = sy-datum.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'Key'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
      text = 'Time : '.
      CALL METHOD document->add_text
        EXPORTING
          text         = text
          sap_emphasis = 'Strong'.
      CALL METHOD document->add_gap
        EXPORTING
          width = 6.
      text = sy-uzeit.
      CALL METHOD document->add_text
        EXPORTING
          text      = text
          sap_style = 'Key'.
      CALL METHOD document->new_line.
      CALL METHOD document->new_line.
    ENDFORM.                    "HTML_TOP_OF_PAGE

  • 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

  • How to supress TOP-OF-PAGE event

    Hi,
    I am calling Report2 using SUBMIT..and RETURN from Report1 based on the selection criteria of Report1. When I exit from Report2, I want control to come back to the selection screen of Report1 but in my case the TOP_OF_PAGE event in Report1 is getting triggered when I exit from Report2. Is there any way to suppress the call to TOP-OF-PAGE event. I tried EXIT / RETURN / STOP but nth is working.
    Regards,
    Deepti

    Hii Deepti ,
    Top of page event is triggered with first WRITE statement or whenever new page is triggered.
    after submit statement
    use SET SCREEN 0.
    otherwsie check the selection screen number and use
    <b>SET SCREEN 'SCREEN NUMBER'.</b>
    use LEAVE PROGRAM.
    or
    LEAVE SCREEN.
    SET SCREEN.
    - by default in screen attributes you have defined what will be the next screen, but if you want to change the next screen dynamically we use the statement SET SCREEN.
    for ex: SET SCREEN 100.
    LEAVE SCREEN.
    - if you want to quit from the current screen, you use this option. so by default the next screen from attributes will be picked but if you have defined the next screen using SET SCREEN that it will overwrite.
    ex: SET SCREEN 100.
    LEAVE SCREEN.
    LEAVE TO SCREEN.
    - Leave to screen is combination of above two statements.
    OTHERWISE USE
    <b>LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN <No>.
    SET PF-STATUS space.
    SUPPRESS DIALOG.</b>

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

  • Triggering a Top-of- Page without a WRITE statement

    TOP-OF-PAGE event is fired only when it encounters the first Write statement in the report.
    Q)Is there any way to trigger this event,without having a write statement in the program??
    A)The answer is yes.If you write a SKIP statement in the SELECTION-SCREEN,then your TOP-OF-PAGE event would fire.

    hi Phani,
      Top-of-page gets triggered if we write something on output screen.
    Though we write SKIP in selection-screen, 2 lines gets skipped after printing the statement "top of page triggered" in the example below. After 2 lines "start of selection triggered" gets printed.
    report ztest no standard page heading.                                                                               
    selection-screen begin of block b1 with frame title text-001.      
    parameters : p_para type c.                                       
    skip 2.                                                           
    selection-screen end of block b1.                                                                               
    start-of-selection.                                                
    write :/ 'in start of selection'.                                                                               
    top-of page.                                                       
    write :/ 'top of page triggered'.

  • Top Of Page in ABAP Queries

    Hello everyone,
        I want to write some text in theTop-of-page event of Queries.
        I am trying to print the text by using a write statement.But I am not succesful.
        Let me know how to use top-of-page in ABAP Queries.
       Regards,
       Najam

    Hi,
    you need to write the desired code in the top of page event....
    here is the piece of code ..just go through this... and call top of page before start of selection.
    TOP OF PAGE
    TOP-OF-PAGE .
    To Write the header of the Report
      PERFORM write_header .
    *&      Form  WRITE_HEADER
          text :Subroutine to write header
    FORM write_header .
      DATA: v_date(10),
            v_start(10),
            v_end(10) .
      WRITE : sy-datum  TO v_date  MM/DD/YYYY,
              p_prcdte  TO v_start MM/DD/YYYY.
      WRITE   5 '|'  .  ULINE AT 5(95)  .  WRITE 100 '|'    .
      WRITE /30  text-028 INVERSE COLOR 7  .  WRITE 100'|'  .
      WRITE   5 '|'  .  ULINE AT /5(95)  .  WRITE 100 '|'   .
      WRITE:  /7 'Date/Time        :', v_date, ' / ' , sy-uzeit   .WRITE 100 '|'  .
      WRITE   5 '|'  .  ULINE AT /5(95) .WRITE 100 '|'  .
      WRITE: /7 'Processing Month :', v_start   .  WRITE 100 '|'  .
      WRITE   5 '|'  .  ULINE AT /5(95).WRITE 100 '|'   .
      SKIP 2 .
    ENDFORM.                    " WRITE_HEADER
    if u wanna to do for alv then the piece of code provided by Nick will be helpful..
    Thanks & Regards

  • Top of page system fields

    How to use Top of page system fields like sy-tvar0 to sy-tvar1
    thanks in advance
    Rishi

    Hello ,
    in the standard title you can have &0 ... &n. The program must put the values to fields SY-TVAR0 to SY-TVARN.
    see this sample:
    Pass the variables for the list heading
    MOVE SY-Title TO SY-TVAR0.
    MOVE SY-Datum TO SY-TVAR1.
    MOVE SY-Pagno TO SY-TVAR2.
    From output screen: System>List>List Header
    Click on first white line and enter the following title to the yellow box: Title: &0…………… Date: &1………. Page No: &2......
    Hope its what you mean.
    Vasanth

  • Top-of-page event is not triggered

    Hi,
    I have a problem with top-of-page event. I have a report that shows the results in ALV grid display. But I use "REUSE_ALV_GRID_DISPLAY" not OO alv and there is only one screen with number 1000. On the menu toolbar there is a button that prints the data of ALV in a list using "write" statement. While writing , "top of page" event is not triggered. I expect that it is triggered at the first "write" statement but isn't. Is there anyone who knows the cause of this problem?
    The code is below.
    Thanks.
    Tables ...
    TABLES : mara , makt , ekko , ekpo , zzith_yukh , lfa1 , t001w  , lips ,
             eket .
    global variables
    DATA : BEGIN OF list OCCURS 1,
           zztahsk LIKE ekko-zztahsk ,
           zterm LIKE ekko-zterm ,
           txz01 LIKE ekpo-txz01 ,
           name1 LIKE lfa1-name1 ,
           menge LIKE ekpo-menge ,
           meins LIKE ekpo-meins ,
           fyukl LIKE zzith_yukh-zzdel_flag ,
                             " Yüklenmi&#351; miktar var göstergesi ...
           inco1 LIKE ekko-inco1 ,
           netwr LIKE ekpo-netwr ,
           waers LIKE ekko-waers ,
           bedat LIKE ekko-bedat ,
           zzontar LIKE ekko-zzontar ,
           slfdt LIKE eket-slfdt ,
           tname1 LIKE t001w-name1 ,
           banfn LIKE ekpo-banfn ,
           ebeln LIKE ekko-ebeln ,
           ebelp LIKE ekpo-ebelp ,
           lifnr LIKE ekko-lifnr ,
           mtart LIKE mara-mtart ,
           matkl LIKE mara-matkl ,
           ekgrp LIKE ekko-ekgrp ,
           matnr LIKE mara-matnr ,
           eknam  LIKE t024-eknam,
           bukrs  LIKE ekko-bukrs,
           zzbltur LIKE ekko-zzbltur,
           END   OF list         .
    DATA temp  LIKE list OCCURS 1 WITH HEADER LINE .
    DATA total LIKE list OCCURS 1 WITH HEADER LINE .
    ALV fields
    TYPE-POOLS : slis.
    DATA : gt_fields TYPE  slis_fieldcat_alv OCCURS 1 WITH HEADER LINE .
    DATA : gt_events TYPE  slis_t_event.
    DATA : gs_layout TYPE  slis_layout_alv.
    DATA : gv_title  TYPE lvc_title VALUE 'Günlük Depo Say&#305;m Miktarlar&#305;'.
    DATA : gt_top_of_page TYPE slis_t_listheader.
    selection screen
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 .
    *Sat&#305;nalma organizasyonu
    *Sat&#305;nalma grubu
    *Sat&#305;c&#305;
    *Tarih
    *SAS no
    *Dosya no
    SELECT-OPTIONS:
    s_bukrs FOR ekko-bukrs .
    SELECTION-SCREEN SKIP .
    SELECT-OPTIONS:
    s_ekorg FOR  ekko-ekorg OBLIGATORY MEMORY ID eko ,
    s_ekgrp FOR  ekko-ekgrp ,
    s_lifnr FOR  ekko-lifnr ,
    s_ebeln FOR  ekko-ebeln .
    SELECTION-SCREEN END  OF BLOCK a        .
    Define Katalog
    DEFINE fill_catalog .
      gt_fields-fieldname  = &1.
      gt_fields-tabname    = &2.
      gt_fields-seltext_l  = &3.
      gt_fields-seltext_m  = &3.
      gt_fields-seltext_s  = &3.
      gt_fields-checkbox   = &4.
      gt_fields-cfieldname = &5.
      gt_fields-ref_tabname  = &6.
      gt_fields-ref_fieldname  = &7.
      gt_fields-edit       = &8.
      append gt_fields .
      clear gt_fields .
    END-OF-DEFINITION.
    Modify Catalog
    DEFINE modify_catalog .
      gt_fields-seltext_m = &1 .
      modify gt_fields  transporting seltext_m where fieldname = &2 .
    END-OF-DEFINITION     .
    TOP-OF-PAGE.
      write 'top of page'.
      PERFORM top-of-page.
    start-of-selection
    START-OF-SELECTION .
      PERFORM get_data.
      PERFORM listele .
    *&      Form  listele .
    FORM listele .
      PERFORM get_events .
      PERFORM alv_list_header.
      PERFORM get_field_catalog USING 'LIST' .
      PERFORM display_alv    .
    ENDFORM.                    " listele.
    *&      Form  getfield_Catalog
    FORM get_field_catalog  USING p_tabname .
      fill_catalog :
    'EBELN'   'LIST' '' '' '' 'EKPO' 'EBELN'   '' ,
    'ZZTAHSK' 'LIST' '' '' '' 'EKKO' 'ZZTAHSK' '' ,
    'ZZBLTUR' 'LIST' '' '' '' 'EKKO' 'ZZBLTUR' '' ,
    'MATNR'   'LIST' '' '' '' 'MARA' 'MATNR'   '' ,
    'MATKL'   'LIST' '' '' '' 'MARA' 'MATKL'   '' ,
    'TXZ01'   'LIST' '' '' '' 'EKPO' 'TXZ01'   '' ,
    'NAME1'   'LIST' '' '' '' 'LFA1' 'NAME1'   '' ,
    'MENGE'   'LIST' '' '' '' 'EKPO' 'MENGE'   '' ,
    'MEINS'   'LIST' '' '' '' 'EKPO' 'MENGE'   '' ,
    'FYUKL'   'LIST' '' '' '' 'ZZITH_YUKH' 'ZZDEL_FLAG'   '' ,
    'INCO1'   'LIST' '' '' '' 'EKKO' 'INCO1'   '' ,
    'NETWR'   'LIST' '' '' '' 'EKPO' 'NETWR'   '' ,
    'WAERS'   'LIST' '' '' '' 'EKKO' 'WAERS'   '' ,
    'BEDAT'   'LIST' '' '' '' 'EKKO' 'BEDAT'   '' ,
    'ZZONTAR' 'LIST' '' '' '' 'EKKO' 'ZZONTAR' '' ,
    'SLFDT'   'LIST' '' '' '' 'EKET' 'SLFDT'   '' ,
    'TNAME1'  'LIST' '' '' '' 'T001W' 'NAME1'  '' ,
    'BANFN'   'LIST' '' '' '' 'EKPO' 'BANFN'   '' ,
    'EKNAM'   'LIST' '' '' '' 'T024' 'EKNAM'   '' .
      gt_fields-ddictxt = 'M' .
      MODIFY gt_fields  TRANSPORTING ddictxt WHERE fieldname NE space.
      modify_catalog 'Yükleme No'            'VBELN'   .
      modify_catalog 'Malzeme Türü'          'ZZBLTUR' .
      modify_catalog 'Malzeme Tan&#305;m&#305;'        'TXZ01'   .
      modify_catalog 'Sat&#305;c&#305;'                'NAME1'   .
      modify_catalog 'Teslim &#350;ekli'          'INCO1'   .
      modify_catalog 'Döviz Tutar&#305;'          'ZZTOPLAM'.
      modify_catalog 'Döviz Kodu'            'WAERS'   .
      modify_catalog 'Sipari&#351;i Veren'        'TNAME1'  .
      modify_catalog 'Tahmini &#304;thalat Trh.'  'SLFDT'   .
      modify_catalog '&#304;thalata &#304;ntikal Trh.' 'BEDAT'   .
      modify_catalog 'Dosya Onay Tarihi'     'ZZONTAR' .
      modify_catalog 'Talep No'              'BANFN'   .
      modify_catalog 'Dosya Sorumlusu'       'EKNAM'   .
      modify_catalog 'Yük.Göstergesi'        'FYUKL'   .
    ENDFORM.                    " getfield_Catalog
    *&      Form  display_alv
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv .
      DATA lv_repid LIKE sy-repid .
      lv_repid = sy-repid .
      CLEAR gs_layout.
      gs_layout-zebra                 = 'X'.
      gs_layout-colwidth_optimize     = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = lv_repid
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout                = gs_layout
          it_fieldcat              = gt_fields[]
          it_events                = gt_events[]
        TABLES
          t_outtab                 = list[].
    ENDFORM.                    " display_alv
    FORM set_pf_status USING  iv_nodisplay TYPE slis_t_extab.
      SET PF-STATUS 'STANDARD' ."excluding iv_nodisplay.
    ENDFORM.                    " SET_PF_STATUS
    FORM user_command  USING iv_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE iv_ucomm .
        WHEN 'PRINT'  . PERFORM print_data .
      ENDCASE       .
    ENDFORM.                    "USER_COMMAND
    FORM get_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_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE 'ALV_TOP_OF_PAGE' TO ls_event-form.
        APPEND ls_event TO gt_events.
      ENDIF.
    ENDFORM.                    " getevents
    FORM alv_list_header .
      DATA: ls_line TYPE slis_listheader.
      CLEAR ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'Sat&#305;nalma Org.:'.
      CONCATENATE s_ekorg-low s_ekorg-high
      INTO ls_line-info SEPARATED BY '/'.
      APPEND ls_line TO gt_top_of_page.
      ls_line-key  = 'Sat&#305;nalma Grubu.:'.
      CONCATENATE s_ekgrp-low s_ekgrp-high
      INTO ls_line-info SEPARATED BY '/'.
      APPEND ls_line TO gt_top_of_page.
      ls_line-key  = 'Sat&#305;c&#305;.:'.
      CONCATENATE s_lifnr-low s_lifnr-high
      INTO ls_line-info SEPARATED BY '/'.
      APPEND ls_line TO gt_top_of_page.
      ls_line-key  = 'SAS No.:'.
      CONCATENATE s_ebeln-low s_ebeln-high
      INTO ls_line-info SEPARATED BY '/'.
      APPEND ls_line TO gt_top_of_page.
    ENDFORM.                    " alv_list_header
    FORM alv_top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_top_of_page.
    ENDFORM.                    "TOP_OF_PAGE
    FORM get_data .
      DATA : BEGIN OF tr ,
              menge LIKE eket-menge ,
              dabmg LIKE eket-dabmg ,
             END OF tr ,
             zzfiilytar LIKE zzith_yukh-zzfiilytar  .
    *- Get data ...
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE list
        FROM ekpo AS a
       INNER JOIN ekko AS b ON bebeln = aebeln
      WHERE b~ebeln IN s_ebeln AND
            b~bukrs IN s_bukrs AND
            b~loekz EQ space   AND
            b~lifnr IN s_lifnr AND
            b~ekorg IN s_ekorg AND
            b~ekgrp IN s_ekgrp AND
            a~loekz EQ space   AND
            a~elikz EQ space .
      LOOP AT list .
        CLEAR tr .
        SELECT menge dabmg
          INTO tr
          FROM eket
         WHERE ebeln = list-ebeln AND
               ebelp = list-ebelp.
          tr-menge = tr-menge - tr-dabmg .
        ENDSELECT.
        IF tr-menge LE 0 .
          DELETE list .
        ELSE .
          list-menge = tr-menge .
          IF tr-dabmg GT 0 .
            list-fyukl = '*' .
          ENDIF .
          SELECT SINGLE butxt INTO list-tname1 FROM t001
            WHERE bukrs = list-bukrs .
          SELECT SINGLE slfdt INTO list-slfdt FROM eket
          WHERE ebeln = list-ebeln AND
                ebelp = list-ebelp .
          SELECT SINGLE name1 INTO list-name1 FROM lfa1 WHERE lifnr = list-lifnr.
          SELECT SINGLE mtart matkl INTO (list-mtart,list-matkl)
          FROM mara WHERE matnr = list-matnr .
          SELECT SINGLE eknam INTO list-eknam FROM t024 WHERE ekgrp = list-ekgrp .
          MODIFY list .
        ENDIF .
      ENDLOOP      .
    ENDFORM.                    " get_data
    FORM print_data .
      LEAVE TO LIST-PROCESSING .
      NEW-PAGE NO-HEADING NO-TITLE LINE-SIZE 229 .
      SET PF-STATUS SPACE .
    PERFORM top-of-page .
    malzeme türü 1005 ler yazd&#305;r&#305;l&#305;r
      PERFORM yazdir_1005 .
    malzeme türü 1005 olmayanlar yazd&#305;r&#305;l&#305;r
      PERFORM yazdir_ne_1005 .
    Sat&#305;nalama gruplar&#305; bilgisi yazd&#305;r&#305;l&#305;r
      PERFORM yazdir_ekgrp .
    ENDFORM.                    " print_data
    FORM top-of-page .
      WRITE : 'ÜLKER GRUBU KONSOL&#304;DE' .
      WRITE AT 40 'Sevkiyat Bekleyen Malzemeler' COLOR COL_HEADING .
      WRITE :  180 sy-uname , sy-datum , sy-uzeit.
      NEW-LINE .
      ULINE 0(229) .
      WRITE :/2 'Rapor Kodu..............:' , (10) sy-tcode .
      WRITE :/2 'Sat&#305;nalma Organizasyonu.:' , (10) s_ekorg-low, '/', (10) s_ekorg-high .
      WRITE :/2 'Sat&#305;nalma Grubu.........:' , (10) s_ekgrp-low, '/', (10) s_ekgrp-high .
      WRITE :/2 'Sat&#305;c&#305;..................:' , (10) s_lifnr-low, '/', (10) s_lifnr-high .
      WRITE :/2 'Sat&#305;nalma Sipari&#351; No....:' , (10) s_ebeln-low, '/', (10) s_ebeln-high .
      NEW-LINE .
      ULINE 0(229) .
    Ba&#351;l&#305;klar yaz&#305;l&#305;r
      FORMAT COLOR COL_HEADING .
      WRITE :
      /(10) 'SAS NO.' CENTERED,
      (6)  'TAHS&#304;S'  CENTERED,
      (5)  'ÖDEME'   CENTERED,
      (5)  'Bel.T'   CENTERED,
      (25) 'MALZEME' CENTERED,
      (25) 'SATICI' CENTERED,
      (12) 'M&#304;KTAR' CENTERED,
      (3)  'BRM' CENTERED,
      (3)  'G' ,
      (7) 'TES.&#350;K.' CENTERED,
      (16) 'DÖV&#304;Z TUTARI' CENTERED,
      (3)  'DB.' CENTERED,
      (13) '&#304;TH.&#304;NTK.TRH.' CENTERED,
      (13) 'DOSYA ON.TRH.' CENTERED,
      (10) 'TAHM&#304;N.&#304;TH.TRH.' CENTERED,
      (20) 'S&#304;PAR&#304;&#350; VEREN' CENTERED,
      (10) 'TALEP NO.' CENTERED,
      (18) 'DOSYA SORUMLUSU' CENTERED.
      ULINE 0(229) .
      FORMAT RESET .
    ENDFORM.                    " top-of-page
    FORM yazdir_1005 .
      DATA ebeln LIKE list-ebeln  .
      SORT list BY zzbltur matnr .
      temp[] = list[] .
      DELETE temp WHERE mtart <> '1005' .
      LOOP AT list WHERE mtart = '1005' .
        CLEAR list-netwr .
        IF ebeln NE list-ebeln OR ebeln EQ space .
          REFRESH total . CLEAR total .
          ebeln = list-ebeln .
          LOOP AT temp WHERE ebeln = list-ebeln .
            list-netwr = list-netwr + temp-netwr  .
            CLEAR total .
            total-txz01 = '*** TKNK.MLZ. TOPLAMI ****' .
            total-meins = temp-meins .
            total-menge = temp-menge .
            COLLECT total .
          ENDLOOP                               .
          PERFORM write_list USING '1'  .
          LOOP AT total .
            PERFORM write_list USING '2'  .
          ENDLOOP .
          AT END OF zzbltur .
            ULINE 0(229) .
          ENDAT .
        ENDIF .
      ENDLOOP .
    ENDFORM.                    " yazdir_1005
    FORM write_list  USING    flag .
    flag 1 1005 için yazd&#305;rma
    flag 2 ise ara toplam
      IF flag = '1' .
       FORMAT COLOR COL_NORMAL .
        WRITE :
        /(10) list-ebeln ,
         (6)  list-zztahsk,
         (5)  list-zterm,
         (5)  list-zzbltur ,
         (25) list-txz01,
         (25) list-name1,
         (12) list-menge,
         (3)  list-meins,
         (3)  list-fyukl,
         (7)  list-inco1,
         (16) list-netwr,
         (3)  list-waers,
         (13) list-bedat,
         (13) list-zzontar,
         (10) list-slfdt ,
         (20) list-tname1,
         (10) list-banfn ,
         (18) list-eknam .
        FORMAT RESET .
      ELSEIF flag = '2'  .
       FORMAT COLOR COL_TOTAL .
        WRITE :
        /(10) '' ,
         (6)  '' ,
         (5)  '' ,
         (5)  '' ,
         (25) total-txz01,
         (25) '' ,
         (12) total-menge,
         (3)  total-meins,
         (3)  '' ,
         (7)  '' ,
         (16) '' ,
         (3)  '' ,
         (13) '' ,
         (13) '' ,
         (10) '' ,
         (20) '' ,
         (10) '' ,
         (18) '' .
        FORMAT RESET .
      ELSEIF flag = '3'  .
       FORMAT COLOR COL_TOTAL .
        WRITE :
       /(10) '' ,
        (6)  '' ,
        (5)  '' ,
        (5)  '' ,
        (25) total-txz01,
        (25) '' ,
        (12) total-menge,
        (3)  '' ,
        (3)  '' ,
        (7)  '' ,
        (16) total-netwr ,
        (3)  '' ,
        (13) '' ,
        (13) '' ,
        (10) '' ,
        (20) '' ,
        (10) '' ,
        (18) '' .
        FORMAT RESET .
      ENDIF .
    ENDFORM.                    " write_list
    FORM yazdir_ne_1005 .
      DATA matnr LIKE list-matnr .
      SORT list BY zzbltur matkl matnr .
      temp[] = list[] .
      DELETE temp WHERE mtart = '1005' .
      LOOP AT list WHERE mtart <> '1005' .
    Her yeni Malzeme için ara toplam yaz&#305;l&#305;r
        IF matnr NE list-matnr AND matnr NE space .
           REFRESH total . CLEAR total .
    Toplamlar al&#305;n&#305;r
          LOOP AT temp WHERE matnr = matnr .
            CLEAR total .
            total-netwr = temp-netwr  .
            total-menge = temp-menge  .
            total-txz01 =  '***     TOPLAM        ****' .
            COLLECT total .
          ENDLOOP                          .
          LOOP AT total .               .
            PERFORM write_list USING '3'  .
          ENDLOOP                       .
          ULINE 0(229) .
        ENDIF                      .
        PERFORM write_list USING '1'  .
        matnr = list-matnr            .
      ENDLOOP                           .
    Toplamlar al&#305;n&#305;r
      LOOP AT temp WHERE matnr = matnr .
        REFRESH total . CLEAR total .
        total-netwr = temp-netwr  .
        total-menge = temp-menge  .
        total-txz01 =  '***     TOPLAM        ****' .
        COLLECT total .
      ENDLOOP .
      LOOP AT total .
        PERFORM write_list USING '3'  .
      ENDLOOP       .
      ULINE 0(229)  .
    ENDFORM.                    " yazdir_ne_1005
    FORM yazdir_ekgrp .
      DATA: BEGIN OF total OCCURS 1 ,
            eknam LIKE list-eknam   ,
            zzbltur LIKE list-zzbltur ,
            sayi TYPE i ,
            END  OF  total          .
      DATA: BEGIN OF gtotal OCCURS 1 ,
            eknam LIKE list-eknam   ,
            zzbltur LIKE list-zzbltur ,
            sayi TYPE i ,
            END  OF  gtotal          .
      DATA: bltur LIKE zzith_bltur OCCURS 1 WITH HEADER LINE .
      DATA: len TYPE i  .
      DATA: wa LIKE total.
      REFRESH temp .
      SELECT * INTO TABLE bltur FROM zzith_bltur .
      CLEAR bltur .
      MOVE : 'ZZZZ'   TO bltur-zzbltur ,  " Sat&#305;r toplam&#305; için ...
             text-002 TO bltur-zztanim .
      APPEND bltur .
      CLEAR list   .
      SORT list BY eknam ebeln .
      DELETE ADJACENT DUPLICATES FROM list COMPARING eknam ebeln .
      LOOP AT list .
        CLEAR : total, gtotal .
        total-eknam = list-eknam .
        total-zzbltur = list-zzbltur .
        total-sayi  = 1 .
        COLLECT total   .
        total-eknam   = list-eknam .
        total-zzbltur = 'ZZZZ' .
        total-sayi  = 1 .
        COLLECT total   .
        gtotal-eknam = text-001 .
        gtotal-zzbltur = list-zzbltur .
        gtotal-sayi  = 1 .
        COLLECT gtotal   .
        gtotal-eknam = text-001 .
        gtotal-zzbltur = 'ZZZZ' .
        gtotal-sayi  = 1 .
        COLLECT gtotal   .
      ENDLOOP      .
      FORMAT COLOR COL_HEADING.
      ULINE AT /1(145).
      WRITE :/
      sy-vline , (15) 'Dosya Sorumlusu' , sy-vline .
      LOOP AT bltur .
        WRITE :(15) bltur-zztanim  , sy-vline .
      ENDLOOP  .
      ULINE AT /1(145).
      FORMAT RESET   .
      total-zzbltur = '0001' .
      MODIFY total TRANSPORTING zzbltur WHERE zzbltur = space .
      gtotal-zzbltur = '0001' .
      MODIFY gtotal TRANSPORTING zzbltur WHERE zzbltur = space .
      SORT total BY eknam .
      LOOP AT total  .
        AT NEW eknam .
          WRITE :/
          sy-vline , (15) total-eknam COLOR COL_HEADING ,
          sy-vline .
          LOOP AT bltur   .
            len = sy-tabix * 18 .
            len = len + 3 .
            CLEAR wa .
            READ TABLE total INTO wa WITH KEY zzbltur = bltur-zzbltur
                                              eknam   = total-eknam .
            WRITE AT len(15) wa-sayi NO-ZERO.
            WRITE sy-vline .
          ENDLOOP    .
        ENDAT      .
      ENDLOOP .
      LOOP AT gtotal  .
        AT NEW eknam .
          FORMAT COLOR COL_TOTAL .
          WRITE :/
          sy-vline , (15) gtotal-eknam ,
          sy-vline .
          LOOP AT bltur   .
            len = sy-tabix * 18 .
            len = len + 3 .
            CLEAR wa .
            READ TABLE gtotal INTO wa WITH KEY zzbltur = bltur-zzbltur
                                               eknam   = text-001    .
            WRITE AT len(15) wa-sayi NO-ZERO.
            WRITE sy-vline .
          ENDLOOP    .
        ENDAT      .
      ENDLOOP .
      ULINE AT /1(145).
      FORMAT RESET .
    ENDFORM.                    " yazdir_ekgrp

    Hi,
    In the function  use the top-of-page event as follows:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                    I_BYPASSING_BUFFER          =
                    I_BUFFER_ACTIVE             =
                    I_INTERFACE_CHECK           = ' '
                 I_CALLBACK_PROGRAM          = 'ZRPMSLM'
                    I_CALLBACK_PF_STATUS_SET    = ' '
                    I_CALLBACK_USER_COMMAND     = ' '
               <b>  I_CALLBACK_TOP_OF_PAGE      = 'TOP'</b>
    Define whatever to appear in top-of page in a subroutine named TOP.
    Hope this helps.
    Reward if helpful.
    Regards,
    Sipra

Maybe you are looking for

  • Deleting a row from a JTable using AbstractTableModel

    Hi, Can someone please help me on how should i go about deleting a row in a jtable using the AbstractTableModel. Here i know how to delete it by using vector as one of the elements in the table. But i want to know how to delete it using an Object[][]

  • 6 DIMMS in total : how to install ?

    Just to double check on this forum : I have 6 dimms ; 4 of 1 gig each and 2 of 2 gig each. What's the best solution to install them ? According to the manual , if i understood correctly, the 4 dimms of 1 gig all in riser A (upper riser) and then the

  • How to get the  Checked box which are clicked

    for(int k=0;..... jsp code <input type=checkbox name=checkbox value='<%=k%>' > how to get the particular Checkbox which are checked???

  • My phone unable to connect to mailbox

    Few days back I bought the nokia E63 and whenever i try to connect the mailbox it shows incoming mail server not found.Check mailbox setting... What i do?

  • Query showing all values

    Hi, I want to build a query which shows all accounts. What I mean even if there is a 0 value for that account in that period i want to see all the values for the account number. Can anyone help me? Thanks