<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Alv GRID in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602567#M270521</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this in ALV "end-of-list" or "END-OF-PAGE" event.Fill the ALV event table with these events and in the subroutine "end-of-list" you can write your code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Sep 2006 10:54:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-19T10:54:54Z</dc:date>
    <item>
      <title>Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602566#M270520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the alv grid display how to display the end of list contents .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example; my internal table is processing 100 entries of inter nal table out of which 20 are in error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this info is to be displayed at the end of list.&lt;/P&gt;&lt;P&gt;like total processed 100&lt;/P&gt;&lt;P&gt;successful records 80&lt;/P&gt;&lt;P&gt;incorrect 20 &lt;/P&gt;&lt;P&gt;how do i do that? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if possible and example program please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 10:52:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602566#M270520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T10:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602567#M270521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this in ALV "end-of-list" or "END-OF-PAGE" event.Fill the ALV event table with these events and in the subroutine "end-of-list" you can write your code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 10:54:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602567#M270521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T10:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602568#M270522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi anitha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of doing that you cango like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message S001(ZE) with v_success 'successful records out of' v_totalrecords.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_success --&amp;gt; variable to store no of successful records&lt;/P&gt;&lt;P&gt;v_totalrecords --&amp;gt; variable to store total no of records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Chandrasekhar Jagarlamudi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 10:56:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602568#M270522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T10:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602569#M270523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think u have to go for ALV list display.&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_callback_program = v_repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Display Records.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            is_layout                  = layout&lt;/P&gt;&lt;P&gt;            it_fieldcat                = t_fieldcat&lt;/P&gt;&lt;P&gt;            i_tabname                  = 'T_MP_BIW'&lt;/P&gt;&lt;P&gt;            it_events                  = t_event1&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            t_outtab                   = t_mp_biw&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            program_error              = 1&lt;/P&gt;&lt;P&gt;            maximum_of_appends_reached = 2&lt;/P&gt;&lt;P&gt;            OTHERS                     = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display Error Records&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            is_layout                  = layout1&lt;/P&gt;&lt;P&gt;            it_fieldcat                = t_fieldcat1&lt;/P&gt;&lt;P&gt;            i_tabname                  = 'T_ERROR'&lt;/P&gt;&lt;P&gt;            it_events                  = t_event&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            t_outtab                   = t_error&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            program_error              = 1&lt;/P&gt;&lt;P&gt;            maximum_of_appends_reached = 2&lt;/P&gt;&lt;P&gt;            OTHERS                     = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrds&lt;/P&gt;&lt;P&gt;Divakar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 10:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602569#M270523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T10:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602570#M270524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;then you can use END_OF_LIST event of ALV. as you are using GRID display, to display the text at the end of the report,we cant just use WRITE statement(as we do in LIST DIPSLAY),instead you have to call 'REUSE_ALV_COMMENTARY_WRITE' function module and pass all the text to be displayed to this FM. &lt;/P&gt;&lt;P&gt;it will be displayed automatically at runtime.&lt;/P&gt;&lt;P&gt;check this code,&lt;/P&gt;&lt;P&gt;1. i am populating ALV EVENTS to the IT_EVENTS internal table.&lt;/P&gt;&lt;P&gt;2. for END OF LIST event i am populating the FORM name&lt;/P&gt;&lt;P&gt;3. i defined the FORM FOOTER and added my code there.&lt;/P&gt;&lt;P&gt;4. i given IT_EVENTS internal table name to the GRID DISPLAY function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  SET_EVENTS
*&amp;amp;---------------------------------------------------------------------*
*       text : Assign form names to the Events
*----------------------------------------------------------------------*
FORM SET_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 &amp;lt;&amp;gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

*--Text To be displayed at TOP OF LIST
 &amp;lt;b&amp;gt; CLEAR WA_EVENT.
  READ TABLE IT_EVENTS INTO WA_EVENT WITH KEY NAME = 'END_OF_LIST'.  &amp;lt;--this event will be triggered at the end of the list output.
  WA_EVENT-FORM = 'FOOTER'.&amp;lt;/b&amp;gt; &amp;lt;--this FORM will be called at runtime.we should create a FORM with this name and what ever we want to display at the end of the list we have to write them here.
  MODIFY IT_EVENTS FROM WA_EVENT INDEX SY-TABIX.

