<?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: Regarding  ALV Grid  Control using OOPs concepts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499081#M564563</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i wld  like to  thank you first for sharing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in my alv grid  , i need these functionalities, let  me  knw how  can i do get them...., pls  can u provide the  code  if at all u can...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;If Insert Row button of Screen 1000/1001 was clicked:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    If the Insert Row button was clicked the ALV grid is displayed to the user but with no content. But the ALV grid is constructed to have the same structure of the corresponding Z table following the respective transaction as mentioned above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;If Maintain Entries button of Screen 1000/1001 was clicked:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	If the Maintain Entries Button was clicked, then the ALV grid is displayed with the database entries based on the Selection Criteria for the Z tables. These are also loaded into the internal table IT_TAB_ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; There are various options provided in the Screen 1002 to facilitate the user to maintain the Z tables.&lt;/P&gt;&lt;P&gt;They are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Insert row:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserts a row in the ALV grid. The row index of the row that has been inserted is loaded into the internal table IT_TAB_ROW_INDEX. When a row is inserted, all the entries are blank except the Costing Version. This entry is internally filled by the program using the value Z_GL_ALLOC_PLAN_VERSN from the TVARVC table and this field is set as disabled in the ALV grid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Select All&amp;lt;/u&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select All button when clicked selects all the rows that have been displayed in the ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Deselect All:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deselect All button when clicked deselects all the rows that have been selected previously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Save:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) When the save button is clicked the user is prompted with the confirmation to save the data.&lt;/P&gt;&lt;P&gt;2) If the user agrees to save the data then the rows then the changes are updated to the database. This can be identified by the rows that have been selected for change mode (on which the lock icon is present). The lock icons will be removed, the changes will be reflected in the database and the rows are displayed in the display mode. The internal table IT_TAB_ROW_INDEX is looped to fetch the row index and then the row details are fetched from the ALV grid. These row details are loaded into the internal table IT_TAB_ROWS. If the row already exists in the internal table then the row is modified, and the field CHANGED is marked as &amp;#145;X&amp;#146;. If the entry does not exist, then a new row is inserted into the internal table IT_TAB_ROWS and the INSERTED field is marked as &amp;#145;X&amp;#146;. Now the internal table IT_TAB_ROWS is looped to select the rows with CHANGED field as marked. These rows are inserted into the Z table, and the rows with INSERTED &amp;#145;X&amp;#146; is selected and they are inserted into the Z table.&lt;/P&gt;&lt;P&gt;3)  If the user rejects the save option then, discard the changes made, remove the lock icons and display the rows in display mode.&lt;/P&gt;&lt;P&gt;4) The rows which are newly inserted are also saved to the database after validating them with the database entries.&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;#61656;&amp;lt;u&amp;gt;Change/Display:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Change:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)When row/rows are selected and Change option is clicked then, locking is applied for the particular row/rows in the Z table.&lt;/P&gt;&lt;P&gt;2)If the locking succeeds, a lock icon appears near the row/rows and the Savings% fields of the row/rows are activated in change mode. The row indexes of the rows are stored in the internal table IT_TAB_ROW_INDEX.&lt;/P&gt;&lt;P&gt;3)If the locking fails for the row then, a message is displayed in the Status bar stating &amp;#147;Locking failed for the row(s) selected&amp;#148; and the row/ rows selected are in display mode only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Display:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)When row/rows are selected and the Display option is clicked then, the user is prompted for a Save of the data. &lt;/P&gt;&lt;P&gt;2)If the user, confirms the Save, then the changes are accepted, the lock icons are removed from the row/rows and the row/rows are activated in display mode with the updated data. Follow the same logic used in the Save button.&lt;/P&gt;&lt;P&gt;3)If the user rejects the Save, then the changes are discarded, the lock icons are removed and the row/rows are activated in display mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Delete:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;When the row/rows selected needs to be deleted, then the Delete button is clicked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the delete button is clicked, user is given a pop up which says that locking has been applied to the row/rows and he/she needs to click the delete button again to delete the records. A lock icon appears near the row/rows for which locking was successful. These row/rows will be selected. The indexes of the row/rows are loaded into the internal table IT_TAB_ROW_INDEX. When the user clicks the delete button again, the rows for which the lock icon appeared will be deleted. This is done by loading the indexes of the row/rows into the internal table IT_TAB_ROW_INDEX. The internal table is looped and the row details are fetched from the ALV grid. For this row in the internal table IT_TAB_ROWS the DELETED field is marked as &amp;#145;X&amp;#146;. The records which has &amp;#145;X&amp;#146; marked in DELETED field are selected and they are deleted from the Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Sort:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;Selecting the column and clicking the sort button will enable the data to be sorted based on the column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 14:27:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T14:27:32Z</dc:date>
    <item>
      <title>Regarding  ALV Grid  Control using OOPs concepts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499078#M564560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAP Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Acutally  i dnt  have  any knowledge on OOPs concepts,  i have  an  object i.e.  ALV Grid  Control using OOPs concepts.. &lt;/P&gt;&lt;P&gt;hope tht  sumone  will  help to get  through&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the requirement, if at all  anyone had already done the related  , pls send the  stuff needed or  else  any suggestions&lt;/P&gt;&lt;P&gt;OBJECT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Technical specification deals with the Table Maintenance handled for the Z tables  through ALV GRID control in a Module Pool Program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screen processing logic &lt;/P&gt;&lt;P&gt;   Based on the selection criteria filled in the first screen of the transactions, rows are selected from the corresponding Z tables and displayed via an ALV grid control in Screen 1002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Validations &lt;/P&gt;&lt;P&gt;Screen 1000: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the database entries for the Selection criteria. If the database entries do not match then display error message in the Status Bar for the respective entry. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; Screen 1001: &lt;/P&gt;&lt;P&gt;Check the database entries for the Selection criteria. If the database entries do not match then display error message in the Status Bar for the respective entry. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Screen 1002:&lt;/P&gt;&lt;P&gt; When the Save button is pressed and an empty row(s) is/are saved, then delete the empty rows that have been inserted. &lt;/P&gt;&lt;P&gt;When the Save button is clicked, the field entries are checked with the Database entries and if any discrepancy is met, an Error message is displayed in the Status bar stating, &amp;#147;Check the Field Entries&amp;#148;. &lt;/P&gt;&lt;P&gt;After the entries are saved successfully to the database table a Success message is displayed in the Status bar, &amp;#147;Changes were saved&amp;#148;. &lt;/P&gt;&lt;P&gt;When the Change/Delete button is pressed without selecting any row then display the error message stating, &amp;#147;Select a row to perform the operation&amp;#148;. &lt;/P&gt;&lt;P&gt;When the delete button is clicked, a pop up is shown to confirm delete and pressing the delete button again deletes the row/rows which has the lock icon. &lt;/P&gt;&lt;P&gt;When the user clicks the Display button, a pop is shown to confirm for save.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2007 07:13:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499078#M564560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-21T07:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding  ALV Grid  Control using OOPs concepts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499079#M564561</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;check the below links lot of info and examples r there for &amp;lt;b&amp;gt;&amp;lt;u&amp;gt;OOPS&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.geocities.com/victorav15/sapr3/abap_ood.html" target="test_blank"&gt;http://www.geocities.com/victorav15/sapr3/abap_ood.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.brabandt.de/html/abap_oo.html" target="test_blank"&gt;http://www.brabandt.de/html/abap_oo.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Check this cool weblog:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql&lt;/P&gt;&lt;P&gt;/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm&lt;/A&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;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt" target="test_blank"&gt;http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt" target="test_blank"&gt;http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/" target="test_blank"&gt;http://www.allsaplinks.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/" target="test_blank"&gt;http://www.sap-img.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/" target="test_blank"&gt;http://www.sapgenie.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com" target="test_blank"&gt;http://help.sap.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/controls/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/controls/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf" target="test_blank"&gt;http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/index.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/OO/" target="test_blank"&gt;http://www.sapgenie.com/abap/OO/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;these links&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;For funtion module to class&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;for classes&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;for methods&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;for inheritance&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;for interfaces&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm&lt;/A&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;lt;u&amp;gt;&amp;lt;b&amp;gt;For Materials:&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;1) &lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf&lt;/A&gt; -- Page no: 1291&lt;/P&gt;&lt;P&gt;2) &lt;A href="http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt" target="test_blank"&gt;http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;3) &lt;A href="http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf" target="test_blank"&gt;http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;4) &lt;A href="http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf" target="test_blank"&gt;http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;5) &lt;A href="http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt" target="test_blank"&gt;http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;6) &lt;A href="http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf" target="test_blank"&gt;http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;7) &lt;A href="http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt" target="test_blank"&gt;http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; &lt;A href="http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8" target="test_blank"&gt;http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) &lt;A href="http://www.erpgenie.com/sap/abap/OO/index.htm" target="test_blank"&gt;http://www.erpgenie.com/sap/abap/OO/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2) &lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Check these sample code&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of it_mara occurs 0,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara.
 
data : begin of it_mara1 occurs 0,
* mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara1.
 
data : begin of it_mara2 occurs 0,
* mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of it_mara2.
 
data : t_fieldcat type lvc_t_fcat,
t_fieldcat1 type lvc_t_fcat,
 
s_fieldcat like line of t_fieldcat.
 
data : s_layout type lvc_s_layo.
 
data : control type ref to cl_gui_custom_container,
grid type ref to cl_gui_alv_grid.
 
 
data: begin of wa ,
mark type flag,
matnr type matnr,
mtart type mtart,
meins type meins,
end of wa.
 
class lcl_events_box definition.
 
public section.
 
methods :
 
*Handler_Data_Changed for event Data_Changed of cl_gui_alv_grid
*imporTing er_data_changed,
*
Handler_User_Command for event User_Command of cl_gui_alv_grid
imporTing e_ucomm,
 
Handler_ToolBar for event ToolBar of cl_gui_alv_grid
importing E_object E_interactive.
 
endclass.
 
class lcl_events_box implementation.
 
method Handler_user_command.
 
PERFORM FORM_USERCOMMAND CHANGING E_UCOMM.
endmethod.
 
method Handler_ToolBar.
PERFORM FORM_TOOLBAR CHANGING E_OBJECT E_INTERACTIVE
E_OBJECT-&amp;gt;MT_TOOLBAR.
endmethod.
 
ENDCLASS.
 
start-of-selection.
data : w_events type ref to lcl_events_box.
 
select matnr mtart meins from mara into corresponding fields of table
it_mara.
 
call screen 100.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Module pbo_module OUTPUT
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pbo_module OUTPUT.
if GRID is initial.
 
CREATE OBJECT CONTROL
EXPORTING
CONTAINER_NAME = 'CUST_CTRL'.
 
 
CREATE OBJECT GRID
EXPORTING
I_PARENT = CONTROL.
 
PERFORM BUILD_CATALOG.
 
PERFORM BUILD_CATALOG1.
 
PERFORM BUILD_LAYOUT.
 
CALL METHOD GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = s_layout
CHANGING
IT_OUTTAB = it_mara[]
IT_FIELDCATALOG = t_fieldcat.
 
 
 
CREATE OBJECT W_EVENTS.
SET HANDLER : W_EVENTS-&amp;gt;HANDLER_TOOLBAR FOR GRID,
W_EVENTS-&amp;gt;HANDLER_USER_COMMAND FOR GRID.
 
CALL METHOD GRID-&amp;gt;SET_TOOLBAR_INTERACTIVE.
 
ELSE.
call method grid-&amp;gt;refresh_table_display.
 
 
ENDIF.
ENDMODULE. " pbo_module OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form BUILD_CATALOG
 
FORM BUILD_CATALOG .
 
S_FIELDCAT-COL_POS = '1'.
S_FIELDCAT-FIELDNAME = 'MARK'.
S_FIELDCAT-CHECKBOX = 'X'.
S_FIELDCAT-eDIT = 'X'.
APPEND S_FIELDCAT TO T_FIELDCAT.
CLEAR S_FIELDCAT.
 
S_FIELDCAT-COL_POS = '2'.
S_FIELDCAT-FIELDNAME = 'MATNR'.
S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
APPEND S_FIELDCAT TO T_FIELDCAT.
 
