<?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 alv in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264288#M780033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we write a write statement in alv's? if yes, how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jan 2008 14:05:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-17T14:05:57Z</dc:date>
    <item>
      <title>alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264288#M780033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can we write a write statement in alv's? if yes, how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2008 14:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264288#M780033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-17T14:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264289#M780034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sir,&lt;/P&gt;&lt;P&gt;please look through these sites for info.&lt;/P&gt;&lt;P&gt;&lt;A href="http://sapr3.tripod.com/sapalv.htm" target="test_blank"&gt;http://sapr3.tripod.com/sapalv.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.antarcon.com/download.php?op=viewdownloaddetails&amp;amp;lid=19&amp;amp;ttitle=prepost%20document%20list%20displayed%20with%20ALV" target="test_blank"&gt;http://www.antarcon.com/download.php?op=viewdownloaddetails&amp;amp;lid=19&amp;amp;ttitle=prepost%20document%20list%20displayed%20with%20ALV&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.henrikfrank.dk/abapexamples/ABAP%20objects%20and%20controls/alvgrid_control.htm" target="test_blank"&gt;http://www.henrikfrank.dk/abapexamples/ABAP%20objects%20and%20controls/alvgrid_control.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/victorav15/sapr3/utilities/zvvooa_alv1.txt" target="test_blank"&gt;http://www.geocities.com/victorav15/sapr3/utilities/zvvooa_alv1.txt&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;award points if found helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 03:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264289#M780034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T03:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264290#M780035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kaladhar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP List Viewer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV). &lt;/P&gt;&lt;P&gt;This helps us to implement all the features mentioned very effectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using ALV, We can have three types of reports:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Simple Report&lt;/P&gt;&lt;P&gt;2. Block Report&lt;/P&gt;&lt;P&gt;3. Hierarchical Sequential Report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are some function modules which will enable to produce the above reports without much effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. SIMPLE REPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The important function modules are &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a. Reuse_alv_list_display&lt;/P&gt;&lt;P&gt;b. Reuse_alv_fieldcatalog_merge&lt;/P&gt;&lt;P&gt;c. Reuse_alv_events_get&lt;/P&gt;&lt;P&gt;d. Reuse_alv_commentary_write&lt;/P&gt;&lt;P&gt;e. Reuse_alv_grid_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;A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The important parameters are :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I. Export :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i. I_callback_program : report id&lt;/P&gt;&lt;P&gt;ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status&lt;/P&gt;&lt;P&gt;iii. I_callback_user_command : routine where the function codes are handled&lt;/P&gt;&lt;P&gt;iv. I_structure name : name of the dictionary table &lt;/P&gt;&lt;P&gt;v. Is_layout : structure to set the layout of the report&lt;/P&gt;&lt;P&gt;vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE&lt;/P&gt;&lt;P&gt;vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;II. Tables :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i. t_outtab : internal table with the data to be output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Important Parameters are :&lt;/P&gt;&lt;P&gt;I. Export :&lt;/P&gt;&lt;P&gt;i. I_program_name : report id&lt;/P&gt;&lt;P&gt;ii. I_internal_tabname : the internal output table&lt;/P&gt;&lt;P&gt;iii. I_inclname : include or the report name where all the dynamic forms are handled.&lt;/P&gt;&lt;P&gt;II Changing&lt;/P&gt;&lt;P&gt;ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is &lt;/P&gt;&lt;P&gt;declared in the type pool SLIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : &lt;/P&gt;&lt;P&gt;I. Import :&lt;/P&gt;&lt;P&gt;Et_Events : The event table is returned with all possible CALLBACK events &lt;/P&gt;&lt;P&gt;for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV. &lt;/P&gt;&lt;P&gt;II. Export :&lt;/P&gt;&lt;P&gt;I_List_type : &lt;/P&gt;&lt;P&gt;0 = simple list REUSE_ALV_LIST_DISPLAY &lt;/P&gt;&lt;P&gt;1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY &lt;/P&gt;&lt;P&gt;2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND &lt;/P&gt;&lt;P&gt;3 = hierarchical-sequential block list &lt;/P&gt;&lt;P&gt;REUSE_ALV_BLOCK_LIST_HS_APPEND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I. it_list_commentary : internal table with the headings of the type slis_t_listheader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This internal table has three fields :&lt;/P&gt;&lt;P&gt;Typ : &amp;#145;H&amp;#146; &amp;#150; header, &amp;#145;S&amp;#146; &amp;#150; selection , &amp;#145;A&amp;#146; - action&lt;/P&gt;&lt;P&gt;Key : only when typ is &amp;#145;S&amp;#146;.&lt;/P&gt;&lt;P&gt;Info : the text to be printed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : same as 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;This is an example for simple list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. BLOCK REPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is used to have multiple lists continuously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The important functions used in this report are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A. REUSE_ALV_BLOCK_LIST_INIT&lt;/P&gt;&lt;P&gt;B. REUSE_ALV_BLOCK_LIST_APPEND&lt;/P&gt;&lt;P&gt;C. REUSE_ALV_BLOCK_LIST_HS_APPEND&lt;/P&gt;&lt;P&gt;D. REUSE_ALV_BLOCK_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;A. REUSE_ALV_BLOCK_LIST_INIT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters: &lt;/P&gt;&lt;P&gt;I. I_CALLBACK_PROGRAM &lt;/P&gt;&lt;P&gt;II. I_CALLBACK_PF_STATUS_SET &lt;/P&gt;&lt;P&gt;III. I_CALLBACK_USER_COMMAND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module is used to set the default gui status etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B. REUSE_ALV_BLOCK_LIST_APPEND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Export : &lt;/P&gt;&lt;P&gt;I. is_layout : layout settings for block &lt;/P&gt;&lt;P&gt;II. it_fieldcat : field catalog &lt;/P&gt;&lt;P&gt;III. i_tabname : internal table name with output data &lt;/P&gt;&lt;P&gt;IV. it_events : internal table with all possible events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables :&lt;/P&gt;&lt;P&gt;i. t_outtab : internal table with output data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module adds the data to the block. &lt;/P&gt;&lt;P&gt;Repeat this function for all the different blocks to be displayed one after the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C. REUSE_ALV_BLOCK_LIST_HS_APPEND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module is used for hierarchical sequential blocks. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;D. REUSE_ALV_BLOCK_LIST_DISPLAY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters : All the parameters are optional. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module display the list with data appended by the above function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Hierarchical reports : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hierarchical sequential list output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function module is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A. REUSE_ALV_HIERSEQ_LIST_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parameters: &lt;/P&gt;&lt;P&gt;I. Export: &lt;/P&gt;&lt;P&gt;i. I_CALLBACK_PROGRAM &lt;/P&gt;&lt;P&gt;ii. I_CALLBACK_PF_STATUS_SET &lt;/P&gt;&lt;P&gt;iii. I_CALLBACK_USER_COMMAND &lt;/P&gt;&lt;P&gt;iv. IS_LAYOUT &lt;/P&gt;&lt;P&gt;v. IT_FIELDCAT &lt;/P&gt;&lt;P&gt;vi. IT_EVENTS &lt;/P&gt;&lt;P&gt;vii. i_tabname_header : Name of the internal table in the program containing the &lt;/P&gt;&lt;P&gt;output data of the highest hierarchy level.&lt;/P&gt;&lt;P&gt;viii. i_tabname_item : Name of the internal table in the program containing the &lt;/P&gt;&lt;P&gt;output data of the lowest hierarchy level.&lt;/P&gt;&lt;P&gt;ix. is_keyinfo : This structure contains the header and item table field &lt;/P&gt;&lt;P&gt;names which link the two tables (shared key). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;II. Tables&lt;/P&gt;&lt;P&gt;i. t_outtab_header : Header table with data to be output&lt;/P&gt;&lt;P&gt;ii. t_outtab_item : Name of the internal table in the program containing the &lt;/P&gt;&lt;P&gt;output data of the lowest hierarchy level. &lt;/P&gt;&lt;P&gt;slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using &amp;#145;REUSE_ALV_FIELDCATALOG_MERGE&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important Attributes :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A. col_pos : position of the column&lt;/P&gt;&lt;P&gt;B. fieldname : internal fieldname&lt;/P&gt;&lt;P&gt;C. tabname : internal table name&lt;/P&gt;&lt;P&gt;D. ref_fieldname : fieldname (dictionary)&lt;/P&gt;&lt;P&gt;E. ref_tabname : table (dictionary)&lt;/P&gt;&lt;P&gt;F. key(1) : column with key-color&lt;/P&gt;&lt;P&gt;G. icon(1) : icon&lt;/P&gt;&lt;P&gt;H. symbol(1) : symbol&lt;/P&gt;&lt;P&gt;I. checkbox(1) : checkbox&lt;/P&gt;&lt;P&gt;J. just(1) : (R)ight (L)eft (C)ent.&lt;/P&gt;&lt;P&gt;K. do_sum(1) : sum up&lt;/P&gt;&lt;P&gt;L. no_out(1) : (O)blig.(X)no out&lt;/P&gt;&lt;P&gt;M. outputlen : output length&lt;/P&gt;&lt;P&gt;N. seltext_l : long key word&lt;/P&gt;&lt;P&gt;O. seltext_m : middle key word&lt;/P&gt;&lt;P&gt;P. seltext_s : short key word&lt;/P&gt;&lt;P&gt;Q. reptext_ddic : heading (ddic)&lt;/P&gt;&lt;P&gt;R. ddictxt(1) : (S)hort (M)iddle (L)ong&lt;/P&gt;&lt;P&gt;S. datatype : datatype&lt;/P&gt;&lt;P&gt;T. hotspot(1) : hotspot &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;P&gt;hema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 03:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264290#M780035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T03:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264291#M780036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We can write the write statement, but this data displays in only LPS not in Grid display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 05:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264291#M780036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T05:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264292#M780037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kaladar,&lt;/P&gt;&lt;P&gt;               It is possible to use &lt;STRONG&gt;WRITE&lt;/STRONG&gt; statemnt in alv's.But we can use write statements for &lt;STRONG&gt;HEADING&lt;/STRONG&gt; and printing &lt;STRONG&gt;FOOTER&lt;/STRONG&gt; information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward points if helpful.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt; Kiran Kumar.G.A&lt;/P&gt;&lt;P&gt;        &lt;EM&gt;Have a Nice Day..&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 08:42:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264292#M780037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T08:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: alv</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264293#M780038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pls go thru this brief docu, hope this will helpfull for u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FU REUSE_ALV_COMMENTARY_WRITE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;____________________________________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short Text&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List body comment block output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List header information is output according to its type. The output&lt;/P&gt;&lt;P&gt;information is put in an internal table. Output attributes are assigned&lt;/P&gt;&lt;P&gt;to each line via the TYP field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This module outputs formatted simple header information at TOP-OF-PAGE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp; Report ZALVLOGO&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZALVLOGO.&lt;/P&gt;&lt;P&gt;TYPE-POOLS : slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV Formatting tables /structures&lt;/P&gt;&lt;P&gt;DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.&lt;/P&gt;&lt;P&gt;DATA: gt_events TYPE slis_t_event.&lt;/P&gt;&lt;P&gt;DATA: gs_layout TYPE slis_layout_alv.&lt;/P&gt;&lt;P&gt;DATA: gt_page TYPE slis_t_listheader.&lt;/P&gt;&lt;P&gt;DATA: gs_page TYPE slis_listheader.&lt;/P&gt;&lt;P&gt;DATA: v_repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*ALV Formatting work area&lt;/P&gt;&lt;P&gt;DATA: w_fieldcat TYPE slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;DATA: w_events TYPE slis_alv_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gt_bsid TYPE TABLE OF bsid WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM build_events.&lt;/P&gt;&lt;P&gt;PERFORM build_page_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*perform build_comment. "top_of_page - in initialization at present&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM bsid INTO TABLE gt_bsid UP TO 10 ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.&lt;/P&gt;&lt;P&gt;*USING = Row, Column, Field name, display length, table name, heading&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*OR&lt;/P&gt;&lt;P&gt;PERFORM build_fieldcat.&lt;/P&gt;&lt;P&gt;gs_layout-zebra = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*top of page event does not work without I_callback_program&lt;/P&gt;&lt;P&gt;v_repid = sy-repid.&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 = v_repid&lt;/P&gt;&lt;P&gt;i_structure_name = 'BSID'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_background_id = 'ALV_BACKGROUND' &lt;/P&gt;&lt;P&gt;i_grid_title = 'This is the grid title'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I_GRID_SETTINGS = &lt;/P&gt;&lt;P&gt;is_layout = gs_layout&lt;/P&gt;&lt;P&gt;it_fieldcat = gt_fieldcat[]&lt;/P&gt;&lt;P&gt;it_events = gt_events[]&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;t_outtab = gt_bsid.&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;Form..............: populate_for_fm &lt;/P&gt;&lt;P&gt;Description.......: Populates fields for function module used in ALV &lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM populate_for_fm USING p_row&lt;/P&gt;&lt;P&gt;p_col&lt;/P&gt;&lt;P&gt;p_fieldname&lt;/P&gt;&lt;P&gt;p_len&lt;/P&gt;&lt;P&gt;p_table&lt;/P&gt;&lt;P&gt;p_desc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_fieldcat-row_pos = p_row. "Row Position&lt;/P&gt;&lt;P&gt;w_fieldcat-col_pos = p_col. "Column Position&lt;/P&gt;&lt;P&gt;w_fieldcat-fieldname = p_fieldname. "Field name&lt;/P&gt;&lt;P&gt;w_fieldcat-outputlen = p_len. "Column Lenth&lt;/P&gt;&lt;P&gt;w_fieldcat-tabname = p_table. "Table name&lt;/P&gt;&lt;P&gt;w_fieldcat-reptext_ddic = p_desc. "Field Description&lt;/P&gt;&lt;P&gt;w_fieldcat-input = '1'.&lt;/P&gt;&lt;P&gt;APPEND w_fieldcat TO gt_fieldcat.&lt;/P&gt;&lt;P&gt;CLEAR w_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " populate_for_fm&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form build_events&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_events.&lt;/P&gt;&lt;P&gt;DATA: ls_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 = gt_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE gt_events&lt;/P&gt;&lt;P&gt;WITH KEY name = slis_ev_user_command&lt;/P&gt;&lt;P&gt;INTO ls_event.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MOVE slis_ev_user_command TO ls_event-form.&lt;/P&gt;&lt;P&gt;APPEND ls_event TO gt_events.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;READ TABLE gt_events&lt;/P&gt;&lt;P&gt;WITH KEY name = slis_ev_top_of_page&lt;/P&gt;&lt;P&gt;INTO ls_event.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;MOVE slis_ev_top_of_page TO ls_event-form.&lt;/P&gt;&lt;P&gt;APPEND ls_event TO gt_events.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " build_events&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form USER_COMMAND&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When user command is called it uses 2 parameters. The itab &lt;/P&gt;&lt;P&gt;passed to the ALV is in whatever order it currently is on screen. &lt;/P&gt;&lt;P&gt;Therefore, you can read table itab index rs_selfield-tabindex to get &lt;/P&gt;&lt;P&gt;all data from the table. You can also check r_ucomm and code &lt;/P&gt;&lt;P&gt;accordingly. &lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING r_ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;rs_selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE gt_bsid INDEX rs_selfield-tabindex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;error checking etc. &lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'KUN' FIELD gt_bsid-kunnr.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;ENDFORM. "user_command&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form top_of_page&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your own company logo can go here if it has been saved (OAOR) &lt;/P&gt;&lt;P&gt;If the logo is larger than the size of the headings in gt_page, &lt;/P&gt;&lt;P&gt;the window will not show full logo and will have a scroll bar. Thus, &lt;/P&gt;&lt;P&gt;it is a good idea to have a standard ALV header if you are going to &lt;/P&gt;&lt;P&gt;use logos in your top of page. &lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;it_list_commentary = gt_page&lt;/P&gt;&lt;P&gt;i_logo = 'ENJOYSAP_LOGO'.&lt;/P&gt;&lt;P&gt;ENDFORM. "top_of_page&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form build_fieldcat&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Many and varied fields are available here. Have a look at documentation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*for FM REUSE_ALV_LIST_DISPLAY and 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;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_fieldcat.&lt;/P&gt;&lt;P&gt;w_fieldcat-fieldname = 'BUDAT'.&lt;/P&gt;&lt;P&gt;w_fieldcat-seltext_m = 'Dte pst'.&lt;/P&gt;&lt;P&gt;w_fieldcat-ddictxt(1) = 'M'.&lt;/P&gt;&lt;P&gt;w_fieldcat-edit = 'x'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can change the position of fields if you do not want them in order &lt;/P&gt;&lt;P&gt;of the DDIC or itab &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_fieldcat-row_pos = '1'. &lt;/P&gt;&lt;P&gt;w_fieldcat-col_pos = '10'. &lt;/P&gt;&lt;P&gt;APPEND w_fieldcat TO gt_fieldcat.&lt;/P&gt;&lt;P&gt;CLEAR w_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " build_fieldcat&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form build_page_header&lt;/P&gt;&lt;P&gt;&amp;amp;----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gt_page is used in top of page (ALV subroutine - NOT event) &lt;/P&gt;&lt;P&gt;*H = Header, S = Selection, A = Action&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM build_page_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Headers, Key is not printed and is irrelevant. Will not cause &lt;/P&gt;&lt;P&gt;a syntax error, but is not used. &lt;/P&gt;&lt;P&gt;gs_page-typ = 'H'.&lt;/P&gt;&lt;P&gt;gs_page-info = 'Header 1'.&lt;/P&gt;&lt;P&gt;APPEND gs_page TO gt_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gs_page-typ = 'H'.&lt;/P&gt;&lt;P&gt;gs_page-info = 'Header 2'.&lt;/P&gt;&lt;P&gt;APPEND gs_page TO gt_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Selections, the Key is printed (bold). It can be anything up to 20 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bytes. It gets printed in order of code here, not by key value. &lt;/P&gt;&lt;P&gt;gs_page-typ = 'S'.&lt;/P&gt;&lt;P&gt;gs_page-key = 'And the winner is:'.&lt;/P&gt;&lt;P&gt;gs_page-info = 'Selection 1'.&lt;/P&gt;&lt;P&gt;APPEND gs_page TO gt_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gs_page-typ = 'S'.&lt;/P&gt;&lt;P&gt;gs_page-key = 'Runner up:'.&lt;/P&gt;&lt;P&gt;gs_page-info = 'Selection 2'.&lt;/P&gt;&lt;P&gt;APPEND gs_page TO gt_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For Action, Key is also irrelevant. &lt;/P&gt;&lt;P&gt;gs_page-typ = 'A'.&lt;/P&gt;&lt;P&gt;gs_page-info = 'Action goes here'.&lt;/P&gt;&lt;P&gt;APPEND gs_page TO gt_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " build_page_header&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2008 08:46:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv/m-p/3264293#M780038</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-18T08:46:38Z</dc:date>
    </item>
  </channel>
</rss>

