SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Примечания к ALV



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
cbw07
Старший специалист
Старший специалист



Joined: 30 Nov 2007
Posts: 127

PostPosted: Tue May 27, 2008 3:39 pm    Post subject: Примечания к ALV Reply with quote

Я вывожу таблицу ALV через REUSE_ALV_GRID_DISPLAY
Перед таблицей у меня выводится заголовок (slis_listheader).
Мне надо, чтобы после таблицы тоже выводился текст с комментариями.
Т.е. что-то вроде уже имеющегося заголовка, но только внизу под таблицей.
Как это можно сделать?
Back to top
View user's profile Send private message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Tue May 27, 2008 4:14 pm    Post subject: Reply with quote

Такой пример от братьев индийцев не подойдет?
Соотвественно код из top_of_pages перенести в end_of_lists.

Code:
*-- For Events
TYPE-POOLS:
  slis.
DATA: BEGIN OF it_tab OCCURS 0.
        INCLUDE STRUCTURE sflight.
DATA: END OF it_tab.
DATA: it_fctab1 TYPE slis_t_fieldcat_alv.

DATA: it_events TYPE slis_t_event.
DATA: st_event LIKE LINE OF it_events.

DATA: g_repid LIKE sy-repid.

START-OF-SELECTION.

  SELECT * FROM sflight INTO TABLE it_tab.
*-- For Events
  PERFORM get_eventlist.
*-- For ALV Display.
  PERFORM alv_display.

*---------------------------------------------------------------------
**      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 NE 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_top_of_page
    INTO st_event.
  IF sy-subrc EQ 0.
    st_event-form = 'TOP_OF_PAGES'.
    modify it_events from st_event index sy-tabix.
  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_PAGES'.
    modify it_events from st_event index sy-tabix.
  ENDIF.

  READ TABLE it_events WITH KEY name = slis_ev_top_of_list
    INTO st_event.
  IF sy-subrc EQ 0.
    st_event-form = 'TOP_OF_LISTS'.
    modify it_events from st_event index sy-tabix.
  ENDIF.

  READ TABLE it_events WITH KEY name = slis_ev_end_of_list
    INTO st_event.
  IF sy-subrc EQ 0.
    st_event-form = 'END_OF_LISTS'.
    modify it_events from st_event index sy-tabix.
  ENDIF.

ENDFORM.                    "get_eventlist

*---------------------------------------------------------------------*
*       FORM TOP_OF_PAGES                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM top_of_pages.
  WRITE:/ 'top-of-page'.
  DATA :lt_top_of_page TYPE slis_t_listheader.
  DATA: ls_line TYPE slis_listheader.
  CLEAR ls_line.
  ls_line-typ = 'H'.
  ls_line-info = 'TOP OF PAGES FOR LIST'.
  APPEND ls_line TO lt_top_of_page.
  CLEAR ls_line.
  ls_line-typ = 'S'.
  ls_line-key = 'Author'.
  ls_line-info = 'Maheswar.A.U.'.
  APPEND ls_line TO lt_top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      i_logo             = 'ENJOYSAP_LOGO'
      it_list_commentary = lt_top_of_page.

ENDFORM.                    "top_of_pages

*---------------------------------------------------------------------*
*       FORM TOP_OF_LISTS                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM top_of_lists.

  WRITE:/ 'top-of-list'.

ENDFORM.                    "top_of_lists

*---------------------------------------------------------------------*
*       FORM END_OF_LISTS                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM end_of_lists.

  DATA: lt_end_of_lists TYPE slis_t_listheader.
  DATA: ls_line TYPE slis_listheader.

  CLEAR ls_line.
  ls_line-typ = 'H'. "H = Header, S = Selection, A = Action
  ls_line-info = 'END OF LIST'.
  APPEND ls_line TO lt_end_of_lists.
  CLEAR ls_line.
  ls_line-typ = 'S'.
  ls_line-key = 'Author'.
  ls_line-info = 'Maheswar.A.U.'.
  APPEND ls_line TO lt_end_of_lists.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      i_logo             = 'ENJOYSAP_LOGO'
      it_list_commentary = lt_end_of_lists
      i_end_of_list_grid = 'X'.

*  WRITE:/ 'end-of-list'.
ENDFORM.                    "end_of_lists

*---------------------------------------------------------------------*
*       FORM END_OF_PAGES                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM end_of_pages.
  WRITE:/ 'end-of-page'.
ENDFORM.                    "END_OF_PAGES

*---------------------------------------------------------------------*
*       FORM alv_display                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM alv_display.
  g_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      i_program_name         = g_repid
      i_internal_tabname     = 'IT_TAB'
      i_inclname             = g_repid
    CHANGING
      ct_fieldcat            = it_fctab1
    EXCEPTIONS
      inconsistent_interface = 1
      program_error          = 2
      OTHERS                 = 3.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
  i_callback_program = g_repid
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ''
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
  i_grid_title = 'ALV Grid Display'
* I_GRID_SETTINGS =
* IS_LAYOUT =
  it_fieldcat = it_fctab1
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
  it_events = it_events
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_ADD_FIELDCAT =
* IT_HYPERLINK =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
  TABLES
  t_outtab = it_tab
  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. " alv_display


Last edited by admin on Tue May 27, 2008 9:58 pm; edited 2 times in total
Back to top
View user's profile Send private message
cbw07
Старший специалист
Старший специалист



Joined: 30 Nov 2007
Posts: 127

PostPosted: Tue May 27, 2008 4:31 pm    Post subject: Reply with quote

Сейчас попробую, спасибо
Back to top
View user's profile Send private message
cbw07
Старший специалист
Старший специалист



Joined: 30 Nov 2007
Posts: 127

PostPosted: Tue May 27, 2008 5:25 pm    Post subject: Reply with quote

в TOP_OF_PAGES работает.
Переношу этот код в END_OF_PAGES - просто пустое окно выводится под таблицей
Back to top
View user's profile Send private message
cbw07
Старший специалист
Старший специалист



Joined: 30 Nov 2007
Posts: 127

PostPosted: Tue May 27, 2008 5:55 pm    Post subject: Reply with quote

Может еще что-то куда-то добавить надо, чтобы заработало?
Back to top
View user's profile Send private message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Tue May 27, 2008 8:23 pm    Post subject: Reply with quote

Внизу страницы отрабатывает событие end_of_lists.
Исправил прямо в примере выше.

Вот еще пример.
Using Logos & wallpapers in ALV report
Back to top
View user's profile Send private message
cbw07
Старший специалист
Старший специалист



Joined: 30 Nov 2007
Posts: 127

PostPosted: Wed May 28, 2008 10:20 am    Post subject: Reply with quote

спасибо большое, все заработало.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.