S_FIELDCAT-COL_POS = '3'.
S_FIELDCAT-FIELDNAME = 'MTART'.
S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
APPEND S_FIELDCAT TO T_FIELDCAT.
 
S_FIELDCAT-COL_POS = '4'.
S_FIELDCAT-FIELDNAME = 'MEINS'.
S_FIELDCAT-SCRTEXT_M = 'UOM'.
APPEND S_FIELDCAT TO T_FIELDCAT.
 
ENDFORM. " BUILD_CATALOG
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form BUILD_LAYOUT
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&amp;gt; p1 text
* &amp;lt;-- p2 text
*----------------------------------------------------------------------*
FORM BUILD_LAYOUT .
S_LAYOUT-ZEBRA = 'X'.
* S_LAYOUT-CWIDTH_OPT = 'X'.
S_LAYOUT-GRID_TITLE = 'Material Details'.
ENDFORM.
" BUILD_LAYOUT////////////////////////////////////
" USER_COMMAND_0100 INPUT
 
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form FORM_USERCOMMAND
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* &amp;lt;--P_E_UCOMM text
*----------------------------------------------------------------------*
form FORM_USERCOMMAND changing p_e_ucomm.
 
CASE P_E_UCOMM.
 
WHEN 'INT1'.
 
DO.
 
READ TABLE IT_MARA INDEX SY-INDEX TRANSPORTING MARK MATNR.
 
 
IF SY-SUBRC &amp;lt;&amp;gt; 0.
 
EXIT.
 
ENDIF.
 
IF IT_MARA-MARK = 'X'.
 
read table it_mara into wa TRANSPORTING MATNR MTART MEINS .
MOVE-CORRESPONDING WA TO IT_MARA1.
READ TABLE IT_MARA1 TRANSPORTING MATNR MTART MEINS .
MOVE-CORRESPONDING IT_MARA1 TO IT_MARA2.
APPEND IT_MARA2.
 
 
CALL METHOD GRID-&amp;gt;SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = s_layout
CHANGING
IT_OUTTAB = it_mara2[]
IT_FIELDCATALOG = t_fieldcat1.
*
* SET PARAMETER ID 'MAT' FIELD IT_MARA-MATNR.
* CALL TRANSACTION 'MM02'.
. ENDIF.
* ENDIF.
ENDDO.
ENDCASE.
endform. " FORM_USERCOMMAND
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form FORM_TOOLBAR
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* &amp;lt;--P_E_OBJECT text
* &amp;lt;--P_E_INTERACTIVE text
* &amp;lt;--P_E_OBJECT_&amp;gt;MT_TOOLBAR text
*----------------------------------------------------------------------*
FORM FORM_TOOLBAR CHANGING P_E_OBJECT TYPE REF TO
CL_ALV_EVENT_TOOLBAR_SET
P_E_INTERACTIVE
MT_TOOLBAR TYPE TTB_BUTTON.
 
 
DATA WAL_BUTTON TYPE STB_BUTTON.
 
*WAL_BUTTON-ICON = ICON_status_reverse.
WAL_BUTTON-TEXT = 'GO'.
WAL_BUTTON-QUICKINFO = 'PROCEED'.
waL_button-FUNCTION = 'INT1'.
WAL_BUTTON-BUTN_TYPE = 0.
WAL_BUTTON-DISABLED = SPACE.
insert WAL_BUTTON INTO P_E_OBJECT-&amp;gt;MT_TOOLBAR index 1.
 
endform. " FORM_TOOLBAR
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Module PF-STATUS OUTPUT
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module PF-STATUS output.
 
set pf-status 'Z7PSTAT'.
 
endmodule. " PF-STATUS OUTPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Module USER_COMMAND_0100 INPUT
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.
 
CASE SY-UCOMM.
 
 
WHEN 'BACK'.
LEAVE PROGRAM.
 
WHEN 'CANCEL'.
LEAVE PROGRAM.
 
 
ENDCASE.
 
 
endmodule. " USER_COMMAND_0100 INPUT
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Form BUILD_CATALOG1
*&amp;amp;---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --&amp;gt; p1 text
* &amp;lt;-- p2 text
*----------------------------------------------------------------------*
form BUILD_CATALOG1 .
 
S_FIELDCAT-COL_POS = '1'.
S_FIELDCAT-FIELDNAME = 'MATNR'.
S_FIELDCAT-SCRTEXT_M = 'MATERIAL'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
 
S_FIELDCAT-COL_POS = '2'.
S_FIELDCAT-FIELDNAME = 'MTART'.
S_FIELDCAT-SCRTEXT_M = 'MATERL TYPE'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
 
