<?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 Selecting some columns when selecting a row in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436229#M825204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way where, if I select a single row of an ALV Grid with 5 fields then only 2 fields are selected and rest are not even higlighted .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2008 11:25:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-14T11:25:09Z</dc:date>
    <item>
      <title>Selecting some columns when selecting a row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436229#M825204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way where, if I select a single row of an ALV Grid with 5 fields then only 2 fields are selected and rest are not even higlighted .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 11:25:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436229#M825204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T11:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting some columns when selecting a row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436230#M825205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;???? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you actually want to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you select a row  then the whole row is automatically selected (click the box to the left of the first column on the grid).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you select individual cells  just use the shift button and select the cells you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ensure however that in your layout the sel_mode is set to 'D'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that if you select a whole row then you will get ALL columnsin that row.  I could be wrong however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: struct_grid_lset TYPE lvc_s_layo.
.......
Program code
....
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before displaying grid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
struct_grid_lset-sel_mode = 'D'.

* set event handlers etc etc
 CALL METHOD grid1-&amp;gt;set_table_for_first_display
    EXPORTING is_layout =  struct_grid_lset
    CHANGING
               it_outtab       = &amp;lt;dyn_table&amp;gt;
               it_fieldcatalog = it_fldcat.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 14:05:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436230#M825205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T14:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting some columns when selecting a row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436231#M825206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jimbo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. But my concern is when i Click the left most box to select the row, I want only 2 columns to be selected out of the 5 columns present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me explain in detail&lt;/P&gt;&lt;P&gt;Lets say i have an alv consisting of 5 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOBST MINBE EISBE PRWUG PRWOG with values given below&lt;/P&gt;&lt;P&gt;10           50       60       80          100&lt;/P&gt;&lt;P&gt;20          40         70       90          200&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if i select the any of the row, only SOBST and MINBE fields should be selected and rest (EISBE , PRWUG and PRWOG ) should be ignored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope i am able to explain myself!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 14:14:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436231#M825206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T14:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting some columns when selecting a row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436232#M825207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this is possible with the current technology of the alv grid..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll either have to train your users to select individual cells&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;
&lt;SPAN __default_attr="15" __jive_macro_name="size"&gt;
 &lt;STRONG&gt;or get them to select by COLUMNS so that might be a get around.&lt;/STRONG&gt; 
&lt;/SPAN&gt;
&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You could do it programatically i.e note the row the user has selected  and just ignore the cells you don't want to process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To select Columns just place the cursor over the column title.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note you need to have the layout option sel_mode set to A,B,C,or D depending on what you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 14:23:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436232#M825207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T14:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting some columns when selecting a row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436233#M825208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this is the solution , then i will try to program it. Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Gopal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 14:46:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436233#M825208</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T14:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting some columns when selecting a row</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436234#M825209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;I think the columns approach is better but of course you then select the ENTIRE column which might not be what the user wants - especially if the table is very large.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In either case you get the "Selected Columns" back into your program so just ignore the columns you don't want to process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am almost 100% certain when you select a row the entire row is actually selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another approach (involves an extra step) is for the user to select the rows to process as well as the columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you read the selected rows and  do a REFRESH GRID. After REFRESH GRID set selected cells to the columns you want in the new display.  Only the columns you actually want processd will be highlighted. Have a toolbar button CONFIRM PROCESSING or whatever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to process a variable number of columns you can still get the user to choose the rows but also select the columns to process. This way you just process the Row numbers selected using the fields of the chosen columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note it might seem confusing but you need to set the selected cells AFTER calling the GRID_REFRESH since your method is executed completely before the re-display occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you call SET_SELECTED_SELLS   before the GRID REFRESH the refresh will start again from the top of the table and your selection will be lost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2008 15:48:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selecting-some-columns-when-selecting-a-row/m-p/3436234#M825209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-14T15:48:52Z</dc:date>
    </item>
  </channel>
</rss>

