<?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: Going through a table in SAP returns errors in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaa-p/710350#M194509</link>
    <description>&lt;P&gt;Hello Olesia,&lt;/P&gt;
  &lt;P&gt;welcome in the SAP Community.&lt;/P&gt;
  &lt;P&gt;Are you sure that you are using a table...&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/210262-table001.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;...or an ALV-Grid?&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/210263-table002.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;An ALV-Grid is a GuiShell with the SubType GridView, like in your example. The table is GuiTableControl and, in a normal case, without a shell. That would explain why the RowCount property is not available.&lt;/P&gt;
  &lt;P&gt;Let us know your results.&lt;/P&gt;
  &lt;P&gt;Cheers&lt;BR /&gt;Stefan&lt;/P&gt;</description>
    <pubDate>Thu, 30 Aug 2018 05:47:45 GMT</pubDate>
    <dc:creator>Stefan-Schnell</dc:creator>
    <dc:date>2018-08-30T05:47:45Z</dc:date>
    <item>
      <title>Going through a table in SAP returns errors</title>
      <link>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaq-p/710349</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I have been struggling with understanding how to loop through a table in SAP. Just to give some context, here is what I basically need to do: &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;1. Go to a page in SAP with a table&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;2. Double click on a line, which brings me to a window with values that I need to copy and insert it in a spreadsheet. &lt;/P&gt;
  &lt;P&gt;3. Loop through an entire table in the same fashion and repeat a procedure.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;The object I am going through has the following code:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").selectedNode = " 5" Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").doubleClickNode " 5" &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;I am new to SAP and googled many instances already. I still have not figured out how to write the code in my case. Any recommendations will be appreciated. &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;My code returns error "The object does not support this property or method" (RowCount)&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Dim Table As Object
Dim rows As Long
Dim i As Long

Set Table = Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell[1]")
rows = Table.RowCount - 1

For i = 0 To rows
Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").selectedNode = "          i"
Session.FindById("wnd[0]/usr/cntlUSAGE_TREE_CONTAINER/shellcont/shell/shellcont[1]/shell").doubleClickNode "          i"

Next i

&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 20:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaq-p/710349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-08-27T20:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Going through a table in SAP returns errors</title>
      <link>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaa-p/710350#M194509</link>
      <description>&lt;P&gt;Hello Olesia,&lt;/P&gt;
  &lt;P&gt;welcome in the SAP Community.&lt;/P&gt;
  &lt;P&gt;Are you sure that you are using a table...&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/210262-table001.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;...or an ALV-Grid?&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/210263-table002.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;An ALV-Grid is a GuiShell with the SubType GridView, like in your example. The table is GuiTableControl and, in a normal case, without a shell. That would explain why the RowCount property is not available.&lt;/P&gt;
  &lt;P&gt;Let us know your results.&lt;/P&gt;
  &lt;P&gt;Cheers&lt;BR /&gt;Stefan&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 05:47:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaa-p/710350#M194509</guid>
      <dc:creator>Stefan-Schnell</dc:creator>
      <dc:date>2018-08-30T05:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Going through a table in SAP returns errors</title>
      <link>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaa-p/710351#M194510</link>
      <description>&lt;P&gt;Hello Stefan,&lt;/P&gt;
  &lt;P&gt;I figured that. Indeed, my object was a tree. However, I have also grids and tables. I am wondering if there is a difference in declaring grids and tables. I am currently trying to find column names for a grid. &lt;/P&gt;
  &lt;P&gt;My grid goes under the line: session.findById("wnd[0]/usr/lbl[6,5]") I am trying to figure how to find the column identifiers for this grid. Just a click on the column heading returns the same line with [6,5] at the end. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thank you for your help!&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 21:36:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/going-through-a-table-in-sap-returns-errors/qaa-p/710351#M194510</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-09-03T21:36:57Z</dc:date>
    </item>
  </channel>
</rss>

