AVL report - top of page event code ?

Hi,
I want to print TOP-OF_PAGE event code in ALV reprot.
START-OF-SELECTION.
Perform ALV_REPORT.
TOP-OF-PAGE.
PERFORM top_of_page.
in the ALV function module(form alv_report) I have given like this.
but its not printing any thing in top of ALV report, but its leaving blank space.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
   I_CALLBACK_TOP_OF_PAGE            = 'TOP-OF-PAGE'
Can any one tell me how to write the code?
thanks.
Kavitha.

hi,
use like this..
*&      Form  get_event
      text
     -->P_IT_EVENT  text
FORM get_event  USING    P_IT_EVENT    TYPE  slis_t_event.
   DATA : wa_event TYPE slis_alv_event.
   CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      I_LIST_TYPE           = 0
    IMPORTING
      ET_EVENTS             = it_event.
      READ TABLE it_event WITH KEY name = slis_ev_top_of_page INTO wa_event.
       IF SY-SUBRC = 0.
       MOVE 'TOP_OF_PAGE' to wa_event-form.
       APPEND  wa_event to it_event.
   ENDIF.
ENDFORM.                    " get_event
*FORM FOR TOP_OF_PAGE(to assign form for the top-of-page event)
FORM top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = it_listheader.
ENDFORM.                    "top_of_page
*&      Form  fill_listheader
      text
     -->P_IT_LISTHEADER  text
FORM fill_listheader  USING    P_IT_LISTHEADER  TYPE   slis_t_listheader.
DATA : wa_listheader TYPE slis_listheader.
  CLEAR wa_listheader.
  wa_listheader-typ  = 'S'.
  wa_listheader-info ='S.T.O REPORT  '.
  APPEND wa_listheader TO it_listheader.
ENDFORM.                    " fill_listheader
*&      Form  call_alv_function
      text
-->  p1        text
<--  p2        text
FORM call_alv_function .
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        = 'CALL_TCODE'
    I_STRUCTURE_NAME               =
     IS_LAYOUT                      = st_layout
     IT_FIELDCAT                    = it_fieldcat[]
    IT_EXCLUDING                   =
    IT_SPECIAL_GROUPS              =
     IT_SORT                        = lt_sort
    IT_FILTER                      =
    IS_SEL_HIDE                    =
    I_DEFAULT                      = 'X'
    I_SAVE                         = ' '
    IS_VARIANT                     =
     IT_EVENTS                      = it_event[]
    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
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER        =
    ES_EXIT_CAUSED_BY_USER         =
    TABLES
      T_OUTTAB                       = IT_EKBE
  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_alv_function
Regards,

Similar Messages

  • 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

  • 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

  • Problem in ALV top of page event

    Hi,
    Have created a report in ALV and used top of page event to display the header details, where i am doing some calculations and the value is appearing in top of page, but when i take print out (or see print preview), the top of page contents are not visible, is there any way so that i can print the top of page also.
    Thanks in Advance
    Santosh

    Hi this might help u.
    *&      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
    with regards,
    Hema Sundara.
    pls give points if u find it helpful.

  • How to capture the current info in the top-of-page event in Reuse block dis

    How to capture the current info in the top-of-page event in Reuse block dis

    Hi Geetha,
         If you don't have any information to pass the Heading Block, then why you are using this event ?
         please comment/ remove that TOP_OF_PAGE code. and use subtotal code in field catalog block.
          you can use below code for subtotal. 
          FORM field_catalog .
                    gs_fcat-do_sum = &2.
              fcat : 'WRBTR' '15' 'X' ' ' ' ' 'WRBTR' 'Amount',
           ENDFORM.
           Regards,
           Kunjan

  • To display the typ, key field,info in the top-of -page event in OO ALV

    Hi all,
    I need to display the heading and the other select option details in the top-of-page  event in ooalv.How can the key ,typ and the info of top of event  in alv grid be passed in ooalv grid display.
    Regards,
    Arpita

    Check the blog.
    TOP_OF_PAGE in ALV  Using CL_GUI_ALV_GRID
    Now you have to use the method ADD_TEXT to populate the Select options details.
    I hope you know the Function to get the selection details
    RS_REFRESH_FROM_SELECTOPTIONS,. it will give into a table. so use that table and populate the TOP_OF_PAGE uisng the class CL_DD_DOCUMENT.

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

  • Print and print priview of top-of-page event

    Hi,
    i used oops to display top of page using document class, i am printing or print priview, it is not showing. please tell how to print this html document. i am succesfully displaying html document in grid display, while printing the list, it will not printing, please tell me solution.
    Thanks
    Sudhakar
    Sample code:
      CREATE OBJECT g_document
         EXPORTING
          style = 'ALV_GRID'.
      CREATE OBJECT g_docking
        EXPORTING
          repid = g_repid
          dynnr = '0100'
        ratio  = 95.
          extension = 700
          side  = cl_gui_docking_container=>dock_at_top.
      IF sy-subrc <> 0.
      ENDIF.
      CREATE OBJECT g_splitter
        EXPORTING parent = g_docking
        rows = 2
        columns = 1.
      CALL METHOD g_splitter->get_container
        EXPORTING
            row       = 1
            column    = 1
        RECEIVING
            container = g_htmlc.
      CALL METHOD g_splitter->get_container
          EXPORTING
            row       = 2
            column    = 1
          RECEIVING
            container = g_alvc.
      CALL METHOD g_splitter->set_row_height
          EXPORTING
            id     = 1
            height = 14.
      CREATE OBJECT g_grid0100
            EXPORTING
                 i_parent = g_alvc.
      CREATE OBJECT g_event_receiver.
      SET HANDLER g_event_receiver->handle_top_of_page FOR g_grid0100.
      SET HANDLER g_event_receiver->handle_top_of_list FOR g_grid0100.
      CALL METHOD g_document->initialize_document.
      CALL METHOD g_grid0100->list_processing_events
        EXPORTING
          i_event_name = 'TOP_OF_PAGE'
          i_dyndoc_id  = g_document.
      gs_print-reservelns = 2.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      g_save = 'A'.
      gs_variant-report = g_repid.
      CALL METHOD g_grid0100->set_table_for_first_display
        EXPORTING
          is_layout                     = gs_layout
          is_variant                    = gs_variant
          i_save                        = g_save
          is_print                      = gs_print
        CHANGING
          it_outtab                     = gt_alv0100
          it_fieldcatalog               = gt_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
          CLASS LCL_event_handler IMPLEMENTATION
    CLASS lcl_event_reciever IMPLEMENTATION.
      METHOD handle_top_of_page.
        DATA: l_date(10) TYPE c,
              l_text TYPE sdydo_text_element.
        WRITE sy-datum TO l_date.
        CONCATENATE 'Report Date:  ' l_date INTO l_text.
        CALL METHOD e_dyndoc_id->add_text
          EXPORTING
            text         = l_text
            sap_fontsize = cl_dd_area=>strong.
        CALL METHOD e_dyndoc_id->new_line.
        CALL METHOD e_dyndoc_id->add_gap
          EXPORTING
            width = 8.
        IF g_htmlv IS INITIAL.
          CREATE OBJECT g_htmlv
            EXPORTING
              parent = g_htmlc.
        ENDIF.
        CALL METHOD g_document->merge_document.
        g_document->html_control = g_htmlv.
        CALL METHOD e_dyndoc_id->display_document
          EXPORTING
            reuse_control      = 'X'
            parent             = g_htmlc
          EXCEPTIONS
            html_display_error = 1.
      ENDMETHOD.                    "handle_top_of_page
      METHOD handle_top_of_list.
      ENDMETHOD.                           "handle_top_of_list
    ENDCLASS.                    "lcl_event_reciever IMPLEMENTATION

    Hi,
         While using OOPS for ALV, the top-of-page and end-of-page will not show at display, but while printing it, then it will be printed properly, try to take the printout and observer.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Jun 12, 2008 2:08 PM

  • StatsPack Report Top 5 Timed Events

    Here is my StatsPack report , The 1st one is base line, Performance looks nice here , but in 2nd and 3rd its not good. Need suggestion , what this reprot mean. and what should i do next.
    Cache Sizes (end)
    ~~~~~~~~~~~~~~~~~
    Buffer Cache: 1,920M Std Block Size: 16K
    Shared Pool Size: 304M Log Buffer: 20,480K
    Performance is good here
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    enqueue 15,551 25,630 41.78
    db file sequential read 1,281,988 10,205 16.64
    CPU time 7,781 12.68
    log file sync 325,921 6,482 10.57
    buffer busy waits 199,959 2,591 4.22
    Performance is not good here
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    db file sequential read 1,180,605 10,883 23.99
    CPU time 8,012 17.66
    log file sync 365,098 7,788 17.17
    enqueue 8,906 6,413 14.13
    db file scattered read 137,606 2,930 6.46
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    enqueue 14,413 18,029 27.04
    db file sequential read 1,281,801 12,383 18.57
    CPU time 10,002 15.00
    log file sync 356,982 8,488 12.73
    row cache lock 1,765 3,510 5.27

    >
    Top 5 Timed Events
    ~~~~~~~~~~~~~~~~~~ % Total
    Event Waits Time (s) Ela Time
    > enqueue 14,413 18,029 27.04> db file sequential read 1,281,801 12,383 18.57
    CPU time 10,002 15.00
    log file sync 356,982 8,488 12.73
    > row cache lock 1,765 3,510 5.27
    buffer busy waits 199,959 2,591 4.22
    Look into these events, enqueue, row cache lock, buffer busy wait
    select * from V$ENQUEUE_STAT
    to find out which enqueue the database has been waiting on.
    The three events could be related.
    Most likely you have one/some hot objects that a lot queries updating on at the same time.
    also check
    v$session_wait
    when you have the performance issue to find out the hot objects.

  • Top Of Page event in RS_TREE_LIST_DISPLAY

    Hi ,
       I am using the FM "RS_TREE_LIST_DISPLAY" and i am passing the form routine name in the importing parameter CALLBACK_TOP_OF_PAGE . But the Sub routine is not triggered.
    Can anyone help me how to display top of page for a tree display.

    Hi Mohan
    I wrote a dummy and tried why TOP_OF_PAGE is not working.
    Form top_of_page.
    *put your code here
    Endform.
    See in my case :
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
    CALLBACK_TOP_OF_PAGE   =  'top_of_page' .
    It`s not calling the subroutine top_of_page.
    now i changed it:
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
    CALLBACK_TOP_OF_PAGE   =  'TOP_OF_PAGE' .
    Now it is calling the subroutine.
    See although while writing in code i am using the small letters but while passing the parameter I am using capital letters.
    Hope it is helpful.
    Regards
    Neha

  • I want to use top-of-page event in my program

    Hi,
    I am using slis type pools.Can anyone describe me how to write the code to diaplay the top-of-page
    With Regards
    Ansuman Parhi

    Hi,
    Here the sample code.
            STRUCTURE DECLARATIONS*
            INTERNAL TABLE DECLARATIONS*
            WORKAREA DECLARATIONS*
            TYPE-POOLS DECLARATION*
    TYPE-POOLS : slis.
    TYPES : BEGIN OF st_ekko,
              ebeln TYPE ekko-ebeln,    "Purchasing Document Number
              bstyp TYPE ekko-bstyp,    "Purchasing Document Category
              bsart TYPE ekko-bsart,    "Purchasing Document Type
              aedat TYPE ekko-aedat,    "record created on
              ernam TYPE ekko-ernam,    "Person who Created the Object
              check(1),
            END OF st_ekko.
    TYPES : BEGIN OF st_ekpo,
             ebeln TYPE ekko-ebeln,
             ebelp TYPE ekpo-ebelp,    "Item Number of Purchasing Document
             ematn TYPE ekpo-ematn,    "Material number
             matkl TYPE ekpo-matkl,    "Material group
             netpr TYPE ekpo-netpr,    "Net price in purchasing document
            END OF st_ekpo.
    TYPES : BEGIN OF st_ebeln,
             ebeln TYPE ekpo-ebeln,
            END OF st_ebeln.
    TYPES : BEGIN OF st_eine,
             ebeln TYPE ekko-ebeln,
             ekorg TYPE eine-ekorg,
             ekgrp TYPE eine-ekgrp,
            END OF st_eine.
    TYPES : BEGIN OF st_check,
             check(1),
            END OF st_check.
    DATA : it_ekpo TYPE STANDARD TABLE OF st_ekpo,
           it_ekko TYPE STANDARD TABLE OF st_ekko,
           wa_ekko LIKE LINE OF it_ekko,
           it_fieldcat TYPE slis_t_fieldcat_alv,
           wa_fieldcat LIKE LINE OF it_fieldcat,
           wa_layout TYPE slis_layout_alv,
           it_events  TYPE slis_t_event,
           st_event LIKE LINE OF it_events,
           *it_listheadr TYPE slis_t_listheader ,*
           *wa_listheadr LIKE LINE OF it_listheadr,*
           st_printparams TYPE slis_print_alv,
           it_sortinfo TYPE slis_t_sortinfo_alv,
           wa_sortinfo LIKE LINE OF it_sortinfo,
           it_ekposortinfo TYPE slis_t_sortinfo_alv,
           wa_ekposortinfo LIKE LINE OF it_ekposortinfo,
           it_filter TYPE slis_t_filter_alv,
           it_ebeln TYPE STANDARD TABLE OF st_ebeln,
           it_eine TYPE STANDARD TABLE OF st_eine,
           wa_eine TYPE st_eine,
           it_popup TYPE STANDARD TABLE OF st_eine,
           wa_popup TYPE st_eine,
           it_check TYPE STANDARD TABLE OF st_check,
           wa_check TYPE st_check.
    DATA : v_ebeln TYPE ekko-ebeln.
                           SELECTION-SCREEN*
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE tit.
    SELECT-OPTIONS: so_ebeln FOR v_ebeln OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b.
                             INITIALIZATION*
    INITIALIZATION.
      tit = text-000.
                             AT SELECTION-SCREEN ON*
    AT SELECTION-SCREEN ON so_ebeln.
      PERFORM validate_ebeln.
                             START-OF-SELECTION*
    START-OF-SELECTION.
      PERFORM get_ekko_data.
      PERFORM get_eine_data.
                             END-OF-SELECTION*
    END-OF-SELECTION.
      PERFORM populate_fieldcat1.
      PERFORM populate_layout.
      PERFORM get_eventlist.
      PERFORM get_ekkosortinfo.
      PERFORM ekkodisplay_onalv.
    *&      Form  POPULATE_FIELDCAT1
    FORM populate_fieldcat1.
      wa_fieldcat-fieldname = 'EBELN'.
      wa_fieldcat-seltext_l = text-004.
      wa_fieldcat-no_zero = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'BSTYP'.
      wa_fieldcat-seltext_l = text-005.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'BSART'.
      wa_fieldcat-seltext_l = text-006.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'AEDAT'.
      wa_fieldcat-seltext_l = text-007.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'ERNAM'.
      wa_fieldcat-seltext_l = text-008.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    "POPULATE_FIELDCAT1
    *&      Form  populate_fieldcat2
    FORM populate_fieldcat2 .
      CLEAR wa_fieldcat.
      CLEAR it_fieldcat.
      REFRESH it_fieldcat.
      wa_fieldcat-fieldname = 'EBELN'.
      wa_fieldcat-seltext_l = text-004.
      wa_fieldcat-hotspot   = 'X'.
    wa_fieldcat-no_zero = 'X'.*
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'EBELP'.
      wa_fieldcat-seltext_l = text-009.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'EMATN'.
      wa_fieldcat-seltext_l = text-010.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'MATKL'.
      wa_fieldcat-seltext_l = text-011.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'NETPR'.
      wa_fieldcat-seltext_l = text-012.
      wa_fieldcat-datatype =  'CURR'.            "Obligatory to perform SUM
      wa_fieldcat-do_sum    = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                                     "populate_fieldcat2
    *&      Form  GET_EVENTLIST
    FORM get_eventlist.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_events[]
        EXCEPTIONS
          list_type_wrong = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      READ TABLE it_events WITH KEY name = slis_ev_pf_status_set INTO st_event.
      IF sy-subrc EQ 0.
        st_event-form = 'SET_PF_STATUS1'.
        APPEND st_event TO it_events.
        CLEAR st_event.
      ENDIF.
      READ TABLE it_events WITH KEY name = slis_ev_end_of_page INTO st_event.
      IF sy-subrc EQ 0.
        st_event-form = 'END_OF_PAGE'.
        APPEND st_event TO it_events.
        CLEAR st_event.
      ENDIF.
    ENDFORM.                    "GET_EVENTLIST
    *&      Form  ekpodisplay_onalv
    FORM ekpodisplay_onalv .
      IF it_ekpo[] IS INITIAL.
        MESSAGE 'NO DATA FOUND' TYPE 'I'.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
         i_callback_program                = sy-repid
         i_callback_pf_status_set          = 'SET_PF_STATUS'
         i_callback_user_command           = 'AT_USER_COMMAND1'
         *i_callback_top_of_page            = 'TOP_OF_PAGE'*
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '*
        I_CALLBACK_HTML_END_OF_LIST       = ' '*
        I_STRUCTURE_NAME                  = I_STRUCTURE_NAME*
        I_BACKGROUND_ID                   = ' '*
        I_GRID_TITLE                      = I_GRID_TITLE*
        I_GRID_SETTINGS                   = I_GRID_SETTINGS*
           is_layout                         = wa_layout
           it_fieldcat                       = it_fieldcat
        IT_EXCLUDING                      = IT_EXCLUDING*
        IT_SPECIAL_GROUPS                 = IT_SPECIAL_GROUPS*
         it_sort                           = it_ekposortinfo[]
        IT_FILTER                         = IT_FILTER*
        IS_SEL_HIDE                       = IS_SEL_HIDE*
        I_DEFAULT                         = 'X'*
        I_SAVE                            = ' '*
        IS_VARIANT                        = IS_VARIANT*
        it_events                         = it_events*
        IT_EVENT_EXIT                     = IT_EVENT_EXIT*
        IS_PRINT                          = IS_PRINT*
        IS_REPREP_ID                      = 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_ALV_GRAPHICS*
        IT_HYPERLINK                      = IT_HYPERLINK*
        IT_ADD_FIELDCAT                   = IT_ADD_FIELDCAT*
        IT_EXCEPT_QINFO                   = IT_EXCEPT_QINFO*
        IR_SALV_FULLSCREEN_ADAPTER        = IR_SALV_FULLSCREEN_ADAPTER*
      IMPORTING*
        E_EXIT_CAUSED_BY_CALLER           = E_EXIT_CAUSED_BY_CALLER*
        ES_EXIT_CAUSED_BY_USER            = ES_EXIT_CAUSED_BY_USER*
          TABLES
            t_outtab                          = it_ekpo
       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.
      ENDIF.
    ENDFORM.                    "ekpodisplay_onalv
    *&      Form  SET_PF_STATUS1
    FORM set_pf_status1 USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'MENU' excluding rt_extab.      "Copy from SALV .
    ENDFORM.                                        "SET_PF_STATUS1
    *&      Form  SET_PF_STATUS
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'STANDARD' excluding rt_extab.  "Copy from SALV .
    ENDFORM.                                        "SET_PF_STATUS
    *&      Form  AT_user_command
    FORM at_user_command  USING r_ucomm LIKE sy-ucomm
            *                 rs_selfield TYPE slis_selfield.*
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname EQ 'EBELN'.
            READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
            SELECT ebeln ebelp ematn matkl netpr
              FROM ekpo
              INTO TABLE it_ekpo
             WHERE ebeln EQ wa_ekko-ebeln.
            PERFORM populate_fieldcat2.
            PERFORM populate_layout2.
            PERFORM get_ekposortinfo.
            PERFORM ekpodisplay_onalv.
          ELSE.
            MESSAGE i020(z50871msg) WITH text-013.
          ENDIF.
        WHEN 'SE16'.
          CALL TRANSACTION 'SE16'.
        WHEN 'SE37'.
          CALL TRANSACTION 'SE37'.
        WHEN 'DISP'.
          PERFORM get_popupdata.
          PERFORM get_popupfcat.
          PERFORM display_popup.
      ENDCASE.
    ENDFORM.                                            "AT_user_command
    *&      Form  TOP_OF_PAGE
    FORM top_of_page.
      REFRESH it_listheadr.
      wa_listheadr-typ = 'H'.
      wa_listheadr-info = text-001.
      APPEND wa_listheadr TO it_listheadr.
      CLEAR wa_listheadr.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheadr[]
          i_logo             = 'ENJOYSAP_LOGO'.    "From OAER transaction
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  build_print_params
    FORM build_print_params.
      st_printparams-reserve_lines = '3'.               "Lines reserved for footer
      st_printparams-no_coverpage = 'X'.
    ENDFORM.                    "build_print_params
    *&      Form  end_of_page
    FORM end_of_page.
      REFRESH it_listheadr.
      wa_listheadr-typ = 'H'.
      wa_listheadr-info = sy-pagno.
      APPEND wa_listheadr TO it_listheadr.
      CLEAR wa_listheadr.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_listheadr[].
    ENDFORM.                                            "end_of_page
    *&      Form  GET_EKPOSORTINFO
    FORM get_ekposortinfo.
      wa_ekposortinfo-up = 'X'.
      wa_ekposortinfo-spos = 1.
      wa_ekposortinfo-fieldname = 'EBELP'.
      wa_ekposortinfo-tabname = 'EKPO'.
      APPEND wa_ekposortinfo TO it_ekposortinfo.
      CLEAR wa_ekposortinfo.
      wa_ekposortinfo-up = 'X'.
      wa_ekposortinfo-spos = 2.
      wa_ekposortinfo-fieldname = 'EMATN'.
      wa_ekposortinfo-tabname = 'EKPO'.
      APPEND wa_ekposortinfo TO it_ekposortinfo.
      CLEAR wa_ekposortinfo.
    ENDFORM.                                           "GET_EKPOSORTINFO
    *&      Form  POPULATE_LAYOUT
    FORM populate_layout.
      wa_layout-colwidth_optimize = 'X'.               "column width
      wa_layout-zebra = 'X'.
    wa_layout-no_hline = 'X'.
    wa_layout-no_vline = 'X'.
    wa_layout-cell_merge = 'X'.
      wa_layout-box_fieldname = 'CHECK'.
      wa_layout-box_tabname = 'IT_EKKO'.
      wa_layout-window_titlebar = 'PURCHASE ORDER HEADER DETAILS'.
    ENDFORM.                                         "POPULATE_LAYOUT
    *&      Form  get_EKKOsortinfo
    FORM get_ekkosortinfo.
      wa_sortinfo-up = 'X'.
      wa_sortinfo-spos = 1.
      wa_sortinfo-fieldname = 'EBELN'.
      wa_sortinfo-tabname = 'EKKO'.
      APPEND wa_sortinfo TO it_sortinfo.
      CLEAR wa_sortinfo.
      wa_sortinfo-up = 'X'.
      wa_sortinfo-spos = 2.
      wa_sortinfo-fieldname = 'BSTYP'.
      wa_sortinfo-tabname = 'EKKO'.
      APPEND wa_sortinfo TO it_sortinfo.
      CLEAR wa_sortinfo.
      wa_sortinfo-up = 'X'.
      wa_sortinfo-spos = 3.
      wa_sortinfo-fieldname = 'AEDAT'.
      wa_sortinfo-tabname = 'EKKO'.
      APPEND wa_sortinfo TO it_sortinfo.
      CLEAR wa_sortinfo.
    ENDFORM.                                         "get_EKKOsortinfo
    *&      Form  EKKODISPLAY_ONALV
    FORM ekkodisplay_onalv.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_pf_status_set = 'SET_PF_STATUS1'
          i_callback_user_command  = 'AT_USER_COMMAND'
          is_layout                = wa_layout
          it_fieldcat              = it_fieldcat
          it_sort                  = it_sortinfo[]
          it_filter                = it_filter
          it_events                = it_events[]
        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.                                            "EKKODISPLAY_ONALV
    *&      Form  validate_ebeln
    FORM validate_ebeln.
      SELECT  ebeln
          FROM ekpo
          INTO TABLE it_ebeln
          WHERE ebeln IN so_ebeln.
      IF sy-subrc NE 0.
        MESSAGE e020(z50871msg) WITH text-014.
      ENDIF.
    ENDFORM.                                           "validate_ebeln
    *&      Form  populate_layout2
    FORM populate_layout2 .
      CLEAR wa_layout.
      wa_layout-colwidth_optimize = 'X'.               "column width
    wa_layout-zebra = 'X'.
    wa_layout-no_hline = 'X'.
    wa_layout-no_vline = 'X'.
    wa_layout-cell_merge = 'X'.
      wa_layout-window_titlebar = 'PURCHASE ORDER DETAILS SECOND SCREEN'.
    ENDFORM.                    " populate_layout2
    *&      Form  GET_POPUPDATA
    FORM get_popupdata .
      LOOP AT it_ekko INTO wa_ekko WHERE check = 'X'.
        READ TABLE it_eine INTO wa_eine WITH KEY ebeln = wa_ekko-ebeln.
        IF sy-subrc NE 0.
          MESSAGE i020(z50871msg) WITH text-015 wa_ekko-ebeln .
        ELSE.
          wa_popup-ebeln = wa_eine-ebeln.
          wa_popup-ekorg = wa_eine-ekorg.
          wa_popup-ekgrp = wa_eine-ekgrp.
          APPEND wa_popup TO it_popup.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_POPUPDATA
    *&      Form  GET_POPUPFCAT
    FORM get_popupfcat .
      CLEAR wa_fieldcat.
      REFRESH it_fieldcat.
      wa_fieldcat-fieldname = 'EBELN'.
      wa_fieldcat-seltext_l = text-004.
      wa_fieldcat-hotspot   = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'EKORG'.
      wa_fieldcat-seltext_l = text-016.
      APPEND wa_fieldcat TO it_fieldcat.
      wa_fieldcat-fieldname = 'EKGRP'.
      wa_fieldcat-seltext_l = text-017.
      APPEND wa_fieldcat TO it_fieldcat.
    ENDFORM.                    " GET_POPUPFCAT
    *&      Form  DISPLAY_POPUP
    FORM display_popup .
      LOOP AT it_ekko INTO wa_ekko WHERE check EQ 'X'.
        wa_check-check = wa_ekko-check.
        APPEND wa_check TO it_check.
      ENDLOOP.
      IF it_check[] IS INITIAL.
        MESSAGE i020(z50871msg) WITH text-018.
      ENDIF.
      IF NOT it_popup[] IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
          EXPORTING
            i_title              = text-003
            i_allow_no_selection = 'X'
            i_scroll_to_sel_line = 'X'
            i_tabname            = 'IT_POPUP'
            it_fieldcat          = it_fieldcat
            i_callback_program   = sy-repid
          TABLES
            t_outtab             = it_popup
          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.
      ENDIF.
      REFRESH it_check.
      REFRESH it_popup.
    ENDFORM.                    " DISPLAY_POPUP
    *&      Form  get_ekko_data
    FORM get_ekko_data .
      SELECT ebeln bstyp bsart aedat ernam
          FROM ekko
          INTO CORRESPONDING FIELDS OF TABLE it_ekko
         WHERE ebeln IN so_ebeln.
      IF sy-subrc NE 0.
        MESSAGE e020(z50871msg) WITH text-019.
      ENDIF.
    ENDFORM.                    " get_ekko_data
    *&      Form  get_eine_data
    FORM get_eine_data .
      SELECT ebeln  ekorg ekgrp
        FROM eine
        INTO TABLE it_eine
       WHERE ebeln IN so_ebeln.
    ENDFORM.                    " get_eine_data
    *&      Form  at_user_command1
    FORM at_user_command1  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
        CASE r_ucomm.
        WHEN 'SE16'.
          CALL TRANSACTION 'SE16'.
        WHEN 'SE37'.
          CALL TRANSACTION 'SE37'.
      ENDCASE.
    ENDFORM.                    "at_user_command1
    Regards
    Sandeep Reddy

  • Right Justfied In ALV Top Of Page  Using opps

    Hi All,
    I Have Report in wich there is requirement of Segment Wise Summary In the Top-Of Page
    Here I am Provding the Code and the o/p of the Report,
    Top-of page Event
      LOOP AT IT_SEG INTO W_SEG.
        V_AMT = W_SEG-AMT.
        V_AMT1 =  V_AMT1 + W_SEG-AMT.
        V_STR = W_SEG-SEGMENT1.
        LR_TEXT = LR_GRID_1->CREATE_TEXT(
           ROW     = V_ROW
           COLUMN  = V_COL
           TEXT    = V_STR  ).
        WRITE: V_AMT TO V_STR." LEFT-JUSTIFIED."RIGHT-JUSTIFIED.
        V_COL = V_COL + 1.
        LR_TEXT = LR_GRID_1->CREATE_TEXT(
           ROW     = V_ROW
           COLUMN  = V_COL
           TEXT    = V_STR  ).
        LR_LABEL->SET_LABEL_FOR( LR_TEXT ).
        LR_CONTENT = LR_GRID_1.
        CL_SALV_FORM_CONTENT=>SET( LR_CONTENT ).
        V_ROW = V_ROW + 1.
        V_COL = 1.
      ENDLOOP.
    Out Put is coming like this
    Segment            Amount
    1                      100.00
    2                      800000.00
    3                      7500.00
    4                      120000000.00
    Total                  120087500.00
    Required Output is
    Segment            Amount
    1             100.00
    2        800000.00
    3            7500.00
    4   120000000.00
    Total            120087500.00
    Can any one help me how how to go ahead.
    Points will be rewarded ,
    Thanks in Advance
    Ramesh
    Edited by: RAMESH on Jun 19, 2008 9:13 AM
    Edited by: RAMESH on Jun 19, 2008 9:14 AM

    Hi All,
    I Have Report in wich there is requirement of Segment Wise Summary In the Top-Of Page
    Here I am Provding the Code and the o/p of the Report,
    Top-of page Event
      LOOP AT IT_SEG INTO W_SEG.
        V_AMT = W_SEG-AMT.
        V_AMT1 =  V_AMT1 + W_SEG-AMT.
        V_STR = W_SEG-SEGMENT1.
        LR_TEXT = LR_GRID_1->CREATE_TEXT(
           ROW     = V_ROW
           COLUMN  = V_COL
           TEXT    = V_STR  ).
        WRITE: V_AMT TO V_STR." LEFT-JUSTIFIED."RIGHT-JUSTIFIED.
        V_COL = V_COL + 1.
        LR_TEXT = LR_GRID_1->CREATE_TEXT(
           ROW     = V_ROW
           COLUMN  = V_COL
           TEXT    = V_STR  ).
        LR_LABEL->SET_LABEL_FOR( LR_TEXT ).
        LR_CONTENT = LR_GRID_1.
        CL_SALV_FORM_CONTENT=>SET( LR_CONTENT ).
        V_ROW = V_ROW + 1.
        V_COL = 1.
      ENDLOOP.
    Out Put is coming like this
    Segment            Amount
    1                      100.00
    2                      800000.00
    3                      7500.00
    4                      120000000.00
    Total                  120087500.00
    Required Output is
    Segment            Amount
    1             100.00
    2        800000.00
    3            7500.00
    4   120000000.00
    Total            120087500.00
    Can any one help me how how to go ahead.
    Points will be rewarded ,
    Thanks in Advance
    Ramesh
    Edited by: RAMESH on Jun 19, 2008 9:13 AM
    Edited by: RAMESH on Jun 19, 2008 9:14 AM

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

  • Display of date range in the top-of-page of report

    have a question like this.
    i have a date range selection on the selection screen where the user will enter the range from this to this.
    now whatever period he will enter,that range should be displayed on the output of the report in the top-of page.
    can we do like this.
    plz explain.
    thanks!

    Hi,
    Use the below logic.
    data:      events      type  slis_t_event,
          event       type  slis_alv_event,
          heading     type  slis_t_listheader,
          hline       type  slis_listheader,
    start-of-selection.
    "get the data into the internal table and fill your fieldcatalog table.
    then fill the event ... ie top of page like this.
      CLEAR event.
      event-name = slis_ev_top_of_page.
      event-form = form_name.
      APPEND event TO events.
    then fill the comments to display in the top of page event.
    DATA: text(50).
      CLEAR hline.
      hline-typ  = 'H'.
      hline-info = "report title".
      APPEND hline TO heading.
      CLEAR: hline,text.
      read table s_pernr index 1.
      IF s_pernr-low IS NOT INITIAL.
        WRITE: 'Sal Code:' TO text.
        WRITE: s_pernr-low TO text+15.
      ENDIF.
      IF s_pernr-high IS NOT INITIAL.
        WRITE: 'to' TO text+25.
        WRITE: s_pernr-high TO text+28.
      ENDIF.
      hline-typ  = 'S'.
      hline-info = text.
      APPEND hline TO heading.
    and then...
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = sy-repid
         it_fieldcat                       = ist_fcat[]
          it_events                         = events[]
        TABLES
          t_outtab                          = ist_main[]
       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.
    and then create a subroutine for top of page.
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = heading[]
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
          I_ALV_FORM               =
    ENDFORM.                    "TOP_OF_PAGE
    regards,
    Santosh Thorat

  • Reg : Top-of-page in classical report.

    Hello all,
        This is regarding the page count that needs to be written in top-of-page event depending on the data in the internal table.
    I have internal table with feqw fields for example :
    Field 1----- Field2
    Val1----
    text1
    Val1----
    text2
    Val1----
    text3
    Val1----
    text4
    Val1----
    text5
    Val2----
    text1
    Val2----
    text2
    Val2----
    text3
    Val2----
    text4
    Let us assume each 'text' occupies half of page.
    the VAL1 has 5 texts so it occupies 2.5 pages.
    for this I want the pages to be displayed as 1 of 3, 2  of 3 and 3 of 3.
    Then for the VAL2 will have 2 pages.
    For this I want the pages to be dispalyed as 1 of 2 , 2 of 2.
    Thisis an example I have given the no.of similar values in field1 may vary and length of text also vary.
    with regards,
    sandeep akella.
    Edited by: sandeep akella on Jun 8, 2010 10:22 AM

    You can see logo fully when you modify the code in top-of-page filling the header.
    suppose you have top-of-page with heading and logo.
    heading - you can give some space so that logo will come properly.
    See the below sample code :
    FS_LIST_COMMENTARY-TYP = 'S'.
    FS_LIST_COMMENTARY-KEY = 'ANANTH'. -> fill empty value
    FS_LIST_COMMENTARY-INFO = 'ANANTH KUMAR SUDANI'. -> fill empty value
    APPEND FS_LIST_COMMENTARY TO T_LIST_COMMENTARY.
    so depend upon your logo size ,you need to fill empty values.
    Check the below link for top-of-page program:
    http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
    Check the below link for how to load logo
    http://www.sap-img.com/fu002.htm
    Thanks
    Seshu

Maybe you are looking for

  • Error while trying to use BFILENAME during schema registration

    Hi, I'm having difficulty in understanding the BFILENAME function while trying to register a schema. The schema is physically present in the following location USERNAME: WEBUSER LOCATION: XML Schemas ---> MyHeaderSchema.xsd And I'm trying to register

  • How can i install windows 8

    i have macbook pro retina 15 inch i cant install windows 8 or win 7 my mac when boot cd and restart mac and mac dont work please answer me i need help thanks

  • Reading https: certification path

    Sorry for crossposting but in the other thread I've got no answer for weeks. While reading from a https site I get the a ValidatorException "PKIX path building failed:" caused by ValidatorException "unable to find valid certification path to requeste

  • Query to get all the data in specific range

    Dear All, I have a table and having 50 records. So i want to fetch the records from specified range. Ex: 1. I want to fetch the records from first 1 to 10 records ( range i will pass) or i want to fetch from 20 to 30 records. Please help regarding th

  • In PM or QM modules how to link the smartforms to standard transections.

    Hi ABAP gurus,      i am facing the problem how to link the smartforms to Standard transections, like      QGA3 in this T-code i am give the Inspection lot no only, then this Lot number go to the smartforms     it will pick the total data relavent to