Reuse_alv_list_display - Info in TOP_OF_PAGE

Hello everybody,
I habe an ALV List with group definition.
The table looks like:
A text1 text11 text111
A text2 text22 text222
B text1 text11 text111
B text2 text22 text222
C text1 text11 text111
C text2 text22 text222
No I split it in groups for the first column, which means I have 3 pages for A, B and C.
Now I would like to write the A, B or C in the top of the page, but where can I found the information in which row I am at this time?
I hope it was understandable.
Regards
Joachim

Hi,
  U can get the similar facility by sort option in that function module.For this you can declare one internal table and sort the output based on first column and check there is a field that can display the values in new-page.Please check that structure once.

Similar Messages

  • Display message in spool list

    hii all
    theres this program on which iam working. It fetches the data from the database and does further processing. the program is executed in the background. if there is no data selected, the spool list shows the message "list contains no data". What I need to output on thelist is this message " The records in DATABASE table does not exist for further processing". How is it possible to show this?
    shakir

    Hi,
    In your alv report Top_of_page you have to write the following info.
    form top_of_page.
    use write statements.....
    if it_final[] is initial.
    write 'The Records in DATABASE table does not exist for Further processing'.
    endif.
    endform.
    Regards
    vijay D T T.

  • How to use top_of_page in alv

    Regarding  I want to use given below format in TOP_OF_PAGE using  FUNCTION MODULE ALV_DISPLAY_GRID  HOW TO WRITE THE CODE THIS FORMAT ..
    COMPANY NAME     IFRS Balance      Time 10:53:23      Date 29.09.2010
    FRANCE
    Closing period 31.12.2009          MGERAUD001                   Page 1
    Reporting period 01-16 2010

    Hi,
    Use this code ....
    * Internal table for Top of Page info. in ALV Display
    data :   i_alv_top_of_page TYPE slis_t_listheader.
    * To build the Page header
      PERFORM sub_build_header.
      DATA: l_repid TYPE syrepid .
      l_repid = sy-repid .
    * This function module for displaying the ALV report
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = l_repid
          i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
          is_layout                = wa_layout
          it_fieldcat              = i_fieldcat
          it_sort                  = i_sort
    *      it_events                = i_event
          i_default                = 'X'
          i_save                   = 'A'
        TABLES
          t_outtab                 = i_ekpo
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    *    MESSAGE i000 WITH 'Error in ALV report display'(055).
      ENDIF.
    *&      Form  sub_build_header
    *       To build the header
    *       No Parameter
    FORM sub_build_header .
    * Local data declaration
      DATA: l_system     TYPE char10 ,          "System id
            l_r_line     TYPE slis_listheader,  "Hold list header
            l_date       TYPE char10,           "Date
            l_time       TYPE char10,           "Time
            l_success_records TYPE i,           "No of success records
            l_title(300) TYPE c.                " Title
    * Title  Display
      l_r_line-typ = c_header.               " header
      l_title = 'Test report'(001).
      l_r_line-info = l_title.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR l_r_line.
    * Run date Display
      CLEAR l_date.
      l_r_line-typ  = c_item.                " Item
      WRITE: sy-datum  TO l_date MM/DD/YYYY.
      l_r_line-key = 'Run Date :'(002).
      l_r_line-info = l_date.
      APPEND l_r_line TO i_alv_top_of_page.
      CLEAR: l_r_line,
             l_date.
    ENDFORM.                    " sub_build_header
    *       FORM sub_alv_top_of_page
    *       Call ALV top of page
    *       No parameter
    FORM sub_alv_top_of_page.                                   "#EC CALLED
    * To write header for the ALV
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = i_alv_top_of_page.
    ENDFORM.                    "alv_top_of_page
    Regards,
    Amitava

  • I want use I_callback_pf_status_set parameter in REUSE_ALV_LIST_DISPLAY.

    i want use I_callback_pf_status_set parameter in REUSE_ALV_LIST_DISPLAY. how can i use it? can any one can give me one simple example.

    Hi,
    Have a look on the following
    TYPE-POOLS: SLIS.
    TYPES: BEGIN OF I_MARA,
           MATNR LIKE MARA-MATNR,
           MTART LIKE MARA-MTART,
           MEINS LIKE MARA-MEINS,
           GROES LIKE MARA-GROES,
           VOLUM LIKE MARA-VOLUM,
           END OF I_MARA.
    DATA: IT_MARA TYPE STANDARD TABLE OF I_MARA INITIAL SIZE 0.
    DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          REPID TYPE SY-REPID,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BLD_FLDCAT.
    PERFORM BLD_LAYOUT.
    PERFORM DISPLAY_ALV_REPORT.
    FORM BLD_FLDCAT.
    FLDCAT-FIELDNAME = 'MATNR'.
    FLDCAT-SELTEXT_M = 'MATERIAL NUMBER'.
    FLDCAT-COL_POS = 0.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'MTART'.
    FLDCAT-SELTEXT_M = 'MATERIAL TYPE'.
    FLDCAT-COL_POS = 1.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'MEINS'.
    FLDCAT-SELTEXT_M = 'UNIT OF MEASURE'.
    FLDCAT-COL_POS = 2.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'GROES'.
    FLDCAT-SELTEXT_M = 'SIZE'.
    FLDCAT-COL_POS = 3.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VOLUM'.
    FLDCAT-SELTEXT_M = 'VOLUME'.
    FLDCAT-COL_POS = 4.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    ENDFORM.
    FORM BLD_LAYOUT.
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-ZEBRA = 'X'.
    GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    ENDFORM.
    FORM DISPLAY_ALV_REPORT.
    REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = REPID
       I_CALLBACK_PF_STATUS_SET          = 'STANDARD'
       I_CALLBACK_USER_COMMAND           = 'USER-COMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       IS_LAYOUT                         = GD_LAYOUT
       IT_FIELDCAT                       = FLDCAT[]
       I_SAVE                            = 'X'
      TABLES
        T_OUTTAB                          = IT_MARA
    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.
    FORM DATA_RETRIEVAL.
    SELECT MATNR MTART MEINS GROES VOLUM
    INTO TABLE IT_MARA FROM MARA
    UP TO 40 ROWS.
    ENDFORM.
    FORM TOP_OF_PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
          WA_HEADER TYPE SLIS_LISTHEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = 'THIS IS MY FIRST ALV'.
    APPEND WA_HEADER TO T_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'THIS IS SECOND'.
    APPEND WA_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    FORM STANDARD USING EXTAB TYPE SLIS_T_EXTAB.
    SET PF-STATUS 'STANDA02' EXCLUDING EXTAB.
    ENDFORM.
    FORM USER-COMMAND USING R_COMM TYPE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_COMM.
      WHEN 'F3'.
        LEAVE PROGRAM.
    ENDCASE.
    ENDFORM.
    Double click on “STANDA02”, it opens new screen(menu painter),there u can add menu bars, application tool bars etc.
    Reward,if useful.
    Thanks,
    Chandu

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

  • ALV REPORT BY USING TOP_OF_PAGE

    HI,
    firends i  want the code for  the top_of_page procedure in ALV REPORT,
    SO i can display data on top of my report .
    REGARDS
    SHAFEEQ AHMED

    hi,
    check this...
    REPORT  ZTEST .
    type-pools: slis.
    data: x_fieldcat type slis_fieldcat_Alv,
          it_fieldcat type slis_t_fieldcat_alv,
          x_events type slis_alv_event,
          it_events type SLIS_T_EVENT.
    data: begin of itab occurs 0,
           vbeln like vbak-vbeln,
           posnr like vbap-posnr,
          end of itab.
    select vbeln
           posnr
           from vbap
           up to 100 rows
           into table itab.
    x_events-name =  'TOP_OF_PAGE'.
    x_events-form =  'TOP_OF_PAGE'.
    append x_events to it_events.
    clear x_events.
    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 into x_events with key name = 'TOP_OF_PAGE'.
         if sy-subrc = 0.
         x_events-form = 'TOP_OF_PAGE'.
         modify it_events from x_events index sy-tabix transporting form .
         endif.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = sy-repid
       I_INTERNAL_TABNAME           = 'ITAB'
       I_INCLNAME                   = sy-repid
      changing
        ct_fieldcat                  = IT_FIELDCAT
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = sy-repid
        I_CALLBACK_PF_STATUS_SET          = 'STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IT_FIELDCAT                       = IT_FIELDCAT
        IT_EVENTS                         = IT_EVENTS
        tables
         t_outtab                         = ITAB[]
      EXCEPTIONS
        PROGRAM_ERROR                     = 1
        OTHERS                            = 2
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    FORM TOP_OF_PAGE.
        DATA: LS_LINE TYPE SLIS_LISTHEADER,
              E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
      Listenüberschrift: Typ H
        CLEAR LS_LINE.
        LS_LINE-TYP  = 'H'.
      LS_LINE-KEY:  not used for this type
        LS_LINE-INFO = 'Summary'.
        APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
      Kopfinfo: Typ S
        CLEAR LS_LINE.
        LS_LINE-TYP  = 'S'.
        LS_LINE-KEY  = 'Test'.
        LS_LINE-INFO = ''.
        APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
        LS_LINE-KEY  = 'ASIA'.
        LS_LINE-INFO = 'test'.
        APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
      Aktionsinfo: Typ A
        CLEAR LS_LINE.
        LS_LINE-TYP  = 'A'.
      LS_LINE-KEY:  not used for this type
        LS_LINE-INFO = TEXT-105.
        APPEND LS_LINE TO  E04_LT_TOP_OF_PAGE.
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY = E04_LT_TOP_OF_PAGE
            I_LOGO             = 'ENJOYSAP_LOGO'.
    ENDFORM.

  • Top_of_page is not working in ALV hierarchy?

    Hi,
          I have written following code for top_of_page using event but which is not working...This report is developed for interactive report.
    Note: passed the it_events into ALV hierarchy functional module.
    FORM build_event_tab .
       CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
         EXPORTING
           i_list_type = 1
         IMPORTING
           et_events   = it_events[].
       READ TABLE it_events INTO wa_events WITH KEY form = 'TOP_OF_PAGE'.
       IF sy-subrc = 0.
         wa_events-form = 'TOP_OF_PAGE'.
         APPEND wa_events TO it_events.
       ENDIF.
    ENDFORM. "Get_events
    FORM top_of_page USING document TYPE REF TO cl_dd_document.
       DATA: dl_text(255) TYPE c,
             lv_cutime TYPE sy-uzeit,
             lv_cudt(20) TYPE c.
       lv_cudt = sy-datum.
    *--Passing Date----*
       WRITE  lv_cudt TO dl_text.
       CONCATENATE 'Date : ' lv_cudt+6(2) '-'
                             lv_cudt+4(2) '-'
                             lv_cudt+0(4) INTO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text = dl_text.
       CLEAR : dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 50.
       WRITE 'Company Name' TO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text         = dl_text
           sap_emphasis = cl_dd_area=>heading
           sap_style    = cl_dd_area=>heading
           sap_color    = cl_dd_area=>list_total_inv.
       CLEAR : dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 150.
       lv_cutime = sy-uzeit.
       CONCATENATE 'Time : ' lv_cutime+0(2) ':'
                             lv_cutime+2(2) ':'
                             lv_cutime+4(2) INTO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text = dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 60.
       WRITE 'Title' TO dl_text.
       CALL METHOD document->add_text
         EXPORTING
           text         = dl_text
           sap_emphasis = cl_dd_area=>heading
           sap_style    = cl_dd_area=>heading
           sap_color    = cl_dd_area=>list_total_inv.
       CLEAR : dl_text.
       CALL METHOD document->add_gap
         EXPORTING
           width = 50.
    ENDFORM.                    "html_top_of_page
    Thanks
    Shree

    PERFORM build_fieldcat.
      PERFORM build_event_tab.
      PERFORM alv_display.
    *---Build fieldcat
    FORM build_fieldcat.
      wa_fieldcat-tabname = 'IT_VENDOR'.
      wa_fieldcat-fieldname = 'LIFNR'.
      wa_fieldcat-col_pos   = '2'.
      wa_fieldcat-seltext_l = 'SUPPLIER'.
      wa_fieldcat-outputlen = 20.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_VENDOR'.
      wa_fieldcat-fieldname = 'NAME1'.
      wa_fieldcat-col_pos   = '2'.
      wa_fieldcat-seltext_l = 'VENDOR NAME'.
      wa_fieldcat-outputlen = 40.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'WERKS'.
      wa_fieldcat-col_pos   = '1'.
      wa_fieldcat-seltext_l = 'Plant'.
      wa_fieldcat-outputlen = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'AWKEY'.
      wa_fieldcat-col_pos   = '2'.
      wa_fieldcat-seltext_l = ' Document'.
      wa_fieldcat-hotspot = 'X'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'BELNR'.
      wa_fieldcat-col_pos   = '3'.
      wa_fieldcat-seltext_l = 'A/c Document'.
      wa_fieldcat-hotspot = 'X'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'BUDAT'.
      wa_fieldcat-col_pos   = '4'.
      wa_fieldcat-seltext_l = 'PJ Date'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'XBLNR'.
      wa_fieldcat-col_pos   = '5'.
      wa_fieldcat-seltext_l = 'Inv'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'BLDAT'.
      wa_fieldcat-col_pos   = '6'.
      wa_fieldcat-seltext_l = 'PJ Date'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'DMBTR'.
      wa_fieldcat-col_pos   = '7'.
      wa_fieldcat-seltext_l = 'Bill.Amount'.
      wa_fieldcat-outputlen = 19.
      wa_fieldcat-do_sum   = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-tabname = 'IT_FINAL'.
      wa_fieldcat-fieldname = 'HKONT'.
      wa_fieldcat-col_pos   = '8'.
      wa_fieldcat-seltext_l = 'Cost Ctr'.
      wa_fieldcat-outputlen = 16.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
    ENDFORM.                    "Build_fieldcat
    *----ALV Display-----*
    FORM alv_display.
      key-header01 = 'LIFNR'.
      key-item01   = 'LIFNR'.
      DELETE ADJACENT DUPLICATES FROM it_vendor.
      DELETE ADJACENT DUPLICATES FROM it_final.
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'PFSTATUS'
          it_fieldcat              = it_fieldcat[]
          i_tabname_header         = 'IT_VENDOR'
          i_tabname_item           = 'IT_FINAL'
          it_events                = it_events[]
          is_keyinfo               = key
        TABLES
          t_outtab_header          = it_vendor[]
          t_outtab_item            = it_final[].
    ENDFORM.                    "alv_display
    *----interactive method--
    FORM user_command USING r_ucomm TYPE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE it_final INTO wa_final INDEX rs_selfield-tabindex.
          IF sy-subrc = 0.
            IF rs_selfield-fieldname = 'BELNR'.
              SET PARAMETER ID 'BLN' FIELD wa_final-belnr.
              SET PARAMETER ID 'BUK' FIELD pa_bukrs.
              SET PARAMETER ID 'GJA' FIELD pa_gjahr.
              CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
            ELSEIF rs_selfield-fieldname = 'AWKEY'.
              SET PARAMETER ID 'RBN' FIELD wa_final-awkey.
              SET PARAMETER ID 'GJR' FIELD pa_gjahr.
              CALL TRANSACTION 'MIR4' AND SKIP FIRST SCREEN.
            ELSEIF rs_selfield-fieldname = 'LFBNR'.
              SET PARAMETER ID 'BLN' FIELD it_bsak-lfbnr.
              SET PARAMETER ID 'BUK' FIELD pa_bukrs.
              SET PARAMETER ID 'GJA' FIELD pa_gjahr.
              CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
            ELSEIF rs_selfield-fieldname = 'EBELN'.
              SELECT SINGLE
                     ebeln
                     INTO wk_ebeln
                     FROM ekko
                     WHERE ebeln = it_bsak-ebeln
                     AND bstyp = 'F'.
              IF sy-subrc EQ 0.
                SET PARAMETER ID 'BES' FIELD it_bsak-ebeln.
                CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
              ELSE.
                SET PARAMETER ID 'VRT' FIELD it_bsak-ebeln.
                CALL TRANSACTION 'ME33' AND SKIP FIRST SCREEN.
              ENDIF.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "user_command
    FORM pfstatus USING ut_extab TYPE slis_t_extab.
      SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'.
    ENDFORM.                    "pfstatus
    *---Authorization check---
    FORM bukrs_check.
      SELECT SINGLE
             butxt "Name of the Company Code / Company
             ort01 "City
             INTO (wk_company, wk_city) FROM t001
             WHERE  bukrs = pa_bukrs.
      IF sy-subrc <> 0.
        MESSAGE 'create your own message' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " BUKRS_CHECK
    FORM build_event_tab.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = it_events[].
      READ TABLE it_events INTO wa_events
         WITH KEY name = 'SLIS_EV_TOP_OF_PAGE'.
      IF sy-subrc = 0.
        wa_events-form = 'TOP_OF_PAGE'.
        MODIFY it_events FROM wa_events INDEX sy-tabix.
      ENDIF.
      READ TABLE it_events INTO wa_events WITH KEY name =
                    'SLIS_EV_END_OF_PAGE'.
      IF sy-subrc = 0.
        wa_events-form = 'END_OF_PAGE'.
        MODIFY it_events FROM wa_events INDEX sy-tabix.
      ENDIF.
    ENDFORM. "Get_events
    FORM end_of_page.
      DATA: it_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader.
      wa_header-typ = 'S'.
      wa_header-key = 'MATERIAL'.
    *  wa_line-info = p1.
      APPEND wa_header TO it_header.
      CLEAR wa_header.
    *  READ TABLE it_maktx WITH KEY matnr = p1.
      wa_header-typ = 'S'.
      wa_header-key = 'DESCRIPTION'.
    *  wa_line-info = it_maktx-maktx.
      APPEND  wa_header TO it_header.
      CLEAR wa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
    *      i_logo             = 'ENJOYSAP_LOGO'
           it_list_commentary = it_header.
    ENDFORM.                    "END_OF_PAGE
    FORM top_of_page USING document TYPE REF TO cl_dd_document.
      DATA: dl_text(255) TYPE c,
            lv_cutime TYPE sy-uzeit,
            lv_cudt(20) TYPE c.
      lv_cudt = sy-datum.
    *--Passing Date----*
      WRITE  lv_cudt TO dl_text.
      CONCATENATE 'Date : ' lv_cudt+6(2) '-'
                            lv_cudt+4(2) '-'
                            lv_cudt+0(4) INTO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text = dl_text.
      CLEAR : dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
      WRITE 'INCAP CON MFG SER (P) LTD' TO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text         = dl_text
          sap_emphasis = cl_dd_area=>heading
          sap_style    = cl_dd_area=>heading
          sap_color    = cl_dd_area=>list_total_inv.
      CLEAR : dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 150.
      lv_cutime = sy-uzeit.
      CONCATENATE 'Time : ' lv_cutime+0(2) ':'
                            lv_cutime+2(2) ':'
                            lv_cutime+4(2) INTO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text = dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 60.
      WRITE 'Purchase Journal' TO dl_text.
      CALL METHOD document->add_text
        EXPORTING
          text         = dl_text
          sap_emphasis = cl_dd_area=>heading
          sap_style    = cl_dd_area=>heading
          sap_color    = cl_dd_area=>list_total_inv.
      CLEAR : dl_text.
      CALL METHOD document->add_gap
        EXPORTING
          width = 50.
    ENDFORM.                    "html_top_of_page

  • 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

  • Read modified ALV Cell Data - REUSE_ALV_LIST_DISPLAY

    Hi,
    I am using REUSE_ALV_LIST_DISPLAY to display my ALV List. There is one editable field in this ALV output.
    When user changes any value, In the ALV User Command, the updated value is not reflected.
    I know, we use 'GET_GLOBALS_FROM_SLVC_FULLSCR' Function Module to get the updated data.
    However its not working for me, as I am not using ALV Grid , but ALV List.
    Please let me know, how to read the modified data while using ALV List.

    This is old post but i put this info just in case some people have the same issue:
    In user command routine i pass two parameters: the command what the user intro and the info of the row was selected. In the info of the row you must update the field refresh with 'X' value and you must update your internal table was referenced in your alv function. this work just if you was set the hotspot and input field setting in the catalog of the ALV (in this example the field "marca")
    FORM user_command USING p_ucomm     LIKE sy-ucomm
                                                 lw_selfield TYPE slis_selfield.
    CASE p_ucomm .
         WHEN '&M_ALL'.
    *       mark field "marca" with 'X' value in all rows in it_totales_wf table
           LOOP AT it_totales_wf.
             lw_selfield-refresh = 'X'.
             it_totales_wf-marca = 'X'.
             MODIFY it_totales_wf INDEX sy-tabix.
           ENDLOOP.
         WHEN '&D_ALL'.
           LOOP AT it_totales_wf.
    *       unmark field "marca" in all rows in it_totales_wf table        
             lw_selfield-refresh = 'X'.
             CLEAR it_totales_wf-marca.
             MODIFY it_totales_wf INDEX sy-tabix.
           ENDLOOP.
         WHEN '&IC1'.
           lw_selfield-refresh = 'X'.
    *       mark field "marca" with in the row selected by the user in it_totales_wf table
           IF lw_selfield-tabindex NE 0 AND lw_selfield-fieldname = 'MARCA'.
             READ TABLE it_totales_wf INDEX lw_selfield-tabindex.
             IF it_totales_wf-marca = 'X'.
               CLEAR it_totales_wf-marca.
             ELSE.
               it_totales_wf-marca = 'X'.
             ENDIF.
             MODIFY it_totales_wf INDEX lw_selfield-tabindex.
           ELSE.
             LOOP AT it_totales_wf.
               it_totales_wf-marca = 'X'.
               MODIFY it_totales_wf.
             ENDLOOP.
           ENDIF.
    ENDCASE.

  • Way to get alv grid varients info during background execution

    I have used the function module 'REUSE_ALV_GRID_LAYOUT_INFO_GET' to get info alv grid varients i.e already created layout info. Is there any other way of getting this info as this is not giving the exact layout during background execution.

    Hi Vijaya,
    It should work. I am giving you a sample code. Try this and let me know.
    REPORT TEST.
    data gt_lfa1 type standard table of lfa1.
    data gt_kna1 type standard table of kna1.
    start-of-selection.
      select * from lfa1 into table gt_lfa1 up to 10 rows.
      select * from kna1 into table gt_kna1 up to 20 rows.
    end-of-selection.
      if sy-batch eq 'X'.
        perform display_lfa1.
        perform display_kna1.
      endif.
    form display_lfa1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'LFA1'
        tables
          t_outtab           = gt_lfa1
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " DISPLAY_LFA1
    form display_kna1 .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = sy-repid
          i_structure_name   = 'KNA1'
        tables
          t_outtab           = gt_kna1
        exceptions
          program_error      = 1
          others             = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    endform.                    " DISPLAY_KNA1
    copy and paste the code and create a program. Activate it and come back to SE38 screen.
    Now, in program name give the name of the report created and then
    select PROGRAM->EXECUTE->BACKGROUND from the MENU bar.
    This will generate two separate spools . One for KNA1 data & one for LFA1 data.
    Let me know how it goes.
    Thanks,
    Abhishek

  • Reuse_alv_list_display

    I have displayed fields using "reuse_alv_list_display".
    before that list display i want to display date and time but this must be displayed in the same screen where i get output from reuse_alv_list_display. how to do that

    Hi,
              This can be achieved using Top of page event. while building the event for the FM pass the form name (say TOP_OF_PAGE) to the event top_of_page.
    Now create a form TOP_OF_PAGE and do the required thing.
    See sample code.
    type-pools: slis.
    types:
          begin of ty_output,
          chk type c,
          number type i,
          name(20) type c,
          end of ty_output.
    data: gt_output type standard table of ty_output,
          gs_output type ty_output.
    data: wa_layout           type slis_layout_alv.
    data: it_fieldcatalog type slis_t_fieldcat_alv,
          wa_fieldcatalog type slis_fieldcat_alv,
          lt_event type slis_t_event, "for capturing top-of-page event
          ls_event type slis_alv_event.
    *Title displayed when the alv list is displayed
    data:  i_title type lvc_title value 'HEADER FOR THE TABLE'.
    start-of-selection.
      perform get_data.
      perform field_catlog.
      perform build_events.
      perform grid_display.
    *&      Form  field_catlog
          text
    -->  p1        text
    <--  p2        text
    form field_catlog .
      wa_fieldcatalog-fieldname = 'NUMBER'.
      wa_fieldcatalog-outputlen = '10'.
      wa_fieldcatalog-col_pos = '2'.
      wa_fieldcatalog-seltext_m   = 'NUMBER'.
      append  wa_fieldcatalog to it_fieldcatalog.
      clear  wa_fieldcatalog.
      wa_fieldcatalog-fieldname = 'NAME'.
      wa_fieldcatalog-outputlen = '10'.
      wa_fieldcatalog-col_pos = '3'.
      wa_fieldcatalog-seltext_m   = 'NAME'.
      append  wa_fieldcatalog to it_fieldcatalog.
      clear  wa_fieldcatalog.
      wa_layout-box_fieldname     = 'CHK' .
      wa_layout-box_tabname       = 'GT_OUTPUT' .
      wa_layout-colwidth_optimize = 'X'.
    endform.                    " field_catlog
    *&      Form  TOP_OF_PAGE
    To display at name and address at the top of the page
    -->  p1        text
    <--  p2        text
    form top_of_page .
    To display  top of the page
      WRITE:/ sy-vline.
      WRITE:/40 'TOP OF PAGE' CENTERED.
      WRITE:/ sy-vline.
    endform.                    " TOP_OF_PAGE
    *&      Form  build_events
          text
    -->  p1        text
    <--  p2        text
    form build_events .
    *Get all possible events
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = lt_event
        exceptions
          list_type_wrong = 1
          others          = 2.
      if sy-subrc <> 0.
      endif.
    Specify events used in selection screen
      read table lt_event with key name = slis_ev_top_of_page
                         into ls_event.
      if sy-subrc = 0.
        ls_event-form = 'TOP_OF_PAGE'.
        modify lt_event from ls_event index sy-tabix.
        clear ls_event.
      endif.
      read table lt_event with key name = slis_ev_end_of_list
                         into ls_event.
      if sy-subrc = 0.
        ls_event-form = 'END_OF_LIST'.
        modify lt_event from ls_event index sy-tabix.
        clear ls_event.
      endif.
    endform.                    " build_events
    *&      Form  grid_display
          text
    -->  p1        text
    <--  p2        text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
        I_CALLBACK_PROGRAM             = sy-repid
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
        IS_LAYOUT                      = wa_layout
        IT_FIELDCAT                    = it_fieldcatalog
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
        IT_EVENTS                      = lt_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                       = gt_output
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
    endform.                    " grid_display

  • REUSE_ALV_LIST_DISPLAY does not display internal table contents

    Hi,
    Im having a weird problem at my hand. Im using the function module REUSE_ALV_LIST_DISPLAY to display a basic list. I have the contents in an internal table. I have built a field catalog and its working fine. Im passing the internal table to the FM, but in the output I can't see any of the table entries.
    Im new to ALV programming. Please guide me in this regard. Also I would be thankful, if I could be provided with some links for learning more about 'ALV Lists'.

    Hi,
    Check out whether the data is present in the intenaltable or not. Try to debug ur program where it is not processing.
    If the problem persists try to post ur code  in this thread. Let me check it.
    ALV programs.
    http://www.geocities.com/mpioud/Abap_programs.html
    . How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    ALV
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - http://www.sapgenie.com/abap/reports.htm
    http://www.allsaplinks.com/material.html
    http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    Regards,
    Priyanka.

  • Calling event top_of_page

    Hello friends,
    I had created program for displaying data in ALV grid and when I double any row in the grid then second alv list will generate with new data. I had programmed list heading in top_of_page function. The problem is on the first alv display top_of_page is working fine but when I double click any row then for second list form top_of_page is not calleing up. Here is the code for displaying data in second alv grid.
    REPORT  ZALV12.
    TYPE-POOLS SLIS.
    DATA: it_vbak type standard table of VBAK,
          it_vbap type table of VBAP.
    DATA: wa_vbak like line of it_vbak,
          wa_vbap like line of it_vbap.
    DATA syrepid like sy-repid.
    DATA:fld_vbak type SLIS_T_FIELDCAT_ALV,
          fld_vbap type SLIS_T_FIELDCAT_ALV.
    DATA:fld_wa_vbak type SLIS_FIELDCAT_ALV,
         fld_wa_vbap type SLIS_FIELDCAT_ALV.
    DATA:vevent type SLIS_T_EVENT,
         vevent1 type SLIS_T_EVENT,
         waevent type SLIS_ALV_EVENT,
         waevent1 type SLIS_ALV_EVENT.
    DATA:LST_HEADR type SLIS_T_LISTHEADER,
          LST_HEADR1 type SLIS_T_LISTHEADER.
    DATA title_alv type LVC_TITLE value 'LIST FOR VBAK'.
    INITIALIZATION.
    syrepid = sy-repid.
    perform get_event.
    perform populate_event.
    perform set_list_headr using LST_HEADR.
    perform field_cat.
    .................                       "code for displaying data in first alv.
      form USER_COMMAND using R_UCOMM type SY-UCOMM    "<------code for displaying second alv.
         r_selfield type SLIS_SELFIELD.
        case R_UCOMM.
         when '&IC1'.
           read table it_vbak into wa_vbak index r_selfield-TABINDEX.
            perform data_select.
            perform list_heading using LST_HEADR1.
            perform event_get.
            perform build_event.
            perform alv_display.
        endcase.
    endform.
    form data_select.
       select * from VBAP into table it_vbap up to 200 rows.
    endform.
    form list_heading using i_lst type SLIS_T_LISTHEADER.
       data HLINE type SLIS_LISTHEADER.
       HLINE-TYP = 'H'.
       HLINE-INFO = 'FOR VBAP'.
       append HLINE to i_lst.
    endform.
    form alv_display.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           I_CALLBACK_PROGRAM                = syrepid
           I_STRUCTURE_NAME                  = 'VBAP'
           I_GRID_TITLE                      = 'SCREEN2_VBAP'
         TABLES
           T_OUTTAB                          = it_vbap
       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.
       form event_get.
         CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
             I_LIST_TYPE           = 0
          IMPORTING
             ET_EVENTS             = vevent1
         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.
      endform.
      form build_event.
        read table vevent1 into waevent1 with key name = 'TOP_OF_PAGE'.
        if sy-subrc = 0.
          waevent1-form = 'F_TOP_OF_PAGE'.
          modify vevent1 from waevent1 transporting form
          where name = 'TOP_OF_PAGE'.
          endif.
      endform.
      form F_TOP_OF_PAGE.                              "  <----
    this function is not calling up."
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = LST_HEADR1
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
          I_ALV_FORM               =
      endform.
    Edited by: shubh_ag on Nov 10, 2010 7:18 AM

    Hello friends,
    I had created program for displaying data in ALV grid and when I double any row in the grid then second alv list will generate with new data. I had programmed list heading in top_of_page function. The problem is on the first alv display top_of_page is working fine but when I double click any row then for second list form top_of_page is not calleing up. Here is the code for displaying data in second alv grid.
    REPORT  ZALV12.
    TYPE-POOLS SLIS.
    DATA: it_vbak type standard table of VBAK,
          it_vbap type table of VBAP.
    DATA: wa_vbak like line of it_vbak,
          wa_vbap like line of it_vbap.
    DATA syrepid like sy-repid.
    DATA:fld_vbak type SLIS_T_FIELDCAT_ALV,
          fld_vbap type SLIS_T_FIELDCAT_ALV.
    DATA:fld_wa_vbak type SLIS_FIELDCAT_ALV,
         fld_wa_vbap type SLIS_FIELDCAT_ALV.
    DATA:vevent type SLIS_T_EVENT,
         vevent1 type SLIS_T_EVENT,
         waevent type SLIS_ALV_EVENT,
         waevent1 type SLIS_ALV_EVENT.
    DATA:LST_HEADR type SLIS_T_LISTHEADER,
          LST_HEADR1 type SLIS_T_LISTHEADER.
    DATA title_alv type LVC_TITLE value 'LIST FOR VBAK'.
    INITIALIZATION.
    syrepid = sy-repid.
    perform get_event.
    perform populate_event.
    perform set_list_headr using LST_HEADR.
    perform field_cat.
    .................                       "code for displaying data in first alv.
      form USER_COMMAND using R_UCOMM type SY-UCOMM    "<------code for displaying second alv.
         r_selfield type SLIS_SELFIELD.
        case R_UCOMM.
         when '&IC1'.
           read table it_vbak into wa_vbak index r_selfield-TABINDEX.
            perform data_select.
            perform list_heading using LST_HEADR1.
            perform event_get.
            perform build_event.
            perform alv_display.
        endcase.
    endform.
    form data_select.
       select * from VBAP into table it_vbap up to 200 rows.
    endform.
    form list_heading using i_lst type SLIS_T_LISTHEADER.
       data HLINE type SLIS_LISTHEADER.
       HLINE-TYP = 'H'.
       HLINE-INFO = 'FOR VBAP'.
       append HLINE to i_lst.
    endform.
    form alv_display.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
           I_CALLBACK_PROGRAM                = syrepid
           I_STRUCTURE_NAME                  = 'VBAP'
           I_GRID_TITLE                      = 'SCREEN2_VBAP'
         TABLES
           T_OUTTAB                          = it_vbap
       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.
       form event_get.
         CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
             I_LIST_TYPE           = 0
          IMPORTING
             ET_EVENTS             = vevent1
         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.
      endform.
      form build_event.
        read table vevent1 into waevent1 with key name = 'TOP_OF_PAGE'.
        if sy-subrc = 0.
          waevent1-form = 'F_TOP_OF_PAGE'.
          modify vevent1 from waevent1 transporting form
          where name = 'TOP_OF_PAGE'.
          endif.
      endform.
      form F_TOP_OF_PAGE.                              "  <----
    this function is not calling up."
        CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
          EXPORTING
            IT_LIST_COMMENTARY       = LST_HEADR1
          I_LOGO                   =
          I_END_OF_LIST_GRID       =
          I_ALV_FORM               =
      endform.
    Edited by: shubh_ag on Nov 10, 2010 7:18 AM

  • Issues with the TOP_OF_PAGE and REUSE_ALV_EVENTS_GET FM

    Hello experts,
    I have some information displayed as TOP_OF_PAGE in an ALV. The problem is when the user performs any action in the ALV ( Hide Columns, Right Click in any cell, etc..) the Top of Page information duplicates. If the user performs 3 actions then it will write 3 times the information.
    This is how is structured my TOP_OF_PAGE:
    FORM TOP_OF_PAGE.
      DATA:  lv_date1 LIKE sy-datum,
             hline TYPE slis_listheader,
             text(60) TYPE c,
             text1(60) TYPE c,
             name LIKE adrp-name_text,
             persnumber LIKE usr21-persnumber.
      CLEAR: hline, text, text1.
      lv_date1 = sy-datum.
      hline-typ  = 'H'.
      hline-info = sy-title(57).
      APPEND hline TO heading.
    *- user information
      SELECT SINGLE persnumber INTO persnumber
       FROM usr21 WHERE bname = sy-uname.
      IF sy-subrc = 0.
        SELECT SINGLE name_text INTO name
        FROM adrp WHERE persnumber = persnumber.
        CONCATENATE name '(' sy-uname ')' INTO name
        SEPARATED BY space.
      ENDIF.
      hline-typ  = 'S'.
      hline-key  = 'User:'.
      hline-info = name.
      APPEND hline TO heading.
    "List body comment block output
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = heading.
    And this is how I am calling the TOP_OF_PAGE form:
    FORM build_eventtab  USING    p_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_events.
      READ TABLE p_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE 'TOP_OF_PAGE' TO ls_event-form.
        APPEND ls_event TO p_events.
      ENDIF.
    ENDFORM.                    " BUILD_EVENTTAB
    Thanks in advance for any help!
    -C

    Ideally The below code should be out of the FORM TOP_OF_PAGE.
    This code should be in separate form , and it should be called only once.
    TOP_OF_PAGE called Dynamically from event details.
    You should follow the Coding in the below mentioned way..
    But you already finished it, so you can avoid that using clear and Refresh.
    perform populate_headings. "Heading
    perform events_build.        "events
    Perform display.  " in this you should call the alv fm
    FORM  populate_headings.
      DATA:  lv_date1 LIKE sy-datum,
             hline TYPE slis_listheader,
             text(60) TYPE c,
             text1(60) TYPE c,
             name LIKE adrp-name_text,
             persnumber LIKE usr21-persnumber.
      CLEAR: hline, text, text1.
      lv_date1 = sy-datum.
      hline-typ  = 'H'.
      hline-info = sy-title(57).
      APPEND hline TO heading.
    *- user information
      SELECT SINGLE persnumber INTO persnumber
       FROM usr21 WHERE bname = sy-uname.
      IF sy-subrc = 0.
        SELECT SINGLE name_text INTO name
        FROM adrp WHERE persnumber = persnumber.
        CONCATENATE name '(' sy-uname ')' INTO name
        SEPARATED BY space.
      ENDIF.
      hline-typ  = 'S'.
      hline-key  = 'User:'.
      hline-info = name.
      APPEND hline TO heading.
    ENDFORM.
    FORM TOP_OF_PAGE.
    "List body comment block output
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = heading.
    ENDFORM.

  • Esquema de Cálculo - RM0002 - Info Record

    Pessoal,
    Boa noite!
    Gostaria de pedir uma ajuda. Estou em um projeto de implantação de SAP e no processo de testes de solicitação de cotação, encontrei um problema na momento de salvar o preço de mercado. O sistema acusa o seguinte erro: "Não foi possível determinar tipo de condição para o preço Nº mensagem 06657"
    Examinando a situação, verifiquei que o processo atualiza o Registro Info com as informações de cotação, mas nesse passo, o sistema reclama que a condição WOBT não está cadastrada para o esquema de cálculo RM0002.
    Verifiquei o esquema de cálculo, e confirmei que essa condição não estava cadastrada. Realizei o cadastro da condição no esquema, mas continuo encontrando o mesmo erro.
    Durante as análises, verifiquei que essa condição é utilizada no esquema de determinação de Pedido de Compras, entre outras coisas e consequentemente estava cadastrado no esquema RM0000.
    Por acaso alguém tem alguma idéia de como resolver esse problema? Procurei notas, posts em fóruns, porém sem sucesso.
    Desde já obrigado pela ajuda!
    Att,
    Raphael.

    Marcos,
    problema resolvido! Houve um problema em uma configuração que foi refeita e já está td ok!
    Determinar esquema de cálculo p/determinação preço de mercado em Determinar determinação de esquema.
    Muito obrigado!
    Att,
    Raphael

