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ş 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ım Miktarları'.
DATA : gt_top_of_page TYPE slis_t_listheader.
selection screen
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 .
*Satınalma organizasyonu
*Satınalma grubu
*Satıcı
*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ımı'        'TXZ01'   .
  modify_catalog 'Satıcı'                'NAME1'   .
  modify_catalog 'Teslim Şekli'          'INCO1'   .
  modify_catalog 'Döviz Tutarı'          'ZZTOPLAM'.
  modify_catalog 'Döviz Kodu'            'WAERS'   .
  modify_catalog 'Siparişi Veren'        'TNAME1'  .
  modify_catalog 'Tahmini İthalat Trh.'  'SLFDT'   .
  modify_catalog 'İthalata İ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

Similar Messages

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

  • 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

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

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

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

  • Interactive Form - button SubmitToSap - OnSubmit event is not triggered

    Please help to resolve triggering OnSubmit event problem.
    I created a test Webdynpro with UI element InteractiveForm.
    The InteractiveForm properties are:
    - displayType = native
    - enabled is checked.
    OnSubmit event  a method is called. The method contains very simple code so I could debug and see if the event is triggered.
    The form was created in SFP with  Layout type = Native.
    The form properies are:
    Default Lang = Javascript.
    Default run =  at client
    Preserve scripting changes to form when saved = Manually
    I have inserted Webdynpro script thru SAP Utilities menu.
    The form has SubmitToSap button and Textfield.
    So now i am trying to debug WDA.
    At runtime WDA opens Adobe form.
    If I enter data into Textfield and then click SubmitToSap button  -  OnSubmit event is triggered. I am happy.
    Then I run WDA again. This time I click  SubmitToSap button  right away without entering data into Textfield. OnSubmit event is NOT triggered this time.
    Is something wrong with my form properties?
    Thank you very much,
    Tatyana.

    Manas, you are right.
    OnSubmit event was not triggered unless U enter value into Textfield because the Textfield property was "Requiered".
    Also just for clarification the form Layout type  is ZCI Layout (not Native like I said above).
    Thank you!

  • 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

  • OIM 11gR2 - RoleUser PostProcess Event Handler not triggered

    Hi,
    I'm trying to create a postprocess event-handler for RoleUser entity so that when a role is assigned (or removed) to a user an UDF is populated with the list of its roles.
    I developed my event-handler and registered it following instructions on http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/oper.htm#OMDEV4749 but the event-handler is not triggered.
    I've read and tried a lot of things but nothing seems to work.
    I use System.out.println() and a Logger in the event-handler methods as well as breakpoints debugging via Eclipse, all this indicates the event-handler is not triggered.
    I checked the event-handler is registered by using getEventHandlers(RoleUser,CREATE) method on IAMAppDesignMBean through Enterprise Manager. Result is :
    Postprocess,-2147483648,PostProcessingInitiation,/metadata/iam-features-request/event-definition/EventHandlers.xml,true
    Postprocess,FIRST,MyHandler,Plugin:MyHandler,false
    Postprocess,FIRST,MyHandler,Plugin:MyHandler,false
    Postprocess,FIRST,MyHandler,Plugin:MyHandler,false
    Postprocess,FIRST,MyHandler,Plugin:MyHandler,false
    Postprocess,1020,RoleGrantPostProcessActionHandler,/metadata/iam-features-identity/event-definition/EventHandlers.xml,false
    Postprocess,9988,AsyncHandler,/metadata/iam-features-asyncwsclient/EventHandlers.xml,true
    Postprocess,3000000,CallBackOAACGWithApprove,/metadata/iam-features-rolesod/EventHandlers.xml,true
    Postprocess,2147483647,RequestCompleted,/metadata/iam-features-request/event-definition/EventHandlers.xml,true
    Note that I dont understand why the handler appears four times..
    Also, when I unregister it, it still appears one time.
    Here is my event handler XML file (in META-INF folder of the plugin zip) :
    <?xml version='1.0' encoding='utf-8'?>
    <eventhandlers
      xmlns="http://www.oracle.com/schema/oim/platform/kernel/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
      <action-handler
      class="package.MyHandler"
      entity-type="RoleUser"
      operation="ANY"
      name="MyHandler"
      stage="postprocess"
      order="FIRST"
      sync="TRUE" />
    </eventhandlers>
    plugin.xml file (root of plugin zip) :
    <?xml version="1.0" encoding="UTF-8"?>
    <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
      <plugin
      pluginclass="package.MyHandler"
      version="1.0"
      name="Myhandler" />
      </plugins>
    </oimplugins>
    Java code (in a JAR in lib folder of plugin zip) :
    public class MyHandler implements PostProcessHandler {
    @Override
    public EventResult execute(long processId, long eventId, Orchestration orchestration) {
      System.out.println("Inside EventResult execute ");
      LOGGER.log(Level.SEVERE, "Inside eventResult execute");
      // Some code
      return new EventResult();
    @Override
    public BulkEventResult execute(long processId, long eventId, BulkOrchestration orchestration) {
      String operation = orchestration.getOperation().trim().toString();
      System.out.println("<---------- Calling " + getClass().getName() + ": Operation[" + operation + "] Execute ---------->");
      LOGGER.log(Level.SEVERE, "Inside BulkEventResult execute");
      // Some code
      return new BulkEventResult();
    Maybe I'm missing something ? Any help would be really appreciated
    Thanks,
    Gael
    EDIT :
    Also note that I see these messages in the logs but I'm not sure it concern my event handler from what I read on some pages :
    XML schema validation failed for XML eventhandlers and it will not be loaded by kernel.
    [CALLBACKMSG] Found 0 possible matches for applicable policies for step POST_PROCESS, entity RoleUser, operation CREATE.
    Related link : Post process event handler when a role is created or modified in OIM

    I eventually got it working but I'm not sure of how.. !
    I changed the name of the handler (it was not "MyHandler" but something very long, I shortened it). I copy and paste exactly what was described here : Post process event handler when a role is created or modified in OIM. I did purge cache. I tried to apply it on another entity (Role), it was triggered, then I applied it back to RoleUser and it still works.
    If it can help someone, my plugin zip contains :
    plugin.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
      <plugin pluginclass="fr.xxx.RoleUserProcessor"
      version="1.0" name="RoleUserProcessor" />
      </plugins>
    </oimplugins>
    META-INF/EventHandlers.xml :
    <?xml version="1.0" encoding="UTF-8"?>
    <eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
      <action-handler class="fr.xxx.RoleUserProcessor"
      entity-type="RoleUser" operation="ANY" name="RoleUserProcessor" order="9999"
      stage="postprocess" sync="TRUE" />
    </eventhandlers>
    lib/xxx.jar/RoleUserProcessor.java :
    @Override
      public EventResult execute(long processId, long eventId, Orchestration orchestration) {
      LOGGER.log(Level.INFO, "Execution RoleUserProcessor EventHandler (mode non bulk)");
      String operation = orchestration.getOperation().trim().toString();
      LOGGER.log(Level.INFO, "Operation : " + operation);
      return new EventResult();
      @Override
      public BulkEventResult execute(long processId, long eventId, BulkOrchestration orchestration) {
      LOGGER.log(Level.INFO, "Execution RoleUserProcessor EventHandler (mode bulk)");
      String operation = orchestration.getOperation().trim().toString();
      LOGGER.log(Level.INFO, "Operation : " + operation);
      return new BulkEventResult();
    Thank you
    Also, a thing that may help some people, I found out that the ORCHEVENTS table in OIM schema contains the history of handlers triggered.

  • Event OnInputProcessing not triggered ..... please help, it's urgent

    hi all,
    i have a problem in my bsp page.
    in my bsp page, there is a button which is clicked, a new pop up window will appear. after the pop up window closed the caller window will be submitted.
    after submitted, the server side script ( ABAP Code in event OnInputProcessing & OnInitiallization will be run ).
    in order to be able to do this, i used java script. and it's already works well.
    the problem is : there is 1 record that the ABAP code in event OnInputProcessing is not run. I have set break points on one of code in event OnInputProcessing, but it seems event OnInputProcessing is not triggered. if i also put the break point in event OnInitialization, it will stop in the break point in event OnInitialization.
    is there any clue why this happened ?
    please help, it's urgent because it's happened in my production system
    many thanks in advance
    regards
    eddhie

    hi Raja,
    thanks for the respond.
    the code is already works for 2 years and just 1 record of ... perhaps thousands record that used the same code.
    for other record, it go to event OnInputProcessing
    but just this 1 record it won't go to event OnInputProcessing.
    any clue ?
    please help
    regards

  • 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

  • Radiobutton during at selection-screen event is not triggered

    Hi experts,
    I have this event:
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file
    perform f_file_sel.
    I want to select a file according to the radiobuttons on the selection screen, but during the f_file_sel form I recognized, that the radiobutton which I selected is not triggered.
    It's only triggered after 'start-of-selection'.
    How can I force the program to trigger it when f_file_sel is processing?

    Hi,
    SELECT-OPTIONS : so_matnr1    FOR  mvke-matnr MODIF ID id1,
                                    so_matnr2   FOR  mara-wrkst MODIF ID id2.
    PARAMETERS : rb_mat TYPE c RADIOBUTTON GROUP rbg DEFAULT 'X' USER-COMMAND hid,
                              rb_var TYPE c RADIOBUTTON GROUP rbg.
    LOOP AT SCREEN.
        IF rb_mat EQ c_x.
          IF screen-group1 EQ  'ID2'.
            screen-input = '0'.
          ENDIF.
        ENDIF.
        IF rb_var EQ c_x.
          IF screen-group1 EQ 'ID1'.
            screen-input = '0'.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    Apply this piece of code to your requirement with files in place of fields.Hope your issue will be resolved.
    Regards,
    Anand.

  • 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

  • Workflow WS00000038 Purch.Req - Event REJECTED not triggered

    Hi Friends!
    (SAP ECC 6.0)
    (Tcode SWE3 - BUS2009-REJECTED is active)
    When using WS00000038 Purchase requisition we have problem when an item is REJECTED.
    the Event that is triggered is BUS2009-SIGNIFICANTLYCHANGED. This leads to that the Workflow end up with status  COMPLETED and NO further handling of the actual Rejection that were made.
    IF BUS2009-REJECTED were triggered instead, then WS00000038 would have followed another path in the workflow which is to handle the REJECTION via another TASK.
    Why is BUS2009-REJECTED not triggered when button "REJECT" Requisition is pressed (ME54N).
    Best regards
    Henrik

    In this aproval step within WS00000038 it is actually ME54N that is called.
    The result in the task of the workflow is an EXTERNAL EVENT that is triggered.
    In my case it is BUS2009-SIGNIFICANTLYCHANGED that is triggered instead of BUS2009-REJECTED.
    this is what causes my Workflow WS00000038 to choose the wrong path.
    Does anyone have a solution of how to get BUS2009-REJECTED triggered via ME54N when I actually press button to REJECT and then SAVE.
    Best reg
    Henrik

Maybe you are looking for

  • SQL Database replication between Primary and DR site

    Hi, We are setting up a DR Site, for our Production SAP system. At present the curren setup for Production SAP system are as follows. SAP ERP 2005 (SAP ECC 6.), ABAP+JAVA on Windows with MS SQL Server 2005. Data are stored on SAN and SAP installed on

  • General Account Determination

    1.Whre do we account purchase offset account. whether it is   a Expense A/c or Incomes Account 2.  What account we can assign for Sales Credit Account And Purchase Credit Account  . ? 3.  How we can differentiate Expense and Incomes of a busines for

  • Find a .exe file on my network

    need a script create to fine program file (passport.exe) install on my network.

  • Unable to upload photos on icloud!

    I've recently installed IOS5 on ipad, i got my icloud account working (address, calendar etc. all work fine), BUT no sign of PHOTO FOLDER on my icloud account...!  of course I set on ON the flux of photo function on the ipad.  but nothing appears on

  • Licensing Error 213:11

    I downloaded a trial version of Photoshop Elements 11 and when I start the program, upon clicking the 'Photo editor' button, I get a licensing error message with number 213:11. When I click the 'Organizer' button, the program closes. I have a very ol