<?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>Question Re: Loop though specific table column and select row when found in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380057#M4633822</link>
    <description>&lt;P&gt;What I meant is that in the line below that line, you have solved the error ([3," &amp;amp; CStr(i) &amp;amp; "]"), so it's just that you didn't check twice &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 5&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Mar 2021 19:25:59 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-03-15T19:25:59Z</dc:date>
    <item>
      <title>Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaq-p/12380052</link>
      <description>&lt;P&gt;If I want to update specific quota I need to script to check for the Quota Arr. Number column in below displayed table. If the number is same as in excel input file (COL3) than it should select the same row as the number is found. In below example it should select row 2.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1901842-meq1.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1901843-quota.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I tried below code but the script stops at: session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text &lt;/P&gt;
  &lt;P&gt;Runtime error ‘619’:&lt;/P&gt;
  &lt;P&gt;The control could not be found by id.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;i = 0

Do

session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text
session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 5

If session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text = COL3 then

session.findById("wnd[0]/usr/tblSAPDM06QTC_0205").getAbsoluteRow(i).selected = true

Exit Do
End if

i = i + 1

Loop
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 10:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaq-p/12380052</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-15T10:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380053#M4633818</link>
      <description>&lt;P&gt;Error easy to find, check twice your code before asking &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;"wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]"&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 13:45:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380053#M4633818</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-15T13:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380054#M4633819</link>
      <description>&lt;P&gt;I found the error line as well. It's stated in my post. Read my post twice before commenting &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;    &lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 13:59:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380054#M4633819</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-15T13:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380055#M4633820</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;What is this line for?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3,i]").text&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You're not assigning read value nor setting any new value. What is it for?&lt;/P&gt;&lt;P&gt;Why aren't you concatenating the i value to ID string all the time as you do in the IF statement?&lt;/P&gt;&lt;P&gt;Might be good to have a local variable with the ID concatenated string and use that variable everywhere.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;Mateusz</description>
      <pubDate>Mon, 15 Mar 2021 14:23:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380055#M4633820</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2021-03-15T14:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380056#M4633821</link>
      <description>&lt;P&gt;Thank you Mateusz!&lt;/P&gt;&lt;P&gt;Updated code like this instead. Still don't know what &lt;/P&gt;&lt;P&gt;CStr(i) exactly does but it certanly seems to do the trick &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;i = 0

Do

session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 5&lt;BR /&gt;If session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," &amp;amp; CStr(i) &amp;amp; "]").text = COL3 then&lt;BR /&gt;session.findById("wnd[0]/usr/tblSAPDM06QTC_0205").getAbsoluteRow(i).selected = true

Exit Do&lt;BR /&gt;End if

i = i + 1

Loop&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 16:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380056#M4633821</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-15T16:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380057#M4633822</link>
      <description>&lt;P&gt;What I meant is that in the line below that line, you have solved the error ([3," &amp;amp; CStr(i) &amp;amp; "]"), so it's just that you didn't check twice &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;session.findById("wnd[0]/usr/tblSAPDM06QTC_0205/txtEQUK-QUNUM[3," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 5&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 19:25:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380057#M4633822</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-03-15T19:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380058#M4633823</link>
      <description>&lt;P&gt;Thanks! I whish it was that easy though. I just copied from something that looked similar when googled. It didn't work for my code. Much easer  to find the error if you know what to look for &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 20:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380058#M4633823</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-15T20:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380059#M4633824</link>
      <description>&lt;P&gt;It's always good to check the documentation: &lt;A href="https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/type-conversion-functions#cstr-example" target="test_blank"&gt;https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/type-conversion-functions#cstr-example&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Mateusz</description>
      <pubDate>Tue, 16 Mar 2021 07:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380059#M4633824</guid>
      <dc:creator>MateuszAdamus</dc:creator>
      <dc:date>2021-03-16T07:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380060#M4633825</link>
      <description>&lt;P&gt;Hello &lt;/P&gt;&lt;P&gt;If want the script to loop through Valid from, Valid to and Quota Arr. Columns (3 columns) to find exact match before selecting the row can same approach be used?&lt;/P&gt;&lt;P&gt;The solution is more for a Source List  ME01. For this t code the script would need to check for exact match in 6 diffrent columns. Valid from, Valid to, Vendor ID, Agreement, Line item and MRP. Basically same as above but with more columns to check for exact match. &lt;/P&gt;&lt;P&gt;I did several tries today with no success. &lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2021 18:27:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380060#M4633825</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-17T18:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380061#M4633826</link>
      <description>&lt;P&gt;Here is my best try.&lt;/P&gt;&lt;P&gt;It gives error: The conrol could not be found by id. Code:800A026B on session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-VDATU[0," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;i = 0
Do
session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-VDATU[0," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0'Valid From date

session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-BDATU[1," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0'Valid To date
session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-LIFNR[2," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0'Vendor ID
session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-EBELN[6," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0'Agreement number
session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-EBELP[7," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0'Item line
session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-AUTET[10," &amp;amp; CStr(i) &amp;amp; "]").caretPosition = 0 'MRP flag


If session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-VDATU[0," &amp;amp; CStr(i) &amp;amp; "]").Text = COL3 AND session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-BDATU[1," &amp;amp; CStr(i) &amp;amp; "]").Text = COL4 AND session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-LIFNR[2," &amp;amp; CStr(i) &amp;amp; "]").Text = COL5AND session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-EBELN[6," &amp;amp; CStr(i) &amp;amp; "]").Text = COL7 AND session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-EBELP[7," &amp;amp; CStr(i) &amp;amp; "]").Text = COL8 AND session.findById("wnd[0]/usr/tblSAPLMEORTC_0205/ctxtEORD-AUTET[10," &amp;amp; CStr(i) &amp;amp; "]").Text = COL12  Then


session.findById("wnd[0]/usr/tblSAPLMEORTC_0205").getAbsoluteRow(i).selected = true 


Exit Do
End if
i = i + 1
Loop&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Mar 2021 12:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380061#M4633826</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-19T12:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Loop though specific table column and select row when found</title>
      <link>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380062#M4633827</link>
      <description>&lt;P&gt;Am I on the right track or is diffrent approach needed? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 13:02:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/loop-though-specific-table-column-and-select-row-when-found/qaa-p/12380062#M4633827</guid>
      <dc:creator>former_member549453</dc:creator>
      <dc:date>2021-03-19T13:02:36Z</dc:date>
    </item>
  </channel>
</rss>