Maybe you are looking for

  • Transferring appleworks as a whole application?

    i have appleworks running fine on my macbook running osx 10.5.5 i now have a new macbook air and wish to have appleworks on that also as im getting rid of my normal older macbook but i no longer have the disk appleworks came on as it did with my olde

  • Why do I have a font problem in my FROM and TO lines?

    I have converted this week from Entourage to Apple Mail. I'm getting used to it, but really miss the formatting capabilities of Entourage. Given Apple's mastery of fonts and typography, how did Apple Mail end up being so basic? But more immediate is

  • BPM Status "In Process" - Message reached ECC successfully ??!!!

    Hi,    I need help to resolve one issue which we are facing : (this is kinda strange) ========================================================================== We are using a BPM in one of our scenario where acknowledgements are sent in and out from

  • IDOC with Multiple Segment to One Single Record Mapping

    Hello I have a problem mapping the values of the segment <E1CSKTM> which occurs two times in my source IDOC to a single record. My requirement is to get one field (LTEXT) from the first E1CSKTM segment and map it to Name and take the same field (LTEX

  • I cannot activate the Windows.

    I bought a new Dell inspiron 2 weeks ago. One day all the default apps disappeared with no reason. I went to my university technology center for help, and they reinstalled the windows 8 for me.  However, the computer I bought is pre-installed with wi