<?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: Method in ALV class in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135361#M1190339</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;Use:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you double-click on any cell of alv grid, use this code to fetch the data of the line that you currently clicked, its working:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you double click on the ALV grid line, you will have sy-ucomm = &lt;STRONG&gt;'&amp;amp;IC1'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you define a &lt;STRONG&gt;i_callback_user_command&lt;/STRONG&gt; for the &lt;STRONG&gt;FM reuse_alv_grid_display&lt;/STRONG&gt;, and create it as:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  DATA : ok_code TYPE sy-ucomm.
  ok_code = ucomm.
  CASE ok_code.
    WHEN '&amp;amp;IC1'. "for double click on alv grid line
      " your code
  ENDCASE.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you have used &lt;STRONG&gt;selfield TYPE slis_selfield&lt;/STRONG&gt;, the field &lt;STRONG&gt;selfield&lt;/STRONG&gt; will hold all the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To know on which row you have clicked and to retain that line, use code:-&lt;/P&gt;&lt;P&gt;Suppose you are currently displaying data from internal table &lt;STRONG&gt;itab&lt;/STRONG&gt; and corresponding to it you have work area &lt;STRONG&gt;wa&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
read table itab into wa index selfield-tabindex. "index value of line you clicked
" now you have the contents of line that you double clicked currently
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now to know the field name that you clicked, use:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
selfield-fieldname " will fetch you the name of field that you clicked
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now using the work-area and the name of field that you clicked, you can easily make out the details of the field i.e., field name and field value and you can code as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2009 11:32:21 GMT</pubDate>
    <dc:creator>I355602</dc:creator>
    <dc:date>2009-02-05T11:32:21Z</dc:date>
    <item>
      <title>Method in ALV class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135357#M1190335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guru,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am displaying one ALV grid using class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that I have to change some value of one column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the index for the same. I can not use get_selected_row because i am not selecting any row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any method in the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please sugget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:20:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135357#M1190335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Method in ALV class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135358#M1190336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that I have to change some value of one column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this an editable ALV, then you can make use of the event data_changed or data_change_finished of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:23:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135358#M1190336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Method in ALV class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135359#M1190337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;Just try the method:  method GET_TABLE_FOR_ALV_GRID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135359#M1190337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Method in ALV class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135360#M1190338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;In the class CL_GUI_ALV_GRID u hv a method as : CHECK_CHANGED_DATA&lt;/P&gt;&lt;P&gt;this triggers a event "data_changed " and returns the value of the changed data in a column or any cells.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there is also a Method "GET_CHANGED_DATA"... try that&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;ags.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:28:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135360#M1190338</guid>
      <dc:creator>agnihotro_sinha2</dc:creator>
      <dc:date>2009-02-05T11:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Method in ALV class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135361#M1190339</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;Use:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you double-click on any cell of alv grid, use this code to fetch the data of the line that you currently clicked, its working:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you double click on the ALV grid line, you will have sy-ucomm = &lt;STRONG&gt;'&amp;amp;IC1'&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you define a &lt;STRONG&gt;i_callback_user_command&lt;/STRONG&gt; for the &lt;STRONG&gt;FM reuse_alv_grid_display&lt;/STRONG&gt;, and create it as:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
  DATA : ok_code TYPE sy-ucomm.
  ok_code = ucomm.
  CASE ok_code.
    WHEN '&amp;amp;IC1'. "for double click on alv grid line
      " your code
  ENDCASE.
ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you have used &lt;STRONG&gt;selfield TYPE slis_selfield&lt;/STRONG&gt;, the field &lt;STRONG&gt;selfield&lt;/STRONG&gt; will hold all the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To know on which row you have clicked and to retain that line, use code:-&lt;/P&gt;&lt;P&gt;Suppose you are currently displaying data from internal table &lt;STRONG&gt;itab&lt;/STRONG&gt; and corresponding to it you have work area &lt;STRONG&gt;wa&lt;/STRONG&gt;.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
read table itab into wa index selfield-tabindex. "index value of line you clicked
" now you have the contents of line that you double clicked currently
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now to know the field name that you clicked, use:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
selfield-fieldname " will fetch you the name of field that you clicked
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now using the work-area and the name of field that you clicked, you can easily make out the details of the field i.e., field name and field value and you can code as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:32:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135361#M1190339</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-02-05T11:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Method in ALV class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135362#M1190340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;chk these programs:&lt;/P&gt;&lt;P&gt;BCALV_GRID_EDIT&lt;/P&gt;&lt;P&gt;BCALV_TEST_GRID_EDITABLE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:34:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-in-alv-class/m-p/5135362#M1190340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-05T11:34:12Z</dc:date>
    </item>
  </channel>
</rss>

