title: SAP GUI getting excel to copy some items from a table in SAP system
body: <p>I am trying to write some code to extract data from sap, and then put it into an Excel table. Right now, I have the GUI getting into the right <code>itemnumber</code>. Here, I have been trying to get some useful code, using the GUI recorder. I have tried to select the data, and open details and selected data here. The trouble I am having is that the code generated by GUI does not give me <code>.value</code> or <code>.setfocus</code> or something like this. So I do not know how to approach this. The code from GUI can be seen below:</p>
  <pre class="lang-none prettyprint-override"><code>session.findById(&quot;wnd[0]&quot;).maximize
  session.findById(&quot;wnd[0]/tbar[0]/okcd&quot;).Text = &quot;/nymm_pricelist&quot;
  session.findById(&quot;wnd[0]&quot;).sendVKey 0
  session.findById(&quot;wnd[0]/usr/ctxtS_MATNR-LOW&quot;).Text = Cells(currentline, 1).Value
  session.findById(&quot;wnd[0]/usr/ctxtS_VKORG-LOW&quot;).Text = Cells(currentline, 2).Value
  session.findById(&quot;wnd[0]/usr/ctxtS_VKORG-LOW&quot;).SetFocus
  session.findById(&quot;wnd[0]/usr/ctxtS_VKORG-LOW&quot;).caretPosition = 4
  session.findById(&quot;wnd[0]&quot;).sendVKey 8
  session.findById(&quot;wnd[0]/usr/cntlGRID1/shellcont/shell&quot;).CurrentCellColumn = &quot;LOCALSALES_KBETR&quot;
  session.findById(&quot;wnd[0]/usr/cntlGRID1/shellcont/shell&quot;).selectedRows = &quot;0&quot;
  session.findById(&quot;wnd[0]/usr/cntlGRID1/shellcont/shell&quot;).ContextMenu
  session.findById(&quot;wnd[0]/usr/cntlGRID1/shellcont/shell&quot;).SelectContextMenuItem &quot;&amp;DETAIL&quot;
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).setCurrentCell 4, &quot;VALUE&quot;
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).selectedRows = &quot;4&quot;
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).ContextMenu
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).CurrentCellRow = 8
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).selectedRows = &quot;8&quot;
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).ContextMenu
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).CurrentCellRow = 10
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).selectedRows = &quot;10&quot;
  session.findById(&quot;wnd[1]/usr/cntlGRID/shellcont/shell&quot;).ContextMenu
  session.findById(&quot;wnd[1]/tbar[0]/btn[0]&quot;).press
  </code></pre>
  <p>Any ideas of how to do this?</p>