ENDFORM.                    " SET_EVENTS

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  FOOTER
*&amp;amp;---------------------------------------------------------------------*
*       text :Text to be displyed at the END OF LIST
*----------------------------------------------------------------------*
FORM FOOTER .
*-- Standard end of report
WRITE YOUR brief footer here.
&amp;lt;b&amp;gt;
YOU should use 'REUSE_ALV_COMMENTARY_WRITE' function module to display the text as FOOTER in the GRID display.In LIST display,you can use WRITE to display the same.
  data: t_header type slis_t_listheader,
        wa_header type slis_listheader.
 wa_header-typ  = 'A'.
  wa_header-info = 'END OF REPORT'.
  append wa_header to t_header.
  clear: wa_header.
  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
       it_list_commentary = t_header.
*       i_logo             = 'GANESH_LOGO'.&amp;lt;/b&amp;gt;
ENDFORM.                    " FOOTER

and finally you should pass this EVENTS internal table to the GRID Function module.here i used LIST display,but even you can use the same to GRID also.

 CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            I_CALLBACK_PROGRAM = V_REPID
            IS_LAYOUT          = WA_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT[]
            IT_SORT            = IT_SORT[]
&amp;lt;b&amp;gt;            IT_EVENTS          = IT_EVENTS[]&amp;lt;/b&amp;gt;
       TABLES
            T_OUTTAB           = IT_MLGT[]
       EXCEPTIONS
            PROGRAM_ERROR      = 1
            OTHERS             = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srikanth Kidambi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 10:59:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602570#M270524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T10:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602571#M270525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of using 'REUSE_ALV_GRID_DISPLAY' use &lt;/P&gt;&lt;P&gt;'RESUE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will work perfectly for your requirment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZWA_ALV_EDITABLE_FM .

type-pools: slis.

data it_fieldcat type slis_fieldcat_alv occurs 0 with header line.
data: gs_layout type slis_layout_alv.
data: it_events type SLIS_T_EVENT.
data: wa_event like line of it_events.
data v_repid like sy-repid.

DATA: BEGIN OF itab OCCURS 0.
        INCLUDE STRUCTURE CSKT.
DATA: end of itab.


START-OF-SELECTION.

  v_repid = sy-repid.

*--- selection form cost center master table

  SELECT * FROM CSKT
  INTO TABLE itab.

  PERFORM field_catalog.
  PERFORM set_events.

  SET PF-STATUS 'ZBC'.

  call function 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
            i_callback_program      = v_repid
            i_callback_user_command = 'USER_COMMAND'
            it_fieldcat             = it_fieldcat[]
            it_events               = it_events[]
            is_layout               = gs_layout
            I_SAVE                  = 'X'
       TABLES
            t_outtab                = itab.


*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  field_catalog
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM field_catalog.

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name     = v_repid
            i_internal_tabname = 'ITAB'
            i_inclname         = v_repid
       CHANGING
            ct_fieldcat        = it_fieldcat[].


ENDFORM.                 
*---------------------------------------------------------------------*
*       FORM SET_EVENTS                                               *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM SET_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 &amp;lt;&amp;gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

*--Text To be displayed at TOP OF LIST
  CLEAR WA_EVENT.
&amp;lt;b&amp;gt;  READ TABLE IT_EVENTS INTO WA_EVENT WITH KEY NAME = 'END_OF_LIST'.&amp;lt;/b&amp;gt;
&amp;lt;b&amp;gt;  WA_EVENT-FORM = 'FOOTER'.&amp;lt;/b&amp;gt;
  MODIFY IT_EVENTS FROM WA_EVENT INDEX SY-TABIX.
ENDFORM. 

*---------------------------------------------------------------------*
*       FORM FOOTER                                                   *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM FOOTER .
*-- Standard end of report

&amp;lt;b&amp;gt;write:/ 'THIS IS FOOTER AT END OF LIST'.&amp;lt;/b&amp;gt;

ENDFORM. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 11:15:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602571#M270525</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-09-19T11:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602572#M270526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using OO ALV, and not the function module 'REUSE_ALV_GRID_DISPLAY', you can splid down your container, and use the event END_OF_LIST to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alexandre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 11:38:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602572#M270526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T11:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alv GRID</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602573#M270527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you  very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2006 08:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-grid/m-p/1602573#M270527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-28T08:32:14Z</dc:date>
    </item>
  </channel>
</rss>

