<?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 Report in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211097#M765529</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;ALV is nothing but we are doing the process of totals subtotal,calculations, layout designing these r do the process in normal reports it is to be late. so for that one sap created some predefined function modules for that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;those function modules are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_GRID_DISPLAY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_POPUP_TO_SELECT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REUSE_ALV_VARIANT_EXISTENCE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_fieldcatalog_merge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_events_get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP LIST VIEWER&lt;/P&gt;&lt;P&gt;Purpose &lt;/P&gt;&lt;P&gt;Commonly used ALV Function Modules&lt;/P&gt;&lt;P&gt;DEFINING OUTPUT CHARACTERISTICS:&lt;/P&gt;&lt;P&gt;PREPARING DISPLAY FIELDS CATALOG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A field catalog is prepared using the internal&lt;/P&gt;&lt;P&gt;table(I_FIELDCAT) of type SLIS_T_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Field catalog containing descriptions of the list&lt;/P&gt;&lt;P&gt;output fields (usually a subset of the internal output&lt;/P&gt;&lt;P&gt;table fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A field catalog is required for every ALV list output to add desired functionality (i.e. Key, hotspot,Specific headings, Justify, Col. Position etc) to certain fields of the output. If not mentioned specifically, then the defaults are taken. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the function module&lt;/P&gt;&lt;P&gt;    REUSE_ALV_FIELDCATALOG_MERGE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Example:  &lt;/P&gt;&lt;P&gt;Suppose I_PO_DETAILS is an internal table containing two fields&lt;/P&gt;&lt;P&gt;EBELN (PO number) and EBELP (PO item no). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR L_FIELDCAT.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-TABNAME   = 'I_PO_DETAILS'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-FIELDNAME = 'EBELN'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-KEY = 'X'.         &amp;#147;The PO no is made the key field, &lt;/P&gt;&lt;P&gt;				  &amp;#147;Colored and non scrollable&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  L_FIELDCAT-HOTSPOT = 'X'.     &amp;#147;The po no becomes a hotspot&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_S = &amp;#145;P.O No&amp;#146;.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_M = 'P order No'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_L = 'Purchase order No'.&lt;/P&gt;&lt;P&gt;  APPEND L_FIELDCAT TO I_FIELDTAB.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR L_FIELDCAT.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-TABNAME   = 'I_PO_DETAILS'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-FIELDNAME = 'EBELP'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-KEY = 'X'.         &amp;#147;The PO item no is made the key field, &lt;/P&gt;&lt;P&gt;				  &amp;#147;Colored and non scrollable&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_S = &amp;#145;Item No&amp;#146;.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_M = 'PO item No'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_L = 'Purchase order Item No'.&lt;/P&gt;&lt;P&gt;  APPEND L_FIELDCAT TO I_FIELDTAB.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Thus the catalog for the report output is prepared. &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	 The next step is to build an event table, which are used for&lt;/P&gt;&lt;P&gt;      firing both user commands and the system dependent             events i.e. top of  page, end of page etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A list of possible events is populated into an event table. When this table is passed to the function module&lt;/P&gt;&lt;P&gt;     REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The internal table only needs to be modified with the associated form names corresponding to each of the events.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	 The next step is to build an event table, which are used for&lt;/P&gt;&lt;P&gt;      firing both user commands and the system dependent             events i.e. top of  page, end of page etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A list of possible events is populated into an event table. When this table is passed to the function module&lt;/P&gt;&lt;P&gt;     REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The internal table only needs to be modified with the associated form names corresponding to each of the events.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Example:   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: L_I_EVENT TYPE SLIS_ALV_EVENT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;           I_LIST_TYPE = 0&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            ET_EVENTS   = I_EVENTS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE&lt;/P&gt;&lt;P&gt;                           INTO L_I_EVENT.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE FORMNAME_TOP_OF_PAGE TO L_I_EVENT-FORM.&lt;/P&gt;&lt;P&gt;    APPEND L_I_EVENT TO I_EVENTS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE&lt;/P&gt;&lt;P&gt;                           INTO L_I_EVENT.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE FORMNAME_END_OF_PAGE TO L_I_EVENT-FORM.&lt;/P&gt;&lt;P&gt;    APPEND L_I_EVENT TO I_EVENTS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CLEAR L_I_EVENT.&lt;/P&gt;&lt;P&gt;  READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND&lt;/P&gt;&lt;P&gt;                           INTO L_I_EVENT.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE FORMNAME_USER_COMMAND TO L_I_EVENT-FORM.&lt;/P&gt;&lt;P&gt;    APPEND L_I_EVENT TO I_EVENTS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;The function module REUSE_ALV_COMMENTARY_WRITE can&lt;/P&gt;&lt;P&gt; be used to pass the headings for TOP OF PAGE event. Also,&lt;/P&gt;&lt;P&gt; any logo specific to the report can be passed to the function&lt;/P&gt;&lt;P&gt; module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Example:                                                 &lt;/P&gt;&lt;P&gt;   PERFORM comment_build USING i_list_top_of_page.                         &lt;/P&gt;&lt;P&gt;                            .&lt;/P&gt;&lt;P&gt;                            .&lt;/P&gt;&lt;P&gt;FORM comment_build USING l_top_of_page TYPE slis_t_listheader.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DATA: ls_line TYPE slis_listheader.&lt;/P&gt;&lt;P&gt;  CLEAR ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'H'.&lt;/P&gt;&lt;P&gt;  ls_line-info = 'Heading list'.&lt;/P&gt;&lt;P&gt;  APPEND ls_line TO l_top_of_page.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CLEAR ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'Key 1'.&lt;/P&gt;&lt;P&gt;  ls_line-info = 'Information'.&lt;/P&gt;&lt;P&gt;  APPEND ls_line TO l_top_of_page.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'Key 2'.&lt;/P&gt;&lt;P&gt;  APPEND ls_line TO l_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;The next step is to build a layout report output list&lt;/P&gt;&lt;P&gt;description. &lt;/P&gt;&lt;P&gt;     The parameters are described under the following heads:&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Display options&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Exceptions&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Totals&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Interaction&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Detail screen&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Display variants (only for hierarchical-sequential lists)&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Color&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Other&lt;/P&gt;&lt;P&gt;       The layout table is of type slis_layout_alv_spec. &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;The next step is to sort the basic list with respect to&lt;/P&gt;&lt;P&gt; some of the fields in the list output. An internal&lt;/P&gt;&lt;P&gt; table needs to be declared according to the&lt;/P&gt;&lt;P&gt; structure slis_t_sortinfo_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure has got the following parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spos            :  Sort sequence&lt;/P&gt;&lt;P&gt;Fieldname   :  Internal output table field name&lt;/P&gt;&lt;P&gt;Tabname     : Only relevant for hierarchical-sequential lists. Name of the internal&lt;/P&gt;&lt;P&gt;                      output  table.&lt;/P&gt;&lt;P&gt; up               : 'X' = sort in ascending order&lt;/P&gt;&lt;P&gt; down          : 'X' = sort in descending order&lt;/P&gt;&lt;P&gt; subtot        : 'X' = subtotal at group value change&lt;/P&gt;&lt;P&gt; group         : '* ' = new page at group value change ,'UL' = underline at group value&lt;/P&gt;&lt;P&gt;                     change &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final step in the output of the report is the use of&lt;/P&gt;&lt;P&gt; two ALV functions modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	REUSE_ALV_FIELDCATALOG_MERGE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import parameters  &lt;/P&gt;&lt;P&gt;     I_PROGRAM_NAME         : Program in which the internal output table is&lt;/P&gt;&lt;P&gt;                                                  declared and populated    &lt;/P&gt;&lt;P&gt;    I_INTERNAL_TABNAME   : Internal output table name &lt;/P&gt;&lt;P&gt;    I_STRUCTURE_NAME      : Structure name (structure, table, and view)&lt;/P&gt;&lt;P&gt;    I_CLIENT_NEVER_DISPL : Hide client fields default &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;    I_INCLNAME                      : Data declarations include name &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CHANGING parameter &lt;/P&gt;&lt;P&gt;CT_FIELDCAT                       : Field catalog with field descriptions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    The final function module for displaying the output according to the catalog, event build, sort sequence, layout and comment build are either &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     REUSE_ALV_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       OR&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;     REUSE_ALV_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;     REUSE_ALV_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I_INTERFACE_CHECK 		: Interface consistency check log output.&lt;/P&gt;&lt;P&gt;I_CALLBACK_PROGRAM		: Name of the calling program&lt;/P&gt;&lt;P&gt;I_CALLBACK_PF_STATUS_SET	: Set EXIT routine to status.    &lt;/P&gt;&lt;P&gt;I_CALLBACK_USER_COMMAND	: EXIT routine for command handling&lt;/P&gt;&lt;P&gt;I_STRUCTURE_NAME		: Internal output table structure name      &lt;/P&gt;&lt;P&gt;IS_LAYOUT 			: List layout specifications  &lt;/P&gt;&lt;P&gt;IT_FIELDCAT		: Field catalog with field descriptions &lt;/P&gt;&lt;P&gt;IT_EXCLUDING		: Table of inactive function codes    &lt;/P&gt;&lt;P&gt;IT_SPECIAL_GROUPS		: Grouping fields for column selection&lt;/P&gt;&lt;P&gt;IT_SORT			: Sort criteria for first list display&lt;/P&gt;&lt;P&gt;IT_FILTER			: Filter criteria for first list output&lt;/P&gt;&lt;P&gt;IS_SEL_HIDE		: Selection information modification&lt;/P&gt;&lt;P&gt;I_DEFAULT			: Initial variant active/inactive logic&lt;/P&gt;&lt;P&gt;I_SAVE			: Variants can be saved&lt;/P&gt;&lt;P&gt;IS_VARIANT			: Variant information&lt;/P&gt;&lt;P&gt;IT_EVENTS			: Table of events to perform &lt;/P&gt;&lt;P&gt;IT_EVENT_EXIT		:  Standard fcode exit requests table  &lt;/P&gt;&lt;P&gt;IS_PRINT			: Print information&lt;/P&gt;&lt;P&gt;IS_REPREP_ID		: Initialization keys for Re/Re interface &lt;/P&gt;&lt;P&gt;I_SCREEN_START_COLUMN	: Coordinates for list in dialog box 	&lt;/P&gt;&lt;P&gt;I_SCREEN_START_LINE		: Coordinates for list in dialog box&lt;/P&gt;&lt;P&gt;I_SCREEN_END_COLUMN	: Coordinates for list in dialog box &lt;/P&gt;&lt;P&gt;                                         &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Export parameters&lt;/P&gt;&lt;P&gt;E_EXIT_CAUSED_BY_CALLER   : Delete list in CALLBACK_USER_COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ES_EXIT_CAUSED_BY_USER     : How the user left the list Tables &lt;/P&gt;&lt;P&gt;T_OUTTAB                                    : Table with data to be displayed ---mandatory &lt;/P&gt;&lt;P&gt;                                         &lt;/P&gt;&lt;P&gt; Example :&lt;/P&gt;&lt;P&gt; WS_REPNAME = SY-REPID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            I_PROGRAM_NAME     = WS_REPNAME&lt;/P&gt;&lt;P&gt;            I_INTERNAL_TABNAME = Internal output table field name&lt;/P&gt;&lt;P&gt;            I_INCLNAME         = WS_REPNAME&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            CT_FIELDCAT        = I_FIELDTAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_FIELDCATALOG_MERGE'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            I_CALLBACK_PROGRAM = WS_REPNAME&lt;/P&gt;&lt;P&gt;            I_STRUCTURE_NAME   = Internal output table field name&lt;/P&gt;&lt;P&gt;            IS_LAYOUT          = I_LAYOUT&lt;/P&gt;&lt;P&gt;            IT_FIELDCAT        = I_FIELDTAB&lt;/P&gt;&lt;P&gt;            I_DEFAULT          = 'A'&lt;/P&gt;&lt;P&gt;            I_SAVE             = 'A'&lt;/P&gt;&lt;P&gt;            IS_VARIANT         = 'X'&lt;/P&gt;&lt;P&gt;            IT_EVENTS          = I_EVENTS[]&lt;/P&gt;&lt;P&gt;		IT_SORT  		 = I_SORT&lt;/P&gt;&lt;P&gt;		IS_SEL_HIDE     	 = I_SELINFO&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            T_OUTTAB           = Internal output table field name.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.&lt;/P&gt;&lt;P&gt;  ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Popup information using ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_POPUP_TO_SELECT   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module for displaying or selecting&lt;/P&gt;&lt;P&gt; table entries in internal tables in a popup (single or&lt;/P&gt;&lt;P&gt; multiple selection is possible).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Principle:                                                                                &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Pass an internal table with the superset of information to be output&lt;/P&gt;&lt;P&gt;                                                                        &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Pass list layout detail flags                                                                                &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Pass a field catalog in the form of an internal table                                                                                &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The field catalog describes the fields to be output in the list.        &lt;/P&gt;&lt;P&gt;                         &lt;/P&gt;&lt;P&gt;Popup information using ALV&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;REPORT y_demo_alv_3.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_outtab OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE sflight.&lt;/P&gt;&lt;P&gt;DATA:   w_chk TYPE c.                  "For multiple selection&lt;/P&gt;&lt;P&gt;DATA: END OF i_outtab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: i_private TYPE slis_data_caller_exit,&lt;/P&gt;&lt;P&gt;      i_selfield TYPE slis_selfield,&lt;/P&gt;&lt;P&gt;      W_exit(1) TYPE c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PARAMETERS: p_title TYPE sy-title.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  SELECT * FROM sflight INTO TABLE i_outtab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_title                 = p_title&lt;/P&gt;&lt;P&gt;            i_selection             = 'X'&lt;/P&gt;&lt;P&gt;            i_zebra                 = 'X'&lt;/P&gt;&lt;P&gt;            i_checkbox_fieldname    = 'W_CHK'&lt;/P&gt;&lt;P&gt;            i_tabname               = 'I_OUTTAB'&lt;/P&gt;&lt;P&gt;            i_structure_name        = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;            es_selfield             = i_selfield&lt;/P&gt;&lt;P&gt;            e_exit                  = w_exit&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            t_outtab                = i_outtab&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            program_error           = 1&lt;/P&gt;&lt;P&gt;            OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;                         &lt;/P&gt;&lt;P&gt;Popup information using ALV&lt;/P&gt;&lt;P&gt;Example(Contd): &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 i000(0k) WITH sy-subrc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*****the internal table is modified with a cross sign for marking the&lt;/P&gt;&lt;P&gt;***rows selected&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  LOOP AT i_outtab WHERE w_chk = 'X'.&lt;/P&gt;&lt;P&gt;    WRITE: /  i_outtab-carrid, i_outtab-price.&lt;/P&gt;&lt;P&gt;  ENDLOOP.  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;                         &lt;/P&gt;&lt;P&gt;An Observation on ALV&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; If some of the icons in the GUI status of standard ALV interface needs to be&lt;/P&gt;&lt;P&gt; omitted or deleted, the STANDARD GUI status from the function group SALV&lt;/P&gt;&lt;P&gt; needs to be copied into own program and the likely or unlikely buttons needs&lt;/P&gt;&lt;P&gt; to be omitted or included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF I_RT_EXTAB OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE SLIS_T_EXTAB.&lt;/P&gt;&lt;P&gt;DATA : END OF I_RT_EXTAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;UMC' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;SUM' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;XPA' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;OMP' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'STANDARD' EXCLUDING I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;                          &lt;/P&gt;&lt;P&gt;Steps Summary&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      DATA DECLARATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      SELECTING THE VARIANTS FOR INITIAL LIST DISPLAY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      DEFINING OUTPUT CHARACTERISTICS: PREPARING&lt;/P&gt;&lt;P&gt;           DISPLAY  FIELDS CATALOG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      PREPARATION OF EVENT TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      LAYOUT BUILD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      SORT SEQUENCE BUILD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      DISPLAY OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am giving some links&lt;/P&gt;&lt;P&gt;                      &lt;A href="http://www.sapgenie.com/abap/reports.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/reports.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/material.html" target="test_blank"&gt;http://www.allsaplinks.com/material.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/reportinghome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/reportinghome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=58286" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=58286&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=76490" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=76490&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=20591" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=20591&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=66305" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=66305&lt;/A&gt; - this one discusses which way should you use - ABAP Objects calls or simple function modules.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reward points,if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;satish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Dec 2007 02:39:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-27T02:39:13Z</dc:date>
    <item>
      <title>ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211095#M765527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to ABAp and I haven't worked on ALV reports, so can you please explain me in detail what are ALV reports with some examples. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev ..........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 02:12:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211095#M765527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T02:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211096#M765528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;ALV is Application List viewer.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The commonly used ALV functions used for this purpose are;&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. REUSE_ALV_VARIANT_DEFAULT_GET &lt;/P&gt;&lt;P&gt;2. REUSE_ALV_VARIANT_F4 &lt;/P&gt;&lt;P&gt;3. REUSE_ALV_VARIANT_EXISTENCE &lt;/P&gt;&lt;P&gt;4. REUSE_ALV_EVENTS_GET &lt;/P&gt;&lt;P&gt;5. REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;6. REUSE_ALV_FIELDCATALOG_MERGE &lt;/P&gt;&lt;P&gt;7. REUSE_ALV_LIST_DISPLAY &lt;/P&gt;&lt;P&gt;8. REUSE_ALV_GRID_DISPLAY &lt;/P&gt;&lt;P&gt;9. REUSE_ALV_POPUP_TO_SELECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ALV Demo program&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;BCALV_DEMO_HTML &lt;/P&gt;&lt;P&gt;BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode &lt;/P&gt;&lt;P&gt;BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode &lt;/P&gt;&lt;P&gt;BCALV_GRID_DEMO Simple ALV Control Call Demo Program &lt;/P&gt;&lt;P&gt;BCALV_TREE_DEMO Demo for ALV tree control &lt;/P&gt;&lt;P&gt;BCALV_TREE_SIMPLE_DEMO &lt;/P&gt;&lt;P&gt;BC_ALV_DEMO_HTML_D0100 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/mpioud/Abap_programs.html" target="test_blank"&gt;http://www.geocities.com/mpioud/Abap_programs.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/reportinghome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/reportinghome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Simple ALV report&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/alvgrid.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/alvgrid.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox" target="test_blank"&gt;http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ALV&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Please give me general info on ALV.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=58286" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=58286&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=76490" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=76490&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=20591" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=20591&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=66305" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=66305&lt;/A&gt; - this one discusses which way should you use - ABAP Objects calls or simple function modules. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. How do I program double click in ALV?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=11601" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=11601&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=23010" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=23010&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3. How do I add subtotals (I have problem to add them)...&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=20386" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=20386&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=85191" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=85191&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=88401" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=88401&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=17335" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=17335&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4. How to add list heading like top-of-page in ABAP lists?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=58775" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=58775&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=60550" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=60550&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=16629" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=16629&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5. How to print page number / total number of pages X/XX in ALV?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=29597" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=29597&lt;/A&gt; (no direct solution) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;6. ALV printing problems&lt;/STRONG&gt;. The favourite is: The first page shows the number of records selected but I don't need this. &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=64320" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=64320&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=44477" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=44477&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;7. How can I set the cell color in ALV?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=52107" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=52107&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;8. How do I print a logo/graphics in ALV?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=81149" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=81149&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=35498" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=35498&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=5013" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=5013&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;9. How do I create and use input-enabled fields in ALV?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=84933" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=84933&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=69878" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=69878&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;10. How can I use ALV for reports that are going to be run in background?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=83243" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=83243&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=19224" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=19224&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;11. How can I display an icon in ALV? (Common requirement is traffic light icon).&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=79424" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=79424&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=24512" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=24512&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;12. How can I display a checkbox in ALV?&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=88376" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=88376&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=40968" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=40968&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=6919" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=6919&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Maha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 02:15:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211096#M765528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T02:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211097#M765529</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;ALV is nothing but we are doing the process of totals subtotal,calculations, layout designing these r do the process in normal reports it is to be late. so for that one sap created some predefined function modules for that one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;those function modules are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_GRID_DISPLAY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_POPUP_TO_SELECT&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;REUSE_ALV_VARIANT_EXISTENCE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_fieldcatalog_merge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_events_get&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP LIST VIEWER&lt;/P&gt;&lt;P&gt;Purpose &lt;/P&gt;&lt;P&gt;Commonly used ALV Function Modules&lt;/P&gt;&lt;P&gt;DEFINING OUTPUT CHARACTERISTICS:&lt;/P&gt;&lt;P&gt;PREPARING DISPLAY FIELDS CATALOG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A field catalog is prepared using the internal&lt;/P&gt;&lt;P&gt;table(I_FIELDCAT) of type SLIS_T_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Field catalog containing descriptions of the list&lt;/P&gt;&lt;P&gt;output fields (usually a subset of the internal output&lt;/P&gt;&lt;P&gt;table fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A field catalog is required for every ALV list output to add desired functionality (i.e. Key, hotspot,Specific headings, Justify, Col. Position etc) to certain fields of the output. If not mentioned specifically, then the defaults are taken. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the function module&lt;/P&gt;&lt;P&gt;    REUSE_ALV_FIELDCATALOG_MERGE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Example:  &lt;/P&gt;&lt;P&gt;Suppose I_PO_DETAILS is an internal table containing two fields&lt;/P&gt;&lt;P&gt;EBELN (PO number) and EBELP (PO item no). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR L_FIELDCAT.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-TABNAME   = 'I_PO_DETAILS'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-FIELDNAME = 'EBELN'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-KEY = 'X'.         &amp;#147;The PO no is made the key field, &lt;/P&gt;&lt;P&gt;				  &amp;#147;Colored and non scrollable&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  L_FIELDCAT-HOTSPOT = 'X'.     &amp;#147;The po no becomes a hotspot&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_S = &amp;#145;P.O No&amp;#146;.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_M = 'P order No'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_L = 'Purchase order No'.&lt;/P&gt;&lt;P&gt;  APPEND L_FIELDCAT TO I_FIELDTAB.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR L_FIELDCAT.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-TABNAME   = 'I_PO_DETAILS'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-FIELDNAME = 'EBELP'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-KEY = 'X'.         &amp;#147;The PO item no is made the key field, &lt;/P&gt;&lt;P&gt;				  &amp;#147;Colored and non scrollable&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_S = &amp;#145;Item No&amp;#146;.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_M = 'PO item No'.&lt;/P&gt;&lt;P&gt;  L_FIELDCAT-SELTEXT_L = 'Purchase order Item No'.&lt;/P&gt;&lt;P&gt;  APPEND L_FIELDCAT TO I_FIELDTAB.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Thus the catalog for the report output is prepared. &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	 The next step is to build an event table, which are used for&lt;/P&gt;&lt;P&gt;      firing both user commands and the system dependent             events i.e. top of  page, end of page etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A list of possible events is populated into an event table. When this table is passed to the function module&lt;/P&gt;&lt;P&gt;     REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The internal table only needs to be modified with the associated form names corresponding to each of the events.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	 The next step is to build an event table, which are used for&lt;/P&gt;&lt;P&gt;      firing both user commands and the system dependent             events i.e. top of  page, end of page etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	A list of possible events is populated into an event table. When this table is passed to the function module&lt;/P&gt;&lt;P&gt;     REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The internal table only needs to be modified with the associated form names corresponding to each of the events.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Example:   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: L_I_EVENT TYPE SLIS_ALV_EVENT.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;           I_LIST_TYPE = 0&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            ET_EVENTS   = I_EVENTS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE&lt;/P&gt;&lt;P&gt;                           INTO L_I_EVENT.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE FORMNAME_TOP_OF_PAGE TO L_I_EVENT-FORM.&lt;/P&gt;&lt;P&gt;    APPEND L_I_EVENT TO I_EVENTS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE&lt;/P&gt;&lt;P&gt;                           INTO L_I_EVENT.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE FORMNAME_END_OF_PAGE TO L_I_EVENT-FORM.&lt;/P&gt;&lt;P&gt;    APPEND L_I_EVENT TO I_EVENTS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CLEAR L_I_EVENT.&lt;/P&gt;&lt;P&gt;  READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND&lt;/P&gt;&lt;P&gt;                           INTO L_I_EVENT.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE FORMNAME_USER_COMMAND TO L_I_EVENT-FORM.&lt;/P&gt;&lt;P&gt;    APPEND L_I_EVENT TO I_EVENTS.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;The function module REUSE_ALV_COMMENTARY_WRITE can&lt;/P&gt;&lt;P&gt; be used to pass the headings for TOP OF PAGE event. Also,&lt;/P&gt;&lt;P&gt; any logo specific to the report can be passed to the function&lt;/P&gt;&lt;P&gt; module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Example:                                                 &lt;/P&gt;&lt;P&gt;   PERFORM comment_build USING i_list_top_of_page.                         &lt;/P&gt;&lt;P&gt;                            .&lt;/P&gt;&lt;P&gt;                            .&lt;/P&gt;&lt;P&gt;FORM comment_build USING l_top_of_page TYPE slis_t_listheader.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  DATA: ls_line TYPE slis_listheader.&lt;/P&gt;&lt;P&gt;  CLEAR ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'H'.&lt;/P&gt;&lt;P&gt;  ls_line-info = 'Heading list'.&lt;/P&gt;&lt;P&gt;  APPEND ls_line TO l_top_of_page.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CLEAR ls_line.&lt;/P&gt;&lt;P&gt;  ls_line-typ  = 'S'.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'Key 1'.&lt;/P&gt;&lt;P&gt;  ls_line-info = 'Information'.&lt;/P&gt;&lt;P&gt;  APPEND ls_line TO l_top_of_page.&lt;/P&gt;&lt;P&gt;  ls_line-key  = 'Key 2'.&lt;/P&gt;&lt;P&gt;  APPEND ls_line TO l_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;The next step is to build a layout report output list&lt;/P&gt;&lt;P&gt;description. &lt;/P&gt;&lt;P&gt;     The parameters are described under the following heads:&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Display options&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Exceptions&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Totals&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Interaction&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Detail screen&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Display variants (only for hierarchical-sequential lists)&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Color&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	         Other&lt;/P&gt;&lt;P&gt;       The layout table is of type slis_layout_alv_spec. &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;The next step is to sort the basic list with respect to&lt;/P&gt;&lt;P&gt; some of the fields in the list output. An internal&lt;/P&gt;&lt;P&gt; table needs to be declared according to the&lt;/P&gt;&lt;P&gt; structure slis_t_sortinfo_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure has got the following parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spos            :  Sort sequence&lt;/P&gt;&lt;P&gt;Fieldname   :  Internal output table field name&lt;/P&gt;&lt;P&gt;Tabname     : Only relevant for hierarchical-sequential lists. Name of the internal&lt;/P&gt;&lt;P&gt;                      output  table.&lt;/P&gt;&lt;P&gt; up               : 'X' = sort in ascending order&lt;/P&gt;&lt;P&gt; down          : 'X' = sort in descending order&lt;/P&gt;&lt;P&gt; subtot        : 'X' = subtotal at group value change&lt;/P&gt;&lt;P&gt; group         : '* ' = new page at group value change ,'UL' = underline at group value&lt;/P&gt;&lt;P&gt;                     change &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The final step in the output of the report is the use of&lt;/P&gt;&lt;P&gt; two ALV functions modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	REUSE_ALV_FIELDCATALOG_MERGE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import parameters  &lt;/P&gt;&lt;P&gt;     I_PROGRAM_NAME         : Program in which the internal output table is&lt;/P&gt;&lt;P&gt;                                                  declared and populated    &lt;/P&gt;&lt;P&gt;    I_INTERNAL_TABNAME   : Internal output table name &lt;/P&gt;&lt;P&gt;    I_STRUCTURE_NAME      : Structure name (structure, table, and view)&lt;/P&gt;&lt;P&gt;    I_CLIENT_NEVER_DISPL : Hide client fields default &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;    I_INCLNAME                      : Data declarations include name &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CHANGING parameter &lt;/P&gt;&lt;P&gt;CT_FIELDCAT                       : Field catalog with field descriptions &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;    The final function module for displaying the output according to the catalog, event build, sort sequence, layout and comment build are either &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     REUSE_ALV_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       OR&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;     REUSE_ALV_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;     REUSE_ALV_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I_INTERFACE_CHECK 		: Interface consistency check log output.&lt;/P&gt;&lt;P&gt;I_CALLBACK_PROGRAM		: Name of the calling program&lt;/P&gt;&lt;P&gt;I_CALLBACK_PF_STATUS_SET	: Set EXIT routine to status.    &lt;/P&gt;&lt;P&gt;I_CALLBACK_USER_COMMAND	: EXIT routine for command handling&lt;/P&gt;&lt;P&gt;I_STRUCTURE_NAME		: Internal output table structure name      &lt;/P&gt;&lt;P&gt;IS_LAYOUT 			: List layout specifications  &lt;/P&gt;&lt;P&gt;IT_FIELDCAT		: Field catalog with field descriptions &lt;/P&gt;&lt;P&gt;IT_EXCLUDING		: Table of inactive function codes    &lt;/P&gt;&lt;P&gt;IT_SPECIAL_GROUPS		: Grouping fields for column selection&lt;/P&gt;&lt;P&gt;IT_SORT			: Sort criteria for first list display&lt;/P&gt;&lt;P&gt;IT_FILTER			: Filter criteria for first list output&lt;/P&gt;&lt;P&gt;IS_SEL_HIDE		: Selection information modification&lt;/P&gt;&lt;P&gt;I_DEFAULT			: Initial variant active/inactive logic&lt;/P&gt;&lt;P&gt;I_SAVE			: Variants can be saved&lt;/P&gt;&lt;P&gt;IS_VARIANT			: Variant information&lt;/P&gt;&lt;P&gt;IT_EVENTS			: Table of events to perform &lt;/P&gt;&lt;P&gt;IT_EVENT_EXIT		:  Standard fcode exit requests table  &lt;/P&gt;&lt;P&gt;IS_PRINT			: Print information&lt;/P&gt;&lt;P&gt;IS_REPREP_ID		: Initialization keys for Re/Re interface &lt;/P&gt;&lt;P&gt;I_SCREEN_START_COLUMN	: Coordinates for list in dialog box 	&lt;/P&gt;&lt;P&gt;I_SCREEN_START_LINE		: Coordinates for list in dialog box&lt;/P&gt;&lt;P&gt;I_SCREEN_END_COLUMN	: Coordinates for list in dialog box &lt;/P&gt;&lt;P&gt;                                         &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Export parameters&lt;/P&gt;&lt;P&gt;E_EXIT_CAUSED_BY_CALLER   : Delete list in CALLBACK_USER_COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ES_EXIT_CAUSED_BY_USER     : How the user left the list Tables &lt;/P&gt;&lt;P&gt;T_OUTTAB                                    : Table with data to be displayed ---mandatory &lt;/P&gt;&lt;P&gt;                                         &lt;/P&gt;&lt;P&gt; Example :&lt;/P&gt;&lt;P&gt; WS_REPNAME = SY-REPID. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            I_PROGRAM_NAME     = WS_REPNAME&lt;/P&gt;&lt;P&gt;            I_INTERNAL_TABNAME = Internal output table field name&lt;/P&gt;&lt;P&gt;            I_INCLNAME         = WS_REPNAME&lt;/P&gt;&lt;P&gt;       CHANGING&lt;/P&gt;&lt;P&gt;            CT_FIELDCAT        = I_FIELDTAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_FIELDCATALOG_MERGE'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            I_CALLBACK_PROGRAM = WS_REPNAME&lt;/P&gt;&lt;P&gt;            I_STRUCTURE_NAME   = Internal output table field name&lt;/P&gt;&lt;P&gt;            IS_LAYOUT          = I_LAYOUT&lt;/P&gt;&lt;P&gt;            IT_FIELDCAT        = I_FIELDTAB&lt;/P&gt;&lt;P&gt;            I_DEFAULT          = 'A'&lt;/P&gt;&lt;P&gt;            I_SAVE             = 'A'&lt;/P&gt;&lt;P&gt;            IS_VARIANT         = 'X'&lt;/P&gt;&lt;P&gt;            IT_EVENTS          = I_EVENTS[]&lt;/P&gt;&lt;P&gt;		IT_SORT  		 = I_SORT&lt;/P&gt;&lt;P&gt;		IS_SEL_HIDE     	 = I_SELINFO&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            T_OUTTAB           = Internal output table field name.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    WRITE: 'SY-SUBRC: ', SY-SUBRC, 'REUSE_ALV_LIST_DISPLAY'.&lt;/P&gt;&lt;P&gt;  ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;Popup information using ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_POPUP_TO_SELECT   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module for displaying or selecting&lt;/P&gt;&lt;P&gt; table entries in internal tables in a popup (single or&lt;/P&gt;&lt;P&gt; multiple selection is possible).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Principle:                                                                                &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Pass an internal table with the superset of information to be output&lt;/P&gt;&lt;P&gt;                                                                        &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Pass list layout detail flags                                                                                &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	Pass a field catalog in the form of an internal table                                                                                &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	The field catalog describes the fields to be output in the list.        &lt;/P&gt;&lt;P&gt;                         &lt;/P&gt;&lt;P&gt;Popup information using ALV&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;REPORT y_demo_alv_3.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF i_outtab OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE sflight.&lt;/P&gt;&lt;P&gt;DATA:   w_chk TYPE c.                  "For multiple selection&lt;/P&gt;&lt;P&gt;DATA: END OF i_outtab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: i_private TYPE slis_data_caller_exit,&lt;/P&gt;&lt;P&gt;      i_selfield TYPE slis_selfield,&lt;/P&gt;&lt;P&gt;      W_exit(1) TYPE c.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;PARAMETERS: p_title TYPE sy-title.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  SELECT * FROM sflight INTO TABLE i_outtab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            i_title                 = p_title&lt;/P&gt;&lt;P&gt;            i_selection             = 'X'&lt;/P&gt;&lt;P&gt;            i_zebra                 = 'X'&lt;/P&gt;&lt;P&gt;            i_checkbox_fieldname    = 'W_CHK'&lt;/P&gt;&lt;P&gt;            i_tabname               = 'I_OUTTAB'&lt;/P&gt;&lt;P&gt;            i_structure_name        = 'SFLIGHT'&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;            es_selfield             = i_selfield&lt;/P&gt;&lt;P&gt;            e_exit                  = w_exit&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            t_outtab                = i_outtab&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            program_error           = 1&lt;/P&gt;&lt;P&gt;            OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;                         &lt;/P&gt;&lt;P&gt;Popup information using ALV&lt;/P&gt;&lt;P&gt;Example(Contd): &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 i000(0k) WITH sy-subrc.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*****the internal table is modified with a cross sign for marking the&lt;/P&gt;&lt;P&gt;***rows selected&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  LOOP AT i_outtab WHERE w_chk = 'X'.&lt;/P&gt;&lt;P&gt;    WRITE: /  i_outtab-carrid, i_outtab-price.&lt;/P&gt;&lt;P&gt;  ENDLOOP.  &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;                         &lt;/P&gt;&lt;P&gt;An Observation on ALV&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; If some of the icons in the GUI status of standard ALV interface needs to be&lt;/P&gt;&lt;P&gt; omitted or deleted, the STANDARD GUI status from the function group SALV&lt;/P&gt;&lt;P&gt; needs to be copied into own program and the likely or unlikely buttons needs&lt;/P&gt;&lt;P&gt; to be omitted or included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF I_RT_EXTAB OCCURS 0.&lt;/P&gt;&lt;P&gt;        INCLUDE STRUCTURE SLIS_T_EXTAB.&lt;/P&gt;&lt;P&gt;DATA : END OF I_RT_EXTAB.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;UMC' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;SUM' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;XPA' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;APPEND '&amp;amp;OMP' TO I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;SET PF-STATUS 'STANDARD' EXCLUDING I_RT_EXTAB.&lt;/P&gt;&lt;P&gt;                          &lt;/P&gt;&lt;P&gt;Steps Summary&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      DATA DECLARATION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      SELECTING THE VARIANTS FOR INITIAL LIST DISPLAY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      DEFINING OUTPUT CHARACTERISTICS: PREPARING&lt;/P&gt;&lt;P&gt;           DISPLAY  FIELDS CATALOG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      PREPARATION OF EVENT TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      LAYOUT BUILD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      SORT SEQUENCE BUILD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61548;	      DISPLAY OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am giving some links&lt;/P&gt;&lt;P&gt;                      &lt;A href="http://www.sapgenie.com/abap/reports.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/reports.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/material.html" target="test_blank"&gt;http://www.allsaplinks.com/material.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/reportinghome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/reportinghome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=58286" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=58286&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=76490" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=76490&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=20591" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=20591&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapfans.com/forums/viewtopic.php?t=66305" target="test_blank"&gt;http://www.sapfans.com/forums/viewtopic.php?t=66305&lt;/A&gt; - this one discusses which way should you use - ABAP Objects calls or simple function modules.&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please reward points,if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;satish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 02:39:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211097#M765529</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T02:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211098#M765530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gupta,&lt;/P&gt;&lt;P&gt;i prepared some slides on ALV reports.&lt;/P&gt;&lt;P&gt;if u want gv me ur mailid i can send.&lt;/P&gt;&lt;P&gt;Later i can send some simple examples on each type of ALV reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;chandu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 03:32:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211098#M765530</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T03:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211099#M765531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Chandu.....&lt;/P&gt;&lt;P&gt;my email id is rjv_gupta@yahoo.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Rajat Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 05:47:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211099#M765531</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T05:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: ALV Report</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211100#M765532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rajeev,&lt;/P&gt;&lt;P&gt;The brief notes below can give u an basic idea of what is ALV..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What is ALV programming in ABAP? When is this grid used in ABAP?&lt;/STRONG&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALV is &lt;EM&gt;Application List viewer.&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The report output can contain up to 90 columns in the display with the wide array of display options. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The commonly used ALV functions used for this purpose are; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. REUSE_ALV_VARIANT_DEFAULT_GET &lt;/P&gt;&lt;P&gt;2. REUSE_ALV_VARIANT_F4 &lt;/P&gt;&lt;P&gt;3. REUSE_ALV_VARIANT_EXISTENCE &lt;/P&gt;&lt;P&gt;4. REUSE_ALV_EVENTS_GET &lt;/P&gt;&lt;P&gt;5. REUSE_ALV_COMMENTARY_WRITE &lt;/P&gt;&lt;P&gt;6. REUSE_ALV_FIELDCATALOG_MERGE &lt;/P&gt;&lt;P&gt;7. REUSE_ALV_LIST_DISPLAY &lt;/P&gt;&lt;P&gt;8. REUSE_ALV_GRID_DISPLAY &lt;/P&gt;&lt;P&gt;9. REUSE_ALV_POPUP_TO_SELECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Purpose of the above Functions are differ not all the functions are required in all the ALV Report.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But either no.7 or No.8 is there in the Program.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;How you call this function in your report?&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use follwing function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' &lt;/P&gt;&lt;P&gt;       EXPORTING &lt;/P&gt;&lt;P&gt;            I_CALLBACK_PROGRAM       = 'Prog.name' &lt;/P&gt;&lt;P&gt;            I_STRUCTURE_NAME         = 'I_ITAB' &lt;/P&gt;&lt;P&gt;            I_DEFAULT                = 'X' &lt;/P&gt;&lt;P&gt;            I_SAVE                   = 'A' &lt;/P&gt;&lt;P&gt;       TABLES &lt;/P&gt;&lt;P&gt;            T_OUTTAB                 = I_ITAB. &lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;    WRITE: 'SY-SUBRC: ', SY-SUBRC . &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;ENDFORM.                    " GET_FINAL_DATA &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Reward if helpful.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2007 05:55:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-report/m-p/3211100#M765532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-27T05:55:47Z</dc:date>
    </item>
  </channel>
</rss>

