<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cl_gui_alv_grid &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/cl_gui_alv_grid/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sapewmhelp.com</link>
	<description>SAP EWM questions answered by experts — ABAP, S/4HANA, warehouse management</description>
	<lastBuildDate>Sun, 14 Sep 2025 20:01:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>What is CL_GUI_ALV_GRID?</title>
		<link>https://www.sapewmhelp.com/question/what-is-cl_gui_alv_grid/</link>
					<comments>https://www.sapewmhelp.com/question/what-is-cl_gui_alv_grid/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Sun, 14 Sep 2025 20:01:24 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=what-is-cl_gui_alv_grid</guid>

					<description><![CDATA[It’s an ABAP OO class that displays data in a grid (table-like format) inside a screen container. Unlike the simpler CL_SALV_TABLE, this grid is fully interactive and customizable. Main Features Editable cells → You can let users change data directly in the grid. Field catalog → You define which columns to show, their titles, and [&#8230;]]]></description>
										<content:encoded><![CDATA[<ul>
<li>
<p>It’s an <strong>ABAP OO class</strong> that displays data in a <strong>grid (table-like format)</strong> inside a screen container.</p>
</li>
<li>
<p>Unlike the simpler <code>CL_SALV_TABLE</code>, this grid is <strong>fully interactive and customizable</strong>.</p>
</li>
</ul>
<p>Main Features</p>
<ol>
<li>
<p><strong>Editable cells</strong> → You can let users change data directly in the grid.</p>
</li>
<li>
<p><strong>Field catalog</strong> → You define which columns to show, their titles, and if they’re editable.</p>
</li>
<li>
<p><strong>Layout control</strong> → Zebra patterns, column widths, key columns, hotspots, etc.</p>
</li>
<li>
<p><strong>Events</strong> → You can react to user actions (e.g., double-click, toolbar buttons, cell value changes).</p>
</li>
<li>
<p><strong>Container-based</strong> → You need a custom control on a dynpro (screen) to host the ALV Grid.</p>
</li>
</ol>
<p>How it Works (Step-by-Step Flow)</p>
<ol>
<li>
<p><strong>Create a Screen (Dynpro)</strong></p>
<ul>
<li>
<p>Add a <strong>Custom Control</strong> (like a placeholder on the screen).</p>
</li>
<li>
<p>Give it a name, e.g., <code>CC_ALV</code>.</p>
</li>
</ul>
</li>
<li>
<p><strong>Create Container</strong></p>
<ul>
<li>
<p>In your program, create an object of class <code>CL_GUI_CUSTOM_CONTAINER</code> linked to <code>CC_ALV</code>.</p>
</li>
<li>
<p>This is the &#8220;holder&#8221; where the ALV will appear.</p>
</li>
</ul>
</li>
<li>
<p><strong>Create ALV Grid</strong></p>
<ul>
<li>
<p>Instantiate <code>CL_GUI_ALV_GRID</code> using the container as its parent.</p>
</li>
</ul>
</li>
<li>
<p><strong>Build Field Catalog</strong></p>
<ul>
<li>
<p>Define column properties (<code>FIELDNAME</code>, <code>SELTEXT_M</code>, <code>EDIT</code>, etc.).</p>
</li>
<li>
<p>Each entry describes how a column is shown in the ALV grid.</p>
</li>
</ul>
</li>
<li>
<p><strong>Pass Data to ALV</strong></p>
<ul>
<li>
<p>Call method <code>set_table_for_first_display</code> with your internal table (<code>IT_OUTTAB</code>) and the field catalog.</p>
</li>
</ul>
</li>
<li>
<p><strong>Display Grid</strong></p>
<ul>
<li>
<p>The ALV Grid now shows inside the screen.</p>
</li>
<li>
<p>Users can scroll, filter, sort, and (if allowed) edit data.</p>
</li>
</ul>
</li>
</ol>
<p>&nbsp;</p>
<p>Steps to Implement <code>CL_GUI_ALV_GRID</code></p>
<h3 data-start="182" data-end="223">1. Create a Screen (e.g., Screen 100)</h3>
<ul>
<li>
<p>Go to SE80 → your program → create a screen (No. 100).</p>
</li>
<li>
<p>On the screen, draw a <strong>Custom Control</strong> (name it <code>CC_ALV</code>).</p>
</li>
<li>
<p>Add a GUI status (with functions BACK, EXIT, CANCEL).</p>
</li>
</ul>
<p>&nbsp;</p>
<p>REPORT z_alv_grid_editable.</p>
<p>************************************************************************<br />
* TYPES &amp; DATA DECLARATIONS<br />
************************************************************************<br />
TYPES: BEGIN OF ty_spfli,<br />
carrid TYPE spfli-carrid,<br />
connid TYPE spfli-connid,<br />
cityfrom TYPE spfli-cityfrom,<br />
cityto TYPE spfli-cityto,<br />
END OF ty_spfli.</p>
<p>DATA: gt_spfli TYPE TABLE OF ty_spfli,<br />
gs_spfli TYPE ty_spfli.</p>
<p>&#8221; ALV references<br />
DATA: go_container TYPE REF TO cl_gui_custom_container,<br />
go_alv TYPE REF TO cl_gui_alv_grid.</p>
<p>&#8221; Field catalog &amp; layout<br />
DATA: gt_fieldcat TYPE lvc_t_fcat,<br />
gs_fieldcat TYPE lvc_s_fcat,<br />
gs_layout TYPE lvc_s_layo.</p>
<p>************************************************************************<br />
* START-OF-SELECTION<br />
************************************************************************<br />
START-OF-SELECTION.<br />
&#8221; Fetch some demo data<br />
SELECT carrid connid cityfrom cityto<br />
FROM spfli<br />
INTO TABLE gt_spfli.</p>
<p>&#8221; Call ALV screen<br />
CALL SCREEN 100.</p>
<p>************************************************************************<br />
* MODULES FOR SCREEN 100<br />
************************************************************************<br />
MODULE status_0100 OUTPUT.<br />
SET PF-STATUS &#8216;MAIN&#8217;. &#8221; Create a status MAIN in GUI status</p>
<p>IF go_container IS INITIAL.<br />
&#8221; Create container linked to CC_ALV on screen<br />
CREATE OBJECT go_container<br />
EXPORTING container_name = &#8216;CC_ALV&#8217;.</p>
<p>&#8221; Create ALV Grid object<br />
CREATE OBJECT go_alv<br />
EXPORTING i_parent = go_container.</p>
<p>&#8221; Layout options<br />
gs_layout-zebra = abap_true. &#8221; striped display</p>
<p>&#8221; Build field catalog<br />
CLEAR gs_fieldcat.<br />
gs_fieldcat-fieldname = &#8216;CARRID&#8217;.<br />
gs_fieldcat-seltext_m = &#8216;Carrier ID&#8217;.<br />
gs_fieldcat-edit = abap_true. &#8221; Editable<br />
APPEND gs_fieldcat TO gt_fieldcat.</p>
<p>CLEAR gs_fieldcat.<br />
gs_fieldcat-fieldname = &#8216;CONNID&#8217;.<br />
gs_fieldcat-seltext_m = &#8216;Connection ID&#8217;.<br />
gs_fieldcat-edit = abap_true. &#8221; Editable<br />
APPEND gs_fieldcat TO gt_fieldcat.</p>
<p>CLEAR gs_fieldcat.<br />
gs_fieldcat-fieldname = &#8216;CITYFROM&#8217;.<br />
gs_fieldcat-seltext_m = &#8216;From City&#8217;.<br />
gs_fieldcat-edit = abap_true. &#8221; Editable<br />
APPEND gs_fieldcat TO gt_fieldcat.</p>
<p>CLEAR gs_fieldcat.<br />
gs_fieldcat-fieldname = &#8216;CITYTO&#8217;.<br />
gs_fieldcat-seltext_m = &#8216;To City&#8217;.<br />
gs_fieldcat-edit = abap_true. &#8221; Editable<br />
APPEND gs_fieldcat TO gt_fieldcat.</p>
<p>&#8221; Display data in ALV<br />
CALL METHOD go_alv-&gt;set_table_for_first_display<br />
EXPORTING<br />
is_layout = gs_layout<br />
CHANGING<br />
it_fieldcatalog = gt_fieldcat<br />
it_outtab = gt_spfli.<br />
ENDIF.<br />
ENDMODULE.</p>
<p>************************************************************************<br />
* Handle user commands<br />
************************************************************************<br />
MODULE user_command_0100 INPUT.<br />
CASE sy-ucomm.<br />
WHEN &#8216;BACK&#8217; OR &#8216;EXIT&#8217; OR &#8216;CANCEL&#8217;.<br />
LEAVE PROGRAM.<br />
ENDCASE.<br />
ENDMODULE.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/what-is-cl_gui_alv_grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