S_FIELDCAT-COL_POS = '3'.
S_FIELDCAT-FIELDNAME = 'MEINS'.
S_FIELDCAT-SCRTEXT_M = 'UOM'.
APPEND S_FIELDCAT TO T_FIELDCAT1.
 
 
endform. " BUILD_CATALOG1 


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the below link may be useful for you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/reporting/alvhome.htm" target="test_blank"&gt;http://www.sapdevelopment.co.uk/reporting/alvhome.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Simple ALV report&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;/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;ALV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Please give me general info on ALV.&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;2. How do I program double click in ALV?&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;3. How do I add subtotals (I have problem to add them)...&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;4. How to add list heading like top-of-page in ABAP lists?&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;5. How to print page number / total number of pages X/XX in ALV?&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;6. ALV printing problems. 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;7. How can I set the cell color in ALV?&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;8. How do I print a logo/graphics in ALV?&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;9. How do I create and use input-enabled fields in ALV?&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;10. How can I use ALV for reports that are going to be run in background?&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;11. How can I display an icon in ALV? (Common requirement is traffic light icon).&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;12. How can I display a checkbox in ALV?&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;Go thru these programs they may help u to try on some hands on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALV Demo program&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;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Pavan praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2007 07:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499079#M564561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-21T07:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding  ALV Grid  Control using OOPs concepts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499080#M564562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at below link. Its a PDF document Which will give you information abt OO ALV.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also have a look at below link.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following standard programs also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BCALV_GRID_01 to BCALV_GRID_11,BCALV_GRID_DEMO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sample &lt;/P&gt;&lt;P&gt;&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;  Include           Z_TABLE_DISPLAY&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;VERSION 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Code from François Henrotte (EPONA Solutions)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                            &lt;A href="http://www.eponasolutions.com" target="test_blank"&gt;http://www.eponasolutions.com&lt;/A&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                            Belgium&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Please keep reference !&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HOW TO&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display an ALV grid :&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;display_grid( 'tabname' ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display a hierarchical list with header and detail :&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;display_hier( in_header = 'table1'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                             in_detail = 'table2' ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display a block list with two tables :&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;set_block_mode( 'X' ).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;display_grid( 'table1' ).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;display_grid( 'table2' ).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;end_block_list( ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;You never have to deal with field catalog of tables !!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;What if field catalog has to be changed anyway ?&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ob_table = lcl_table_display=&amp;gt;create_table( 'tabname' ).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD ob_table-&amp;gt;set_alv_fieldtext( in_field = field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                         in_ftext = 'text' ).&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL METHOD lcl_table_display=&amp;gt;display_grid( 'tabname' ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: abap, slis.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LCL_TABLE_DISPLAY DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;class lcl_table_display definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  public section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    class-methods: display_list importing in_tabname  type any,&lt;/P&gt;&lt;P&gt;                   display_grid importing in_tabname  type any,&lt;/P&gt;&lt;P&gt;                   display_hier importing in_header   type any&lt;/P&gt;&lt;P&gt;                                          in_detail   type any&lt;/P&gt;&lt;P&gt;                                          in_level    type i optional,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                   set_block_mode importing in_mode type c,&lt;/P&gt;&lt;P&gt;                   set_block_text importing in_text type any,&lt;/P&gt;&lt;P&gt;                   end_block_list importing in_print&lt;/P&gt;&lt;P&gt;                                       type slis_print_alv optional&lt;/P&gt;&lt;P&gt;                                 exceptions display_error,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                   create_table&lt;/P&gt;&lt;P&gt;                     importing&lt;/P&gt;&lt;P&gt;                       in_tabname type tabname&lt;/P&gt;&lt;P&gt;                     returning&lt;/P&gt;&lt;P&gt;                       value(out_table) type ref to lcl_table_display&lt;/P&gt;&lt;P&gt;                     exceptions&lt;/P&gt;&lt;P&gt;                       create_error,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                   get_existing_table&lt;/P&gt;&lt;P&gt;                     importing&lt;/P&gt;&lt;P&gt;                       in_tabname type any optional&lt;/P&gt;&lt;P&gt;                       in_repid   type any optional&lt;/P&gt;&lt;P&gt;                       in_struc   type any optional&lt;/P&gt;&lt;P&gt;                     returning&lt;/P&gt;&lt;P&gt;                       value(out_table) type ref to lcl_table_display&lt;/P&gt;&lt;P&gt;                     exceptions&lt;/P&gt;&lt;P&gt;                       no_parameter&lt;/P&gt;&lt;P&gt;                       not_found,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                   refresh_objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: constructor importing in_data type standard table&lt;/P&gt;&lt;P&gt;                         exceptions casting_error&lt;/P&gt;&lt;P&gt;                                    empty_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: get_alv_fieldcat  returning value(out_fieldcat)&lt;/P&gt;&lt;P&gt;                                    type slis_t_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: set_table_name     importing in_tabname  type any,&lt;/P&gt;&lt;P&gt;             set_alv_title      importing in_title    type any,&lt;/P&gt;&lt;P&gt;             set_alv_fieldcat   importing in_fieldcat&lt;/P&gt;&lt;P&gt;                                     type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;             set_alv_fieldnoout importing in_field    type any&lt;/P&gt;&lt;P&gt;                                          in_noout    type c optional&lt;/P&gt;&lt;P&gt;                                          in_tech     type c optional,&lt;/P&gt;&lt;P&gt;             set_alv_fieldedit  importing in_field    type any&lt;/P&gt;&lt;P&gt;                                          in_edit     type c optional,&lt;/P&gt;&lt;P&gt;             set_alv_fieldtext  importing in_field    type any&lt;/P&gt;&lt;P&gt;                                          in_ftext    type any,&lt;/P&gt;&lt;P&gt;             set_alv_fieldsum   importing in_field    type any&lt;/P&gt;&lt;P&gt;                                          in_dosum    type c optional,&lt;/P&gt;&lt;P&gt;             set_alv_linebreak  importing in_field    type any,&lt;/P&gt;&lt;P&gt;             set_alv_settings   importing in_settings type any,&lt;/P&gt;&lt;P&gt;             set_alv_layout     importing in_layout   type any,&lt;/P&gt;&lt;P&gt;             set_alv_print      importing in_print    type any,&lt;/P&gt;&lt;P&gt;             set_alv_sorting    importing in_field    type any&lt;/P&gt;&lt;P&gt;                                          in_desc     type c optional&lt;/P&gt;&lt;P&gt;                                          in_group    type any optional&lt;/P&gt;&lt;P&gt;                                          in_subtot   type c optional,&lt;/P&gt;&lt;P&gt;             set_alv_keys       importing in_level    type i&lt;/P&gt;&lt;P&gt;                                          in_key      type c optional,&lt;/P&gt;&lt;P&gt;             set_alv_event      importing in_name     type any&lt;/P&gt;&lt;P&gt;                                          in_form     type any,&lt;/P&gt;&lt;P&gt;             set_all_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  protected section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: g_table_type type slis_list_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: g_title      type lvc_title,&lt;/P&gt;&lt;P&gt;          gt_fcat      type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          gs_sett      type lvc_s_glay,&lt;/P&gt;&lt;P&gt;          gs_layo      type slis_layout_alv,&lt;/P&gt;&lt;P&gt;          gt_sort      type slis_t_sortinfo_alv,&lt;/P&gt;&lt;P&gt;          gt_evnt      type slis_t_event,&lt;/P&gt;&lt;P&gt;          gs_prin      type slis_print_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    class-methods: output_hierarchy exceptions display_error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: output_table importing mode type c&lt;/P&gt;&lt;P&gt;                         exceptions display_error,&lt;/P&gt;&lt;P&gt;             output_list,&lt;/P&gt;&lt;P&gt;             output_grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  private section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    class-data: gt_table_obj   type table of ref to lcl_table_display,&lt;/P&gt;&lt;P&gt;                g_header_table type ref to lcl_table_display,&lt;/P&gt;&lt;P&gt;                g_detail_table type ref to lcl_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    class-data: g_variant_level type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    class-data: g_block_mode    type c,&lt;/P&gt;&lt;P&gt;                g_block_text    type slis_text40.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    types: begin of ty_defin,&lt;/P&gt;&lt;P&gt;             fieldname     type fieldname,&lt;/P&gt;&lt;P&gt;             ref_tabname   type tabname,&lt;/P&gt;&lt;P&gt;             ref_fieldname type fieldname,&lt;/P&gt;&lt;P&gt;           end of ty_defin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: g_repid  type repid,&lt;/P&gt;&lt;P&gt;          g_struc  type tabname,&lt;/P&gt;&lt;P&gt;          g_table  type tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: gt_data  type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: gt_defin type table of ty_defin,&lt;/P&gt;&lt;P&gt;          g_level  type tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    methods: init_block_list,&lt;/P&gt;&lt;P&gt;             fill_fieldcat importing repid type repid&lt;/P&gt;&lt;P&gt;                                     struc type tabname&lt;/P&gt;&lt;P&gt;                            changing fcat  type slis_t_fieldcat_alv&lt;/P&gt;&lt;P&gt;                          exceptions no_definition,&lt;/P&gt;&lt;P&gt;             get_definition importing repid type repid&lt;/P&gt;&lt;P&gt;                                      struc type tabname&lt;/P&gt;&lt;P&gt;                             changing abap  type rsfb_source,&lt;/P&gt;&lt;P&gt;             recursive_definition importing repid type repid&lt;/P&gt;&lt;P&gt;                                   changing abap  type rsfb_source,&lt;/P&gt;&lt;P&gt;             map_structure importing source type any&lt;/P&gt;&lt;P&gt;                            changing destin type any,&lt;/P&gt;&lt;P&gt;             get_default_variant changing out_variant type disvariant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.                    "lcl_table_display DEFINITION&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  LCL_TABLE_DISPLAY IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;class lcl_table_display implementation.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display table in ALV list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method display_list.&lt;/P&gt;&lt;P&gt;    data: l_object  type ref to lcl_table_display,&lt;/P&gt;&lt;P&gt;          l_tabname type tabname,&lt;/P&gt;&lt;P&gt;          l_found   type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_tabname = in_tabname.&lt;/P&gt;&lt;P&gt;    loop at gt_table_obj into l_object.&lt;/P&gt;&lt;P&gt;      if l_object-&amp;gt;g_table = l_tabname.&lt;/P&gt;&lt;P&gt;        l_found = 'X'.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;    if l_found is initial.&lt;/P&gt;&lt;P&gt;      l_object = lcl_table_display=&amp;gt;create_table( l_tabname ).&lt;/P&gt;&lt;P&gt;      if g_block_mode is initial.&lt;/P&gt;&lt;P&gt;        l_object-&amp;gt;g_table_type = 4.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        l_object-&amp;gt;g_table_type = 2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      call method l_object-&amp;gt;set_all_events.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    call method l_object-&amp;gt;output_list.&lt;/P&gt;&lt;P&gt;  endmethod.                    "display_list&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display table in ALV grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method display_grid.&lt;/P&gt;&lt;P&gt;    data: l_object  type ref to lcl_table_display,&lt;/P&gt;&lt;P&gt;          l_tabname type tabname,&lt;/P&gt;&lt;P&gt;          l_found   type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_tabname = in_tabname.&lt;/P&gt;&lt;P&gt;    loop at gt_table_obj into l_object.&lt;/P&gt;&lt;P&gt;      if l_object-&amp;gt;g_table = l_tabname.&lt;/P&gt;&lt;P&gt;        l_found = 'X'.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;    if l_found is initial.&lt;/P&gt;&lt;P&gt;      l_object = lcl_table_display=&amp;gt;create_table( l_tabname ).&lt;/P&gt;&lt;P&gt;      if g_block_mode is initial.&lt;/P&gt;&lt;P&gt;        l_object-&amp;gt;g_table_type = 4.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        l_object-&amp;gt;g_table_type = 2.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      call method l_object-&amp;gt;set_all_events.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if g_block_mode is initial.&lt;/P&gt;&lt;P&gt;      call method l_object-&amp;gt;output_grid.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      call method l_object-&amp;gt;output_list.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.                    "display_grid&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display tables in ALV hierarchy&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method display_hier.&lt;/P&gt;&lt;P&gt;    data: l_tabnam1 type tabname,&lt;/P&gt;&lt;P&gt;          l_tabnam2 type tabname,&lt;/P&gt;&lt;P&gt;          lt_fcat1  type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          lt_fcat2  type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          ls_fcat1  type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          ls_fcat2  type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_tabnam1 = in_header.&lt;/P&gt;&lt;P&gt;    l_tabnam2 = in_detail.&lt;/P&gt;&lt;P&gt;    call method lcl_table_display=&amp;gt;get_existing_table&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        in_tabname = l_tabnam1&lt;/P&gt;&lt;P&gt;      receiving&lt;/P&gt;&lt;P&gt;        out_table  = g_header_table&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        not_found  = 1.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      g_header_table = lcl_table_display=&amp;gt;create_table( l_tabnam1 ).&lt;/P&gt;&lt;P&gt;      if g_block_mode is initial.&lt;/P&gt;&lt;P&gt;        g_header_table-&amp;gt;g_table_type = 1.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;        g_header_table-&amp;gt;g_table_type = 3.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      call method g_header_table-&amp;gt;set_all_events.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    call method lcl_table_display=&amp;gt;get_existing_table&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        in_tabname = l_tabnam2&lt;/P&gt;&lt;P&gt;      receiving&lt;/P&gt;&lt;P&gt;        out_table  = g_detail_table&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        not_found  = 1.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      g_detail_table = lcl_table_display=&amp;gt;create_table( l_tabnam2 ).&lt;/P&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;  Set key fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if in_level is initial.&lt;/P&gt;&lt;P&gt;      lt_fcat1 = g_header_table-&amp;gt;get_alv_fieldcat( ).&lt;/P&gt;&lt;P&gt;      lt_fcat2 = g_detail_table-&amp;gt;get_alv_fieldcat( ).&lt;/P&gt;&lt;P&gt;      loop at lt_fcat1 into ls_fcat1.&lt;/P&gt;&lt;P&gt;        ls_fcat1-key = space.&lt;/P&gt;&lt;P&gt;        loop at lt_fcat2 into ls_fcat2&lt;/P&gt;&lt;P&gt;                        where fieldname = ls_fcat1-fieldname.&lt;/P&gt;&lt;P&gt;          ls_fcat2-key = space.&lt;/P&gt;&lt;P&gt;          ls_fcat2-key_sel = 'X'.&lt;/P&gt;&lt;P&gt;          ls_fcat2-tech = 'X'.&lt;/P&gt;&lt;P&gt;          modify lt_fcat2 from ls_fcat2 transporting key.&lt;/P&gt;&lt;P&gt;        endloop.&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          ls_fcat1-key = 'X'.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        modify lt_fcat1 from ls_fcat1 transporting key.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;      call method g_header_table-&amp;gt;set_alv_fieldcat&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          in_fieldcat = lt_fcat1.&lt;/P&gt;&lt;P&gt;      call method g_detail_table-&amp;gt;set_alv_fieldcat&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          in_fieldcat = lt_fcat2.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      call method g_header_table-&amp;gt;set_alv_keys&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          in_level = in_level.&lt;/P&gt;&lt;P&gt;      call method g_detail_table-&amp;gt;set_alv_keys&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          in_level = in_level&lt;/P&gt;&lt;P&gt;          in_key   = space.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    call method output_hierarchy.&lt;/P&gt;&lt;P&gt;  endmethod.                    "display_hier&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set block mode&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_block_mode.&lt;/P&gt;&lt;P&gt;    g_block_mode = in_mode.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_block_mode&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set block text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_block_text.&lt;/P&gt;&lt;P&gt;    g_block_text = in_text.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_block_text&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create new table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method create_table.&lt;/P&gt;&lt;P&gt;    data: l_object type ref to lcl_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols: set_table_name&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        in_tabname = in_tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Default print options&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_object-&amp;gt;gs_prin-no_print_selinfos  = 'X'.&lt;/P&gt;&lt;P&gt;    l_object-&amp;gt;gs_prin-no_coverpage       = 'X'.&lt;/P&gt;&lt;P&gt;    l_object-&amp;gt;gs_prin-no_print_listinfos = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    out_table = l_object.&lt;/P&gt;&lt;P&gt;  endmethod.                    "create_table&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get existing table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method get_existing_table.&lt;/P&gt;&lt;P&gt;    data: l_object  type ref to lcl_table_display,&lt;/P&gt;&lt;P&gt;          l_tabname type tabname,&lt;/P&gt;&lt;P&gt;          l_repid   type repid,&lt;/P&gt;&lt;P&gt;          l_struc   type tabname,&lt;/P&gt;&lt;P&gt;          l_found   type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_tabname = in_tabname.&lt;/P&gt;&lt;P&gt;    l_repid   = in_repid.&lt;/P&gt;&lt;P&gt;    l_struc   = in_struc.&lt;/P&gt;&lt;P&gt;    if l_tabname is initial.&lt;/P&gt;&lt;P&gt;      if l_repid is initial and&lt;/P&gt;&lt;P&gt;         l_struc is initial.&lt;/P&gt;&lt;P&gt;        raise no_parameter.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Get last existing table with same definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        loop at gt_table_obj into l_object.&lt;/P&gt;&lt;P&gt;          if l_object-&amp;gt;g_repid = l_repid and&lt;/P&gt;&lt;P&gt;             l_object-&amp;gt;g_struc = l_struc.&lt;/P&gt;&lt;P&gt;            l_found = 'X'.&lt;/P&gt;&lt;P&gt;            exit.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endloop.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Get last existing table with same name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      loop at gt_table_obj into l_object.&lt;/P&gt;&lt;P&gt;        if l_object-&amp;gt;g_table = l_tabname.&lt;/P&gt;&lt;P&gt;          l_found = 'X'.&lt;/P&gt;&lt;P&gt;          exit.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if l_found is initial.&lt;/P&gt;&lt;P&gt;      raise not_found.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      out_table = l_object.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.                    "get_existing_table&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Create table display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method constructor.&lt;/P&gt;&lt;P&gt;    data: l_object type ref to lcl_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: ls_data  type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: ob_desc  type ref to cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: l_found  type c,&lt;/P&gt;&lt;P&gt;          l_absol  type char200,&lt;/P&gt;&lt;P&gt;          l_repid  type repid,&lt;/P&gt;&lt;P&gt;          l_struc  type tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols:  type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get data and store it into attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    create data me-&amp;gt;gt_data like in_data.&lt;/P&gt;&lt;P&gt;    assign me-&amp;gt;gt_data-&amp;gt;* to .&lt;BR /&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; = in_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get global data definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    create data ls_data like line of  ).&lt;/P&gt;&lt;P&gt;    endcatch.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 1.&lt;/P&gt;&lt;P&gt;      raise casting_error.&lt;/P&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;  Get program name and main type used to define table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_absol = ob_desc-&amp;gt;absolute_name.&lt;/P&gt;&lt;P&gt;    split l_absol at 'TYPE=' into l_repid l_struc.&lt;/P&gt;&lt;P&gt;    shift l_repid up to '='.&lt;/P&gt;&lt;P&gt;    shift l_repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    check l_struc np '%_*'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set attributes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    me-&amp;gt;g_repid = l_repid.&lt;/P&gt;&lt;P&gt;    me-&amp;gt;g_struc = l_struc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    me-&amp;gt;g_table = l_struc.&lt;/P&gt;&lt;P&gt;    replace 'TY' with 'WT' into me-&amp;gt;g_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method lcl_table_display=&amp;gt;get_existing_table&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        in_repid  = l_repid&lt;/P&gt;&lt;P&gt;        in_struc  = l_struc&lt;/P&gt;&lt;P&gt;      receiving&lt;/P&gt;&lt;P&gt;        out_table = l_object&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        not_found = 1.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      me-&amp;gt;gt_fcat = l_object-&amp;gt;get_alv_fieldcat( ).&lt;/P&gt;&lt;P&gt;      call method set_table_name&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          in_tabname = me-&amp;gt;g_table.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      call method fill_fieldcat&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          repid = l_repid&lt;/P&gt;&lt;P&gt;          struc = l_struc&lt;/P&gt;&lt;P&gt;        changing&lt;/P&gt;&lt;P&gt;          fcat  = me-&amp;gt;gt_fcat.&lt;/P&gt;&lt;P&gt;      if me-&amp;gt;gt_fcat is initial.&lt;/P&gt;&lt;P&gt;        raise empty_fieldcat.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&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;  Keep list of tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    append me to gt_table_obj.&lt;/P&gt;&lt;P&gt;  endmethod.                    "constructor&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Output list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method output_list.&lt;/P&gt;&lt;P&gt;    call method output_table&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        mode = 'L'.&lt;/P&gt;&lt;P&gt;  endmethod.                    "output_list&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Output grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method output_grid.&lt;/P&gt;&lt;P&gt;    call method output_table&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        mode = 'G'.&lt;/P&gt;&lt;P&gt;  endmethod.                    "output_grid&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Output table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method output_table.&lt;/P&gt;&lt;P&gt;    data: l_object type ref to lcl_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: ls_vari  type disvariant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols: type standard table.&lt;BR /&gt;&lt;BR /&gt;assign me-&amp;gt;gt_data-&amp;gt;* to .&lt;BR /&gt;&lt;BR /&gt;if not g_block_mode is initial.&lt;BR /&gt;read table gt_table_obj into l_object index 1.&lt;BR /&gt;if sy-subrc = 0.&lt;BR /&gt;if l_object-&amp;gt;g_table = me-&amp;gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;g_table.&lt;/P&gt;&lt;P&gt;          call method init_block_list.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&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;  Get default user variant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method get_default_variant&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        out_variant = ls_vari.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display table contents&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if mode = 'G'.&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 = me-&amp;gt;g_repid&lt;/P&gt;&lt;P&gt;          i_grid_title       = me-&amp;gt;g_title&lt;/P&gt;&lt;P&gt;          i_grid_settings    = me-&amp;gt;gs_sett&lt;/P&gt;&lt;P&gt;          is_layout          = me-&amp;gt;gs_layo&lt;/P&gt;&lt;P&gt;          it_fieldcat        = me-&amp;gt;gt_fcat&lt;/P&gt;&lt;P&gt;          it_sort            = me-&amp;gt;gt_sort&lt;/P&gt;&lt;P&gt;          i_save             = 'U'&lt;/P&gt;&lt;P&gt;          is_variant         = ls_vari&lt;/P&gt;&lt;P&gt;          it_events          = me-&amp;gt;gt_evnt&lt;/P&gt;&lt;P&gt;          is_print           = me-&amp;gt;gs_prin&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;          t_outtab           = &lt;BR /&gt;exceptions&lt;BR /&gt;program_error = 1&lt;BR /&gt;others = 2.&lt;BR /&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;raise display_error.&lt;BR /&gt;endif.&lt;BR /&gt;call method refresh_objects.&lt;BR /&gt;else.&lt;BR /&gt;if g_block_mode is initial.&lt;BR /&gt;call function 'REUSE_ALV_LIST_DISPLAY'&lt;BR /&gt;exporting&lt;BR /&gt;i_callback_program = me-&amp;gt;g_repid&lt;BR /&gt;is_layout = me-&amp;gt;gs_layo&lt;BR /&gt;it_fieldcat = me-&amp;gt;gt_fcat&lt;BR /&gt;it_sort = me-&amp;gt;gt_sort&lt;BR /&gt;i_save = 'U'&lt;BR /&gt;is_variant = ls_vari&lt;BR /&gt;it_events = me-&amp;gt;gt_evnt&lt;BR /&gt;is_print = me-&amp;gt;gs_prin&lt;BR /&gt;tables&lt;BR /&gt;t_outtab = &lt;BR /&gt;exceptions&lt;BR /&gt;others = 0.&lt;BR /&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;BR /&gt;raise display_error.&lt;BR /&gt;endif.&lt;BR /&gt;call method refresh_objects.&lt;BR /&gt;else.&lt;BR /&gt;call function 'REUSE_ALV_BLOCK_LIST_APPEND'&lt;BR /&gt;exporting&lt;BR /&gt;is_layout = me-&amp;gt;gs_layo&lt;BR /&gt;it_fieldcat = me-&amp;gt;gt_fcat&lt;BR /&gt;i_tabname = me-&amp;gt;g_table&lt;BR /&gt;it_events = me-&amp;gt;gt_evnt&lt;BR /&gt;it_sort = me-&amp;gt;gt_sort&lt;BR /&gt;i_text = g_block_text&lt;BR /&gt;tables&lt;BR /&gt;t_outtab = &lt;BR /&gt;exceptions&lt;BR /&gt;program_error = 1&lt;BR /&gt;maximum_of_appends_reached = 2&lt;BR /&gt;others = 3.&lt;BR /&gt;if sy-subrc &amp;lt;&amp;gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; 0.&lt;/P&gt;&lt;P&gt;          raise display_error.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.                    "output_table&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Output hierarchy&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method output_hierarchy.&lt;/P&gt;&lt;P&gt;    data: l_object type ref to lcl_table_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: lt_fcat  type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          lt_sort  type slis_t_sortinfo_alv,&lt;/P&gt;&lt;P&gt;          ls_fcat  type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          ls_vari  type disvariant,&lt;/P&gt;&lt;P&gt;          ls_keyi  type slis_keyinfo_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: l_index  type numc2,&lt;/P&gt;&lt;P&gt;          l_field  type fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols: .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set key fields as common fields between header and detail&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    loop at g_header_table-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                                   where key = 'X'.&lt;/P&gt;&lt;P&gt;      l_index = l_index + 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Create link&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      concatenate 'HEADER' l_index into l_field.&lt;/P&gt;&lt;P&gt;      assign component l_field of structure ls_keyi to init_block_list.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&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;  Get default user variant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method g_header_table-&amp;gt;get_default_variant&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        out_variant = ls_vari.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if g_block_mode is initial.&lt;/P&gt;&lt;P&gt;      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          i_callback_program = g_header_table-&amp;gt;g_repid&lt;/P&gt;&lt;P&gt;          is_layout          = g_header_table-&amp;gt;gs_layo&lt;/P&gt;&lt;P&gt;          it_fieldcat        = lt_fcat&lt;/P&gt;&lt;P&gt;          it_sort            = lt_sort&lt;/P&gt;&lt;P&gt;          i_save             = 'U'&lt;/P&gt;&lt;P&gt;          is_variant         = ls_vari&lt;/P&gt;&lt;P&gt;          it_events          = g_header_table-&amp;gt;gt_evnt&lt;/P&gt;&lt;P&gt;          i_tabname_header   = g_header_table-&amp;gt;g_table&lt;/P&gt;&lt;P&gt;          i_tabname_item     = g_detail_table-&amp;gt;g_table&lt;/P&gt;&lt;P&gt;          is_keyinfo         = ls_keyi&lt;/P&gt;&lt;P&gt;          is_print           = g_header_table-&amp;gt;gs_prin&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;          t_outtab_header    =  0.&lt;/P&gt;&lt;P&gt;        raise display_error.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.                    "output_hierarchy&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Init block list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method init_block_list.&lt;/P&gt;&lt;P&gt;    data:  ls_evnt1 type slis_alv_event,&lt;/P&gt;&lt;P&gt;           ls_evnt2 type slis_alv_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Events for whole list display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    concatenate 'F_' slis_ev_pf_status_set '_BLOCK'&lt;/P&gt;&lt;P&gt;           into ls_evnt1-form.&lt;/P&gt;&lt;P&gt;    concatenate 'F_' slis_ev_user_command '_BLOCK'&lt;/P&gt;&lt;P&gt;           into ls_evnt2-form.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Initialization of block list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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       = me-&amp;gt;g_repid&lt;/P&gt;&lt;P&gt;        i_callback_pf_status_set = ls_evnt1-form&lt;/P&gt;&lt;P&gt;        i_callback_user_command  = ls_evnt2-form.&lt;/P&gt;&lt;P&gt;  endmethod.                    "init_block_list&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  End of block list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method end_block_list.&lt;/P&gt;&lt;P&gt;    data: l_object type ref to lcl_table_display,&lt;/P&gt;&lt;P&gt;          ls_print type slis_print_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    check not g_block_mode is initial.&lt;/P&gt;&lt;P&gt;    if in_print is supplied.&lt;/P&gt;&lt;P&gt;      ls_print = in_print.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      read table gt_table_obj into l_object index 1.&lt;/P&gt;&lt;P&gt;      ls_print = l_object-&amp;gt;gs_prin.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        is_print      = ls_print&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;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      raise display_error.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    call method refresh_objects.&lt;/P&gt;&lt;P&gt;  endmethod.                    "end_block_list&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Refresh table of objects&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method refresh_objects.&lt;/P&gt;&lt;P&gt;    free: gt_table_obj.&lt;/P&gt;&lt;P&gt;  endmethod.&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Fill field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method fill_fieldcat.&lt;/P&gt;&lt;P&gt;    data: lt_abap   type rsfb_source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: ls_defin  type ty_defin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: lt_dfies  type table of dfies,&lt;/P&gt;&lt;P&gt;          ls_dfies  type dfies,&lt;/P&gt;&lt;P&gt;          ls_dd04v  type dd04v,&lt;/P&gt;&lt;P&gt;          ls_dd01v  type dd01v,&lt;/P&gt;&lt;P&gt;          l_flong   type dfies-lfieldname,&lt;/P&gt;&lt;P&gt;          l_dname   type dfies-domname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: ls_fcat   type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          ls_fcat2  type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: l_index   type i,&lt;/P&gt;&lt;P&gt;          l_nbfld   type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    free: me-&amp;gt;gt_defin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Process data definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method get_definition&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        repid = repid&lt;/P&gt;&lt;P&gt;        struc = struc&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        abap  = lt_abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Process sub levels if required&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call method recursive_definition&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        repid = repid&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        abap  = lt_abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if me-&amp;gt;gt_defin is initial.&lt;/P&gt;&lt;P&gt;      raise no_definition.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_defin into ls_defin.&lt;/P&gt;&lt;P&gt;      clear: ls_fcat.&lt;/P&gt;&lt;P&gt;      move-corresponding ls_defin to ls_fcat.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Retrieve info about this field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      free: ls_dfies, ls_dd04v, ls_dd01v, l_dname.&lt;/P&gt;&lt;P&gt;      l_flong = ls_fcat-ref_fieldname.&lt;/P&gt;&lt;P&gt;      set locale language 'E'.&lt;/P&gt;&lt;P&gt;      translate: ls_fcat-ref_tabname   to upper case,&lt;/P&gt;&lt;P&gt;                 ls_fcat-ref_fieldname to upper case,&lt;/P&gt;&lt;P&gt;                 l_flong               to upper case.&lt;/P&gt;&lt;P&gt;      if not ls_fcat-ref_tabname is initial.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Try to get info about field in table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        call function 'DDIF_FIELDINFO_GET'&lt;/P&gt;&lt;P&gt;          exporting&lt;/P&gt;&lt;P&gt;            tabname        = ls_fcat-ref_tabname&lt;/P&gt;&lt;P&gt;            fieldname      = ls_fcat-ref_fieldname&lt;/P&gt;&lt;P&gt;            lfieldname     = l_flong&lt;/P&gt;&lt;P&gt;          importing&lt;/P&gt;&lt;P&gt;            dfies_wa       = ls_dfies&lt;/P&gt;&lt;P&gt;          exceptions&lt;/P&gt;&lt;P&gt;            not_found      = 1&lt;/P&gt;&lt;P&gt;            internal_error = 2&lt;/P&gt;&lt;P&gt;            others         = 3.&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          move-corresponding ls_dfies to ls_fcat.&lt;/P&gt;&lt;P&gt;          ls_fcat-fieldname = ls_defin-fieldname.&lt;/P&gt;&lt;P&gt;          move: ls_dfies-keyflag   to ls_fcat-key,&lt;/P&gt;&lt;P&gt;                ls_dfies-scrtext_m to ls_fcat-seltext_l,&lt;/P&gt;&lt;P&gt;                ls_dfies-domname   to l_dname.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Try to get info about structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        ls_defin-ref_tabname = ls_defin-ref_fieldname.&lt;/P&gt;&lt;P&gt;        call function 'DDIF_FIELDINFO_GET'&lt;/P&gt;&lt;P&gt;          exporting&lt;/P&gt;&lt;P&gt;            tabname   = ls_defin-ref_tabname&lt;/P&gt;&lt;P&gt;          tables&lt;/P&gt;&lt;P&gt;            dfies_tab = lt_dfies&lt;/P&gt;&lt;P&gt;          exceptions&lt;/P&gt;&lt;P&gt;            others    = 0.&lt;/P&gt;&lt;P&gt;        if not lt_dfies is initial.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Process fields of this structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          loop at lt_dfies into ls_dfies.&lt;/P&gt;&lt;P&gt;            clear: ls_fcat.&lt;/P&gt;&lt;P&gt;            move-corresponding ls_dfies to ls_fcat.&lt;/P&gt;&lt;P&gt;            if ls_defin-fieldname ne 'INCLUDE'.&lt;/P&gt;&lt;P&gt;              concatenate ls_defin-fieldname ls_fcat-fieldname&lt;/P&gt;&lt;P&gt;                     into ls_fcat-fieldname&lt;/P&gt;&lt;P&gt;                separated by '-'.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;            move ls_dfies-keyflag to ls_fcat-key.&lt;/P&gt;&lt;P&gt;            move ls_dfies-scrtext_m to ls_fcat-seltext_l.&lt;/P&gt;&lt;P&gt;            ls_fcat-tabname = me-&amp;gt;g_table.&lt;/P&gt;&lt;P&gt;            clear: ls_fcat-col_pos,&lt;/P&gt;&lt;P&gt;                   ls_fcat-offset.&lt;/P&gt;&lt;P&gt;            if ls_fcat-ref_tabname is initial.&lt;/P&gt;&lt;P&gt;              ls_fcat-ddictxt = 'L'.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          Display Yes/No fields as checkboxes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if ls_dfies-domname = 'XFELD'.&lt;/P&gt;&lt;P&gt;              ls_fcat-checkbox = 'X'.&lt;/P&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;          Add field to field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            append ls_fcat to fcat.&lt;/P&gt;&lt;P&gt;          endloop.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Try to get info about data element&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          call function 'DDIF_DTEL_GET'&lt;/P&gt;&lt;P&gt;            exporting&lt;/P&gt;&lt;P&gt;              name          = ls_fcat-ref_fieldname&lt;/P&gt;&lt;P&gt;              langu         = sy-langu&lt;/P&gt;&lt;P&gt;            importing&lt;/P&gt;&lt;P&gt;              dd04v_wa      = ls_dd04v&lt;/P&gt;&lt;P&gt;            exceptions&lt;/P&gt;&lt;P&gt;              illegal_input = 1&lt;/P&gt;&lt;P&gt;              others        = 2.&lt;/P&gt;&lt;P&gt;          if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;            move-corresponding ls_dd04v to ls_fcat.&lt;/P&gt;&lt;P&gt;            move: ls_dd04v-scrtext_m to ls_fcat-seltext_l,&lt;/P&gt;&lt;P&gt;                  ls_dd04v-domname   to l_dname.&lt;/P&gt;&lt;P&gt;          else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          Finally try to get info about domain&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            call function 'DDIF_DOMA_GET'&lt;/P&gt;&lt;P&gt;              exporting&lt;/P&gt;&lt;P&gt;                name          = ls_fcat-ref_fieldname&lt;/P&gt;&lt;P&gt;                langu         = sy-langu&lt;/P&gt;&lt;P&gt;              importing&lt;/P&gt;&lt;P&gt;                dd01v_wa      = ls_dd01v&lt;/P&gt;&lt;P&gt;              exceptions&lt;/P&gt;&lt;P&gt;                illegal_input = 1&lt;/P&gt;&lt;P&gt;                others        = 2.&lt;/P&gt;&lt;P&gt;            if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;              move-corresponding ls_dd01v to ls_fcat.&lt;/P&gt;&lt;P&gt;              move: ls_dd01v-ddtext  to ls_fcat-seltext_l,&lt;/P&gt;&lt;P&gt;                    ls_dd01v-domname to l_dname.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Table name must be internal table containing data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      ls_fcat-tabname = g_table.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    No offset&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      clear: ls_fcat-offset.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Default text is stored in long text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      if ls_fcat-ref_tabname is initial.&lt;/P&gt;&lt;P&gt;        ls_fcat-ddictxt = 'L'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Display Yes/No fields as checkboxes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      if l_dname = 'XFELD'.&lt;/P&gt;&lt;P&gt;        ls_fcat-checkbox = 'X'.&lt;/P&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;    Add field to field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      append ls_fcat to fcat.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Positions&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    loop at fcat into ls_fcat.&lt;/P&gt;&lt;P&gt;      ls_fcat-row_pos = 1.&lt;/P&gt;&lt;P&gt;      ls_fcat-col_pos = sy-tabix.&lt;/P&gt;&lt;P&gt;      modify fcat from ls_fcat transporting row_pos col_pos.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Link between fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    describe table fcat lines l_nbfld.&lt;/P&gt;&lt;P&gt;    loop at fcat into ls_fcat.&lt;/P&gt;&lt;P&gt;      if sy-tabix ne l_nbfld.&lt;/P&gt;&lt;P&gt;        l_index = sy-tabix + 1.&lt;/P&gt;&lt;P&gt;        read table fcat into ls_fcat2 index l_index.&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          if ls_fcat-datatype = 'CURR'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          Currency unit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if ls_fcat2-datatype = 'CUKY'.&lt;/P&gt;&lt;P&gt;              ls_fcat-cfieldname = ls_fcat2-fieldname.&lt;/P&gt;&lt;P&gt;              ls_fcat-ctabname   = ls_fcat2-tabname.&lt;/P&gt;&lt;P&gt;              modify fcat from ls_fcat.&lt;/P&gt;&lt;P&gt;            else.&lt;/P&gt;&lt;P&gt;              loop at fcat into ls_fcat2&lt;/P&gt;&lt;P&gt;                           from l_index&lt;/P&gt;&lt;P&gt;                          where datatype = 'CUKY'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              First currency unit after field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                ls_fcat-cfieldname = ls_fcat2-fieldname.&lt;/P&gt;&lt;P&gt;                ls_fcat-ctabname   = ls_fcat2-tabname.&lt;/P&gt;&lt;P&gt;                modify fcat from ls_fcat.&lt;/P&gt;&lt;P&gt;                exit.&lt;/P&gt;&lt;P&gt;              endloop.&lt;/P&gt;&lt;P&gt;              if sy-subrc ne 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              No currency unit after field, try before&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                read table fcat into ls_fcat2&lt;/P&gt;&lt;P&gt;                            with key datatype = 'CUKY'.&lt;/P&gt;&lt;P&gt;                if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;                  ls_fcat-cfieldname = ls_fcat2-fieldname.&lt;/P&gt;&lt;P&gt;                  ls_fcat-ctabname   = ls_fcat2-tabname.&lt;/P&gt;&lt;P&gt;                  modify fcat from ls_fcat.&lt;/P&gt;&lt;P&gt;                else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                Default is EURO&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                  ls_fcat-currency = 'EUR'.&lt;/P&gt;&lt;P&gt;                endif.&lt;/P&gt;&lt;P&gt;              endif.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;          if ls_fcat-datatype = 'QUAN'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;          Quantity unit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            if ls_fcat2-datatype = 'UNIT'.&lt;/P&gt;&lt;P&gt;              ls_fcat-cfieldname = ls_fcat2-fieldname.&lt;/P&gt;&lt;P&gt;              ls_fcat-ctabname   = ls_fcat2-tabname.&lt;/P&gt;&lt;P&gt;              modify fcat from ls_fcat.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "fill_fieldcat&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get definition of type from code source&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method get_definition.&lt;/P&gt;&lt;P&gt;    data: l_strng type rssource,&lt;/P&gt;&lt;P&gt;          ls_abap type rssource,&lt;/P&gt;&lt;P&gt;          l_fdpos type i,&lt;/P&gt;&lt;P&gt;          l_first type i,&lt;/P&gt;&lt;P&gt;          l_lastr type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: lt_incl type table of repid,&lt;/P&gt;&lt;P&gt;          ls_incl type repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get program code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    read report repid into abap.&lt;/P&gt;&lt;P&gt;    check sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get first line of definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    concatenate 'BEGIN OF' struc into l_strng&lt;/P&gt;&lt;P&gt;                            separated by space.&lt;/P&gt;&lt;P&gt;    loop at abap into ls_abap.&lt;/P&gt;&lt;P&gt;      if ls_abap cs l_strng.&lt;/P&gt;&lt;P&gt;        l_fdpos = strlen( l_strng ) + sy-fdpos.&lt;/P&gt;&lt;P&gt;        if ls_abap(1) = '*' or ls_abap(sy-fdpos) cs '"'.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        if ls_abap+l_fdpos(1) ca ',. "'.&lt;/P&gt;&lt;P&gt;          l_first = sy-tabix.&lt;/P&gt;&lt;P&gt;          exit.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;    if l_first is initial.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Table is defined in an include&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      call function 'RS_GET_ALL_INCLUDES'&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          program    = repid&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;          includetab = lt_incl&lt;/P&gt;&lt;P&gt;        exceptions&lt;/P&gt;&lt;P&gt;          others     = 1.&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        loop at lt_incl into ls_incl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        Try to find definition in this include&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          read report ls_incl into abap.&lt;/P&gt;&lt;P&gt;          loop at abap into ls_abap.&lt;/P&gt;&lt;P&gt;            if ls_abap cs l_strng.&lt;/P&gt;&lt;P&gt;              l_fdpos = strlen( l_strng ) + sy-fdpos.&lt;/P&gt;&lt;P&gt;              if ls_abap(1) = '*' or ls_abap(sy-fdpos) cs '"'.&lt;/P&gt;&lt;P&gt;                continue.&lt;/P&gt;&lt;P&gt;              endif.&lt;/P&gt;&lt;P&gt;              if ls_abap+l_fdpos(1) ca ',. "'.&lt;/P&gt;&lt;P&gt;                l_first = sy-tabix.&lt;/P&gt;&lt;P&gt;                exit.&lt;/P&gt;&lt;P&gt;              endif.&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endloop.&lt;/P&gt;&lt;P&gt;          if not l_first is initial.&lt;/P&gt;&lt;P&gt;            exit.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endloop.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&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;  Get last line of definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    concatenate 'END OF' struc into l_strng&lt;/P&gt;&lt;P&gt;                          separated by space.&lt;/P&gt;&lt;P&gt;    loop at abap into ls_abap.&lt;/P&gt;&lt;P&gt;      if ls_abap cs l_strng.&lt;/P&gt;&lt;P&gt;        l_fdpos = strlen( l_strng ) + sy-fdpos.&lt;/P&gt;&lt;P&gt;        if ls_abap(1) = '*' or ls_abap(sy-fdpos) cs '"'.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        if ls_abap+l_fdpos(1) ca ',. "'.&lt;/P&gt;&lt;P&gt;          l_lastr = sy-tabix - l_first.&lt;/P&gt;&lt;P&gt;          exit.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Keep only relevant code lines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if l_first le 0&lt;/P&gt;&lt;P&gt;    or l_lastr le 0.&lt;/P&gt;&lt;P&gt;      refresh abap.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      delete abap to l_first.&lt;/P&gt;&lt;P&gt;      delete abap from l_lastr.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.                    "get_definition&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get definition of type recursively&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method recursive_definition.&lt;/P&gt;&lt;P&gt;    data: lt_token type table of stokex,&lt;/P&gt;&lt;P&gt;          ls_token type stokex,&lt;/P&gt;&lt;P&gt;          lt_state type table of sstmnt,&lt;/P&gt;&lt;P&gt;          ls_state type sstmnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: ls_defin type ty_defin,&lt;/P&gt;&lt;P&gt;          l_reffld type fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    data: lt_recu  type rsfb_source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Retrieve tokens&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    scan abap-source abap&lt;/P&gt;&lt;P&gt;              tokens into lt_token&lt;/P&gt;&lt;P&gt;          statements into lt_state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at lt_state into ls_state.&lt;/P&gt;&lt;P&gt;      clear: ls_defin.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Field name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table lt_token into ls_token&lt;/P&gt;&lt;P&gt;                         index ls_state-from.&lt;/P&gt;&lt;P&gt;      ls_defin-fieldname = ls_token-str.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Reference type&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      read table lt_token into ls_token&lt;/P&gt;&lt;P&gt;                         index ls_state-to.&lt;/P&gt;&lt;P&gt;      l_reffld = ls_token-str.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Check if this type is defined in program&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      free: lt_recu.&lt;/P&gt;&lt;P&gt;      call method get_definition&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          repid = repid&lt;/P&gt;&lt;P&gt;          struc = l_reffld&lt;/P&gt;&lt;P&gt;        changing&lt;/P&gt;&lt;P&gt;          abap  = lt_recu.&lt;/P&gt;&lt;P&gt;      if lt_recu is initial.&lt;/P&gt;&lt;P&gt;        if not g_level is initial.&lt;/P&gt;&lt;P&gt;          concatenate g_level ls_defin-fieldname&lt;/P&gt;&lt;P&gt;                 into ls_defin-fieldname separated by '-'.&lt;/P&gt;&lt;P&gt;          condense ls_defin-fieldname.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        if l_reffld cs '-'.&lt;/P&gt;&lt;P&gt;          split l_reffld at '-'&lt;/P&gt;&lt;P&gt;                       into ls_defin-ref_tabname&lt;/P&gt;&lt;P&gt;                            ls_defin-ref_fieldname.&lt;/P&gt;&lt;P&gt;          if ls_defin-ref_tabname = 'SY'.&lt;/P&gt;&lt;P&gt;            ls_defin-ref_tabname = 'SYST'.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;          ls_defin-ref_fieldname = ls_token-str.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        append ls_defin to me-&amp;gt;gt_defin.&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Process sub levels&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        if me-&amp;gt;g_level is initial.&lt;/P&gt;&lt;P&gt;          me-&amp;gt;g_level = ls_defin-fieldname.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;          concatenate me-&amp;gt;g_level ls_defin-fieldname into me-&amp;gt;g_level&lt;/P&gt;&lt;P&gt;                                             separated by '-'.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        call method recursive_definition&lt;/P&gt;&lt;P&gt;          exporting&lt;/P&gt;&lt;P&gt;            repid = repid&lt;/P&gt;&lt;P&gt;          changing&lt;/P&gt;&lt;P&gt;            abap  = lt_recu.&lt;/P&gt;&lt;P&gt;        if me-&amp;gt;g_level cs '-'.&lt;/P&gt;&lt;P&gt;          shift me-&amp;gt;g_level right up to '-'.&lt;/P&gt;&lt;P&gt;          shift me-&amp;gt;g_level right.&lt;/P&gt;&lt;P&gt;          shift me-&amp;gt;g_level left deleting leading space.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;          clear: me-&amp;gt;g_level.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "recursive_definition&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get fieldcat&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method get_alv_fieldcat.&lt;/P&gt;&lt;P&gt;    out_fieldcat = me-&amp;gt;gt_fcat.&lt;/P&gt;&lt;P&gt;  endmethod.                    "get_alv_fieldcat&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set table name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_table_name.&lt;/P&gt;&lt;P&gt;    data: l_fcat type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into l_fcat.&lt;/P&gt;&lt;P&gt;      l_fcat-tabname = in_tabname.&lt;/P&gt;&lt;P&gt;      modify me-&amp;gt;gt_fcat from l_fcat.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;    me-&amp;gt;g_table = in_tabname.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_table_name&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set title&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_title.&lt;/P&gt;&lt;P&gt;    me-&amp;gt;g_title = in_title.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_title&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set fieldcat&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_fieldcat.&lt;/P&gt;&lt;P&gt;    me-&amp;gt;gt_fcat = in_fieldcat.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_fieldcat&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set field invisible&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_fieldnoout.&lt;/P&gt;&lt;P&gt;    data: l_field type fieldname,&lt;/P&gt;&lt;P&gt;          l_noout type c,&lt;/P&gt;&lt;P&gt;          l_tech  type c,&lt;/P&gt;&lt;P&gt;          ls_fcat type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_field = in_field.&lt;/P&gt;&lt;P&gt;    if in_noout is supplied.&lt;/P&gt;&lt;P&gt;      l_noout = in_noout.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      l_noout = 'X'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if in_tech is supplied.&lt;/P&gt;&lt;P&gt;      l_tech = in_tech.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                       where fieldname = l_field.&lt;/P&gt;&lt;P&gt;      ls_fcat-no_out = l_noout.&lt;/P&gt;&lt;P&gt;      ls_fcat-tech   = l_tech.&lt;/P&gt;&lt;P&gt;      modify gt_fcat from ls_fcat transporting no_out tech.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_fieldnoout&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set field editable&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_fieldedit.&lt;/P&gt;&lt;P&gt;    data: l_field type fieldname,&lt;/P&gt;&lt;P&gt;          l_edit  type c,&lt;/P&gt;&lt;P&gt;          ls_fcat type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_field = in_field.&lt;/P&gt;&lt;P&gt;    if in_edit is supplied.&lt;/P&gt;&lt;P&gt;      l_edit = in_edit.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      l_edit = 'X'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                       where fieldname = l_field.&lt;/P&gt;&lt;P&gt;      ls_fcat-edit = l_edit.&lt;/P&gt;&lt;P&gt;      modify gt_fcat from ls_fcat transporting edit.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_fieldedit&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set field text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_fieldtext.&lt;/P&gt;&lt;P&gt;    data: l_field type fieldname,&lt;/P&gt;&lt;P&gt;          ls_fcat type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_field = in_field.&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                       where fieldname = l_field.&lt;/P&gt;&lt;P&gt;      ls_fcat-seltext_m = in_ftext.&lt;/P&gt;&lt;P&gt;      ls_fcat-ddictxt = 'M'.&lt;/P&gt;&lt;P&gt;      modify gt_fcat from ls_fcat transporting seltext_m ddictxt.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_fieldtext&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set field sum&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_fieldsum.&lt;/P&gt;&lt;P&gt;    data: l_field type fieldname,&lt;/P&gt;&lt;P&gt;          l_dosum type c,&lt;/P&gt;&lt;P&gt;          ls_fcat type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_field = in_field.&lt;/P&gt;&lt;P&gt;    if in_dosum is supplied.&lt;/P&gt;&lt;P&gt;      l_dosum = in_dosum.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      l_dosum = 'X'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                       where fieldname = l_field.&lt;/P&gt;&lt;P&gt;      ls_fcat-do_sum = l_dosum.&lt;/P&gt;&lt;P&gt;      modify gt_fcat from ls_fcat transporting do_sum.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_fieldsum&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set line break in field catalog&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_linebreak.&lt;/P&gt;&lt;P&gt;    data: l_field type fieldname,&lt;/P&gt;&lt;P&gt;          ls_fcat type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;          l_tabix type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    l_field = in_field.&lt;/P&gt;&lt;P&gt;    read table me-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                       with key fieldname = l_field.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      l_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      exit.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into ls_fcat&lt;/P&gt;&lt;P&gt;                        from l_tabix.&lt;/P&gt;&lt;P&gt;      ls_fcat-row_pos = ls_fcat-row_pos + 1.&lt;/P&gt;&lt;P&gt;      modify gt_fcat from ls_fcat transporting row_pos.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_linebreak&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set settings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_settings.&lt;/P&gt;&lt;P&gt;    call method map_structure&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        source = in_settings&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        destin = me-&amp;gt;gs_sett.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_settings&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set layout&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_layout.&lt;/P&gt;&lt;P&gt;    call method map_structure&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        source = in_layout&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        destin = me-&amp;gt;gs_layo.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_layout&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set printing options&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_print.&lt;/P&gt;&lt;P&gt;    call method map_structure&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        source = in_print&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        destin = me-&amp;gt;gs_prin.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_print&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set sortings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_sorting.&lt;/P&gt;&lt;P&gt;    data: l_desc   type alvdynp-sortdown,&lt;/P&gt;&lt;P&gt;          l_group  type alvdynp-grouplevel,&lt;/P&gt;&lt;P&gt;          l_subtot type alvdynp-subtotals.&lt;/P&gt;&lt;P&gt;    data: ls_sort  type slis_sortinfo_alv,&lt;/P&gt;&lt;P&gt;          l_index  type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if in_desc is supplied.&lt;/P&gt;&lt;P&gt;      l_desc = in_desc.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if in_group is supplied.&lt;/P&gt;&lt;P&gt;      l_group = in_group.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      l_group = '*'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    if in_subtot is supplied.&lt;/P&gt;&lt;P&gt;      l_subtot = in_subtot.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      l_subtot = 'X'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    describe table me-&amp;gt;gt_sort lines l_index.&lt;/P&gt;&lt;P&gt;    l_index = l_index + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ls_sort-spos = l_index.&lt;/P&gt;&lt;P&gt;    ls_sort-fieldname = in_field.&lt;/P&gt;&lt;P&gt;    ls_sort-tabname = me-&amp;gt;g_table.&lt;/P&gt;&lt;P&gt;    if l_desc is initial.&lt;/P&gt;&lt;P&gt;      ls_sort-up = 'X'.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      ls_sort-down = 'X'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    ls_sort-group = l_group.&lt;/P&gt;&lt;P&gt;    ls_sort-subtot = l_subtot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    append ls_sort to me-&amp;gt;gt_sort.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_sorting&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set key fields&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_keys.&lt;/P&gt;&lt;P&gt;    data: l_key   type c,&lt;/P&gt;&lt;P&gt;          ls_fcat type slis_fieldcat_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    if in_key is supplied.&lt;/P&gt;&lt;P&gt;      l_key = in_key.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      l_key = 'X'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    loop at me-&amp;gt;gt_fcat into ls_fcat from 1 to in_level.&lt;/P&gt;&lt;P&gt;      ls_fcat-key = l_key.&lt;/P&gt;&lt;P&gt;      modify gt_fcat from ls_fcat transporting key.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_keys&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Add event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_alv_event.&lt;/P&gt;&lt;P&gt;    data: ls_evnt type slis_alv_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at gt_evnt into ls_evnt&lt;/P&gt;&lt;P&gt;                   where name = in_name.&lt;/P&gt;&lt;P&gt;      ls_evnt-form = in_form.&lt;/P&gt;&lt;P&gt;      modify gt_evnt from ls_evnt transporting form.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;    if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;      ls_evnt-name = in_name.&lt;/P&gt;&lt;P&gt;      ls_evnt-form = in_form.&lt;/P&gt;&lt;P&gt;      append ls_evnt to gt_evnt.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_alv_event&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Add event&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method set_all_events.&lt;/P&gt;&lt;P&gt;    data: lt_trig type table of rtrig,&lt;/P&gt;&lt;P&gt;          ls_evnt 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     = g_table_type&lt;/P&gt;&lt;P&gt;      importing&lt;/P&gt;&lt;P&gt;        et_events       = gt_evnt&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        list_type_wrong = 1&lt;/P&gt;&lt;P&gt;        others          = 2.&lt;/P&gt;&lt;P&gt;    if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Get program form routines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      load report g_repid part 'TRIG' into lt_trig.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    List of valid form routines&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      loop at gt_evnt into ls_evnt.&lt;/P&gt;&lt;P&gt;        concatenate 'F_' ls_evnt-name into ls_evnt-form.&lt;/P&gt;&lt;P&gt;        if not g_block_mode is initial.&lt;/P&gt;&lt;P&gt;          concatenate ls_evnt-form me-&amp;gt;g_table into ls_evnt-form&lt;/P&gt;&lt;P&gt;                                       separated by '_'.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;        read table lt_trig with key exto  = ls_evnt-form&lt;/P&gt;&lt;P&gt;                                    fform = 'X'&lt;/P&gt;&lt;P&gt;                       transporting no fields.&lt;/P&gt;&lt;P&gt;        if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          modify gt_evnt from ls_evnt transporting form.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;          delete gt_evnt.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endmethod.                    "set_all_events&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Map fields from incoming structure into attribute&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method map_structure.&lt;/P&gt;&lt;P&gt;    data: ob_desc  type ref to cl_abap_structdescr,&lt;/P&gt;&lt;P&gt;          ls_compo type abap_compdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    field-symbols: .&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endmethod.                    "map_structure&lt;/P&gt;&lt;P&gt;***&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get default variant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;***&lt;/P&gt;&lt;P&gt;  method get_default_variant.&lt;/P&gt;&lt;P&gt;    g_variant_level = g_variant_level + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    out_variant-report   = me-&amp;gt;g_repid.&lt;/P&gt;&lt;P&gt;    out_variant-handle   = me-&amp;gt;g_variant_level.&lt;/P&gt;&lt;P&gt;    out_variant-username = sy-uname.&lt;/P&gt;&lt;P&gt;    call function 'REUSE_ALV_VARIANT_DEFAULT_GET'&lt;/P&gt;&lt;P&gt;      exporting&lt;/P&gt;&lt;P&gt;        i_save     = 'U'&lt;/P&gt;&lt;P&gt;      changing&lt;/P&gt;&lt;P&gt;        cs_variant = out_variant&lt;/P&gt;&lt;P&gt;      exceptions&lt;/P&gt;&lt;P&gt;        others     = 0.&lt;/P&gt;&lt;P&gt;  endmethod.                    "get_default_variant&lt;/P&gt;&lt;P&gt;endclass.                    "lcl_table_display IMPLEMENTATION&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;HR originaltext="------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT BALVHT01 NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TYPE-POOLS: SLIS.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DB-Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES: SCARR, SPFLI.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Includes&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCLUDE .&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.&lt;/P&gt;&lt;P&gt;DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,&lt;/P&gt;&lt;P&gt;GS_LAYOUT TYPE SLIS_LAYOUT_ALV,&lt;/P&gt;&lt;P&gt;GS_KEYINFO TYPE SLIS_KEYINFO_ALV,&lt;/P&gt;&lt;P&gt;GT_SORT TYPE SLIS_T_SORTINFO_ALV,&lt;/P&gt;&lt;P&gt;GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,&lt;/P&gt;&lt;P&gt;GT_EVENTS TYPE SLIS_T_EVENT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Data to be displayed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF GT_SPFLI OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE SPFLI.&lt;/P&gt;&lt;P&gt;DATA: ADD1,&lt;/P&gt;&lt;P&gt;BOX,&lt;/P&gt;&lt;P&gt;WERT TYPE P,&lt;/P&gt;&lt;P&gt;LIGHTS.&lt;/P&gt;&lt;P&gt;DATA: END OF GT_SPFLI.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF GT_SCARR OCCURS 0.&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE SCARR.&lt;/P&gt;&lt;P&gt;DATA: BOX,&lt;/P&gt;&lt;P&gt;LIGHTS,&lt;/P&gt;&lt;P&gt;EXPAND.&lt;/P&gt;&lt;P&gt;DATA: END OF GT_SCARR.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;DATA: G_REPID LIKE SY-REPID.&lt;/P&gt;&lt;P&gt;DATA: GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Report Selections&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT-OPTIONS CARRID FOR SCARR-CARRID.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN SKIP 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Parameters&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PARAMETERS: P_MAXROW TYPE I DEFAULT 50.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN SKIP 1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variante&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK 0 WITH FRAME TITLE TEXT-064.&lt;/P&gt;&lt;P&gt;PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Layout&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-060.&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;P_ZEBRA AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_NOCOLH AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_COLOPT AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_KEYHOT AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_NOINPT AS CHECKBOX DEFAULT ' '.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK A.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-061.&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;P_LIGHTS AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_LIGHTC AS CHECKBOX DEFAULT ' '.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK B.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK C WITH FRAME TITLE TEXT-062.&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;P_TOTONL AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_TOTEXT(60),&lt;/P&gt;&lt;P&gt;P_STTEXT(60).&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK C.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK D WITH FRAME TITLE TEXT-063.&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;P_GPCE AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_CHKBOX AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_EXPAND AS CHECKBOX DEFAULT ' ',&lt;/P&gt;&lt;P&gt;P_DETPOP AS CHECKBOX DEFAULT ' '.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK D.&lt;/P&gt;&lt;P&gt;DATA: G_BOXNAM TYPE SLIS_FIELDNAME VALUE 'BOX',&lt;/P&gt;&lt;P&gt;G_EXPANDNAME TYPE SLIS_FIELDNAME VALUE 'EXPAND',&lt;/P&gt;&lt;P&gt;P_F2CODE LIKE SY-UCOMM VALUE '&amp;amp;ETA',&lt;/P&gt;&lt;P&gt;P_LIGNAM TYPE SLIS_FIELDNAME VALUE 'LIGHTS',&lt;/P&gt;&lt;P&gt;G_SAVE(1) TYPE C,&lt;/P&gt;&lt;P&gt;G_TABNAME_HEADER TYPE SLIS_TABNAME,&lt;/P&gt;&lt;P&gt;G_TABNAME_ITEM TYPE SLIS_TABNAME,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;g_default(1) type c,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;G_EXIT(1) TYPE C,&lt;/P&gt;&lt;P&gt;GX_VARIANT LIKE DISVARIANT,&lt;/P&gt;&lt;P&gt;G_VARIANT LIKE DISVARIANT.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;G_REPID = SY-REPID.&lt;/P&gt;&lt;P&gt;G_TABNAME_HEADER = 'GT_SCARR'.&lt;/P&gt;&lt;P&gt;G_TABNAME_ITEM = 'GT_SPFLI'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;define keyinfo&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR GS_KEYINFO.&lt;/P&gt;&lt;P&gt;GS_KEYINFO-HEADER01 = 'CARRID'.&lt;/P&gt;&lt;P&gt;GS_KEYINFO-ITEM01 = 'CARRID'.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;PERFORM E01_FIELDCAT_INIT USING GT_FIELDCAT[].&lt;/P&gt;&lt;P&gt;PERFORM E03_EVENTTAB_BUILD USING GT_EVENTS[].&lt;/P&gt;&lt;P&gt;PERFORM E04_COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].&lt;/P&gt;&lt;P&gt;PERFORM E06_T_SORT_BUILD USING GT_SORT[].&lt;/P&gt;&lt;P&gt;PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Schalter Varianten benutzerspezifisch/allgemein speicherbar setzen&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set Options: save variants userspecific or general&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;G_SAVE = 'A'.&lt;/P&gt;&lt;P&gt;PERFORM VARIANT_INIT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get default variant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;GX_VARIANT = G_VARIANT.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_SAVE = G_SAVE&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;CS_VARIANT = GX_VARIANT&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_FOUND = 2.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;P_VARI = GX_VARIANT-VARIANT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Process on value request&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.&lt;/P&gt;&lt;P&gt;PERFORM F4_FOR_VARIANT.&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;PAI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;PERFORM PAI_OF_SELECTION_SCREEN.&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;PERFORM SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;PERFORM E05_LAYOUT_BUILD USING GS_LAYOUT. "wg. Parameters&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call ABAP/4 List Viewer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_CALLBACK_PROGRAM = G_REPID&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_CALLBACK_PF_STATUS_SET = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_CALLBACK_USER_COMMAND = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IS_LAYOUT = GS_LAYOUT&lt;/P&gt;&lt;P&gt;IT_FIELDCAT = GT_FIELDCAT[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IT_EXCLUDING =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IT_SPECIAL_GROUPS = GT_SP_GROUP[]&lt;/P&gt;&lt;P&gt;IT_SORT = GT_SORT[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IT_FILTER =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IS_SEL_HIDE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_SCREEN_START_COLUMN = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_SCREEN_START_LINE = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_SCREEN_END_COLUMN = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_SCREEN_END_LINE = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;i_default = g_default&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I_SAVE = G_SAVE&lt;/P&gt;&lt;P&gt;IS_VARIANT = G_VARIANT&lt;/P&gt;&lt;P&gt;IT_EVENTS = GT_EVENTS[]&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IT_EVENT_EXIT =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I_TABNAME_HEADER = G_TABNAME_HEADER&lt;/P&gt;&lt;P&gt;I_TABNAME_ITEM = G_TABNAME_ITEM&lt;/P&gt;&lt;P&gt;IS_KEYINFO = GS_KEYINFO&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IS_PRINT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;E_EXIT_CAUSED_BY_CALLER =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;T_OUTTAB_HEADER = GT_SCARR&lt;/P&gt;&lt;P&gt;T_OUTTAB_ITEM = GT_SPFLI.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E01_FIELDCAT_INIT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; E01_LT_FIELDCAT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E01_FIELDCAT_INIT USING E01_LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CLEAR LS_FIELDCAT.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-FIELDNAME = 'ADD1'.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-TABNAME = G_TABNAME_ITEM.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-REPTEXT_DDIC = '?'.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-OUTPUTLEN = 1.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-NO_OUT = 'X'.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-INPUT = 'X'.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-SP_GROUP = 'A'.&lt;/P&gt;&lt;P&gt;APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_PROGRAM_NAME =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I_INTERNAL_TABNAME = G_TABNAME_HEADER&lt;/P&gt;&lt;P&gt;I_STRUCTURE_NAME = 'SCARR'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_CLIENT_NEVER_DISPLAY = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;CT_FIELDCAT = E01_LT_FIELDCAT[].&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_PROGRAM_NAME =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I_INTERNAL_TABNAME = G_TABNAME_ITEM&lt;/P&gt;&lt;P&gt;I_STRUCTURE_NAME = 'SPFLI'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_CLIENT_NEVER_DISPLAY = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;CT_FIELDCAT = E01_LT_FIELDCAT[].&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;geht am Anfang nicht !!!!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR LS_FIELDCAT.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-FIELDNAME = 'WERT'.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-TABNAME = G_TABNAME_ITEM.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-REPTEXT_DDIC = 'Wert'(070).&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-OUTPUTLEN = 4.&lt;/P&gt;&lt;P&gt;LS_FIELDCAT-INTTYPE ='P'.&lt;/P&gt;&lt;P&gt;APPEND LS_FIELDCAT TO E01_LT_FIELDCAT.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E02_DATA_ADD *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; E02_LT_SFLIGHT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E02_DATA_ADD TABLES E02_LT_SPFLI STRUCTURE GT_SPFLI.&lt;/P&gt;&lt;P&gt;LOOP AT E02_LT_SPFLI.&lt;/P&gt;&lt;P&gt;IF SY-TABIX &amp;gt; 10.&lt;/P&gt;&lt;P&gt;E02_LT_SPFLI-ADD1 = 'A'.&lt;/P&gt;&lt;P&gt;E02_LT_SPFLI-BOX = 'X'.&lt;/P&gt;&lt;P&gt;E02_LT_SPFLI-LIGHTS = '3'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;IF SY-TABIX = 1.&lt;/P&gt;&lt;P&gt;E02_LT_SPFLI-LIGHTS = '2'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;E02_LT_SPFLI-LIGHTS = '1'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;E02_LT_SPFLI-WERT = SY-TABIX MOD 5.&lt;/P&gt;&lt;P&gt;MODIFY E02_LT_SPFLI.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E03_EVENTTAB_BUILD *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; E03_LT_EVENTS *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E03_EVENTTAB_BUILD USING E03_LT_EVENTS TYPE SLIS_T_EVENT.&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 = 1&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;ET_EVENTS = E03_LT_EVENTS.&lt;/P&gt;&lt;P&gt;READ TABLE E03_LT_EVENTS 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 GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.&lt;/P&gt;&lt;P&gt;APPEND LS_EVENT TO E03_LT_EVENTS.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E04_COMMENT_BUILD *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; E04_LT_TOP_OF_PAGE *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E04_COMMENT_BUILD USING E04_LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.&lt;/P&gt;&lt;P&gt;DATA: LS_LINE TYPE SLIS_LISTHEADER.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Listenüberschrift: Typ H&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR LS_LINE.&lt;/P&gt;&lt;P&gt;LS_LINE-TYP = 'H'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LS_LINE-KEY: not used for this type&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LS_LINE-INFO = TEXT-001.&lt;/P&gt;&lt;P&gt;APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Kopfinfo: Typ S&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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 = TEXT-050.&lt;/P&gt;&lt;P&gt;LS_LINE-INFO = TEXT-010.&lt;/P&gt;&lt;P&gt;APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.&lt;/P&gt;&lt;P&gt;LS_LINE-KEY = TEXT-051.&lt;/P&gt;&lt;P&gt;APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Aktionsinfo: Typ A&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CLEAR LS_LINE.&lt;/P&gt;&lt;P&gt;LS_LINE-TYP = 'A'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LS_LINE-KEY: not used for this type&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LS_LINE-INFO = TEXT-002.&lt;/P&gt;&lt;P&gt;APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E05_LAYOUT_BUILD *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;-&amp;gt; E05_LS_LAYOUT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E05_LAYOUT_BUILD USING E05_LS_LAYOUT TYPE SLIS_LAYOUT_ALV.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-F2CODE = P_F2CODE.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-ZEBRA = P_ZEBRA.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-COLWIDTH_OPTIMIZE = P_COLOPT.&lt;/P&gt;&lt;P&gt;IF P_CHKBOX = 'X'.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-BOX_FIELDNAME = G_BOXNAM.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-BOX_TABNAME = G_TABNAME_ITEM.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CLEAR E05_LS_LAYOUT-BOX_FIELDNAME.&lt;/P&gt;&lt;P&gt;CLEAR E05_LS_LAYOUT-BOX_TABNAME.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF P_EXPAND = 'X'.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-EXPAND_FIELDNAME = G_EXPANDNAME.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CLEAR E05_LS_LAYOUT-EXPAND_FIELDNAME.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-NO_INPUT = P_NOINPT.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-NO_COLHEAD = P_NOCOLH.&lt;/P&gt;&lt;P&gt;IF P_LIGHTS = 'X' OR P_LIGHTC = 'X'.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-LIGHTS_FIELDNAME = P_LIGNAM.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-LIGHTS_TABNAME = G_TABNAME_ITEM.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;CLEAR E05_LS_LAYOUT-LIGHTS_FIELDNAME.&lt;/P&gt;&lt;P&gt;CLEAR E05_LS_LAYOUT-LIGHTS_TABNAME.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;IF P_GPCE = 'X'.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-GROUP_CHANGE_EDIT = 'X'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-LIGHTS_CONDENSE = P_LIGHTC.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-TOTALS_TEXT = P_TOTEXT.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-SUBTOTALS_TEXT = P_STTEXT.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-TOTALS_ONLY = P_TOTONL.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-KEY_HOTSPOT = P_KEYHOT.&lt;/P&gt;&lt;P&gt;E05_LS_LAYOUT-DETAIL_POPUP = P_DETPOP.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E06_T_SORT_BUILD *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; E06_LT_SORT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E06_T_SORT_BUILD USING E06_LT_SORT TYPE SLIS_T_SORTINFO_ALV.&lt;/P&gt;&lt;P&gt;DATA: LS_SORT TYPE SLIS_SORTINFO_ALV.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CLEAR LS_SORT.&lt;/P&gt;&lt;P&gt;LS_SORT-FIELDNAME = 'CARRID'.&lt;/P&gt;&lt;P&gt;LS_SORT-TABNAME = G_TABNAME_HEADER.&lt;/P&gt;&lt;P&gt;LS_SORT-SPOS = 1.&lt;/P&gt;&lt;P&gt;LS_SORT-UP = 'X'.&lt;/P&gt;&lt;P&gt;APPEND LS_SORT TO E06_LT_SORT.&lt;/P&gt;&lt;P&gt;CLEAR LS_SORT.&lt;/P&gt;&lt;P&gt;LS_SORT-FIELDNAME = 'CONNID'.&lt;/P&gt;&lt;P&gt;LS_SORT-TABNAME = G_TABNAME_ITEM.&lt;/P&gt;&lt;P&gt;LS_SORT-SPOS = 2.&lt;/P&gt;&lt;P&gt;LS_SORT-DOWN = 'X'.&lt;/P&gt;&lt;P&gt;APPEND LS_SORT TO E06_LT_SORT.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM E07_SP_GROUP_BUILD *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; E07_LT_SP_GROUP *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.&lt;/P&gt;&lt;P&gt;DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CLEAR LS_SP_GROUP.&lt;/P&gt;&lt;P&gt;LS_SP_GROUP-SP_GROUP = 'A'.&lt;/P&gt;&lt;P&gt;LS_SP_GROUP-TEXT = TEXT-005.&lt;/P&gt;&lt;P&gt;APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM SELECTION *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM SELECTION.&lt;/P&gt;&lt;P&gt;SELECT * FROM SCARR INTO CORRESPONDING FIELDS OF TABLE GT_SCARR&lt;/P&gt;&lt;P&gt;WHERE CARRID IN CARRID.&lt;/P&gt;&lt;P&gt;SELECT * FROM SPFLI INTO CORRESPONDING FIELDS OF TABLE GT_SPFLI&lt;/P&gt;&lt;P&gt;UP TO P_MAXROW ROWS&lt;/P&gt;&lt;P&gt;WHERE CARRID IN CARRID.&lt;/P&gt;&lt;P&gt;LOOP AT GT_SCARR.&lt;/P&gt;&lt;P&gt;READ TABLE GT_SPFLI WITH KEY CARRID = GT_SCARR-CARRID.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC NE 0.&lt;/P&gt;&lt;P&gt;DELETE GT_SCARR.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;PERFORM E02_DATA_ADD TABLES GT_SPFLI.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM TOP_OF_PAGE *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&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_LIST_TOP_OF_PAGE.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM F4_FOR_VARIANT *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;........ *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM F4_FOR_VARIANT.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_VARIANT_F4'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;IS_VARIANT = G_VARIANT&lt;/P&gt;&lt;P&gt;I_SAVE = G_SAVE&lt;/P&gt;&lt;P&gt;I_TABNAME_HEADER = G_TABNAME_HEADER&lt;/P&gt;&lt;P&gt;I_TABNAME_ITEM = G_TABNAME_ITEM&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;it_default_fieldcat =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;E_EXIT = G_EXIT&lt;/P&gt;&lt;P&gt;ES_VARIANT = GX_VARIANT&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_FOUND = 2.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 2.&lt;/P&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;IF G_EXIT = SPACE.&lt;/P&gt;&lt;P&gt;P_VARI = GX_VARIANT-VARIANT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.&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 PAI_OF_SELECTION_SCREEN&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM PAI_OF_SELECTION_SCREEN.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;IF NOT P_VARI IS INITIAL.&lt;/P&gt;&lt;P&gt;MOVE G_VARIANT TO GX_VARIANT.&lt;/P&gt;&lt;P&gt;MOVE P_VARI TO GX_VARIANT-VARIANT.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_SAVE = G_SAVE&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;CS_VARIANT = GX_VARIANT.&lt;/P&gt;&lt;P&gt;G_VARIANT = GX_VARIANT.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;PERFORM VARIANT_INIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM. " PAI_OF_SELECTION_SCREEN&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 VARIANT_INIT&lt;/P&gt;&lt;P&gt;*&amp;amp;----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; p1 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;-- p2 text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FORM VARIANT_INIT.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;CLEAR G_VARIANT.&lt;/P&gt;&lt;P&gt;G_VARIANT-REPORT = G_REPID.&lt;/P&gt;&lt;P&gt;ENDFORM. " VARIANT_INIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2007 07:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499080#M564562</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-21T07:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding  ALV Grid  Control using OOPs concepts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499081#M564563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i wld  like to  thank you first for sharing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in my alv grid  , i need these functionalities, let  me  knw how  can i do get them...., pls  can u provide the  code  if at all u can...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;If Insert Row button of Screen 1000/1001 was clicked:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    If the Insert Row button was clicked the ALV grid is displayed to the user but with no content. But the ALV grid is constructed to have the same structure of the corresponding Z table following the respective transaction as mentioned above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;If Maintain Entries button of Screen 1000/1001 was clicked:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	If the Maintain Entries Button was clicked, then the ALV grid is displayed with the database entries based on the Selection Criteria for the Z tables. These are also loaded into the internal table IT_TAB_ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; There are various options provided in the Screen 1002 to facilitate the user to maintain the Z tables.&lt;/P&gt;&lt;P&gt;They are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Insert row:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserts a row in the ALV grid. The row index of the row that has been inserted is loaded into the internal table IT_TAB_ROW_INDEX. When a row is inserted, all the entries are blank except the Costing Version. This entry is internally filled by the program using the value Z_GL_ALLOC_PLAN_VERSN from the TVARVC table and this field is set as disabled in the ALV grid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Select All&amp;lt;/u&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select All button when clicked selects all the rows that have been displayed in the ALV grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Deselect All:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deselect All button when clicked deselects all the rows that have been selected previously.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Save:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) When the save button is clicked the user is prompted with the confirmation to save the data.&lt;/P&gt;&lt;P&gt;2) If the user agrees to save the data then the rows then the changes are updated to the database. This can be identified by the rows that have been selected for change mode (on which the lock icon is present). The lock icons will be removed, the changes will be reflected in the database and the rows are displayed in the display mode. The internal table IT_TAB_ROW_INDEX is looped to fetch the row index and then the row details are fetched from the ALV grid. These row details are loaded into the internal table IT_TAB_ROWS. If the row already exists in the internal table then the row is modified, and the field CHANGED is marked as &amp;#145;X&amp;#146;. If the entry does not exist, then a new row is inserted into the internal table IT_TAB_ROWS and the INSERTED field is marked as &amp;#145;X&amp;#146;. Now the internal table IT_TAB_ROWS is looped to select the rows with CHANGED field as marked. These rows are inserted into the Z table, and the rows with INSERTED &amp;#145;X&amp;#146; is selected and they are inserted into the Z table.&lt;/P&gt;&lt;P&gt;3)  If the user rejects the save option then, discard the changes made, remove the lock icons and display the rows in display mode.&lt;/P&gt;&lt;P&gt;4) The rows which are newly inserted are also saved to the database after validating them with the database entries.&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;#61656;&amp;lt;u&amp;gt;Change/Display:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Change:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)When row/rows are selected and Change option is clicked then, locking is applied for the particular row/rows in the Z table.&lt;/P&gt;&lt;P&gt;2)If the locking succeeds, a lock icon appears near the row/rows and the Savings% fields of the row/rows are activated in change mode. The row indexes of the rows are stored in the internal table IT_TAB_ROW_INDEX.&lt;/P&gt;&lt;P&gt;3)If the locking fails for the row then, a message is displayed in the Status bar stating &amp;#147;Locking failed for the row(s) selected&amp;#148; and the row/ rows selected are in display mode only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;u&amp;gt;Display:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)When row/rows are selected and the Display option is clicked then, the user is prompted for a Save of the data. &lt;/P&gt;&lt;P&gt;2)If the user, confirms the Save, then the changes are accepted, the lock icons are removed from the row/rows and the row/rows are activated in display mode with the updated data. Follow the same logic used in the Save button.&lt;/P&gt;&lt;P&gt;3)If the user rejects the Save, then the changes are discarded, the lock icons are removed and the row/rows are activated in display mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Delete:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;When the row/rows selected needs to be deleted, then the Delete button is clicked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the delete button is clicked, user is given a pop up which says that locking has been applied to the row/rows and he/she needs to click the delete button again to delete the records. A lock icon appears near the row/rows for which locking was successful. These row/rows will be selected. The indexes of the row/rows are loaded into the internal table IT_TAB_ROW_INDEX. When the user clicks the delete button again, the rows for which the lock icon appeared will be deleted. This is done by loading the indexes of the row/rows into the internal table IT_TAB_ROW_INDEX. The internal table is looped and the row details are fetched from the ALV grid. For this row in the internal table IT_TAB_ROWS the DELETED field is marked as &amp;#145;X&amp;#146;. The records which has &amp;#145;X&amp;#146; marked in DELETED field are selected and they are deleted from the Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;#61656;&amp;lt;u&amp;gt;Sort:&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;P&gt;Selecting the column and clicking the sort button will enable the data to be sorted based on the column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 14:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-alv-grid-control-using-oops-concepts/m-p/2499081#M564563</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T14:27:32Z</dc:date>
    </item>
  </channel>
</rss>

