<?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 sap gui scripting  using multiple sheet as reference in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-gui-scripting-using-multiple-sheet-as-reference/m-p/12697148#M2018084</link>
    <description>&lt;P&gt;Hi i got some project using SAP Gui Recording and Playback function and i already got some input and code for a single sheet. now i need to to get the data from multiple sheet example. Sheet1BAL , Sheet2CUB and etc.&lt;/P&gt;
  &lt;P&gt;this is my running code for sheet1BAL:&lt;/P&gt;
  &lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;
  &lt;P&gt; Set SapGuiAuto = GetObject("SAPGUI")&lt;/P&gt;
  &lt;P&gt; Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;
  &lt;P&gt; Set connection = application.Children(0)&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;
  &lt;P&gt; Set session = connection.Children(0)&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;
  &lt;P&gt; WScript.ConnectObject session, "on"&lt;/P&gt;
  &lt;P&gt; WScript.ConnectObject application, "on"&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 138,41,false&lt;/P&gt;
  &lt;P&gt;Dim objExcel, objWorkbook, objSheet, i&lt;/P&gt;
  &lt;P&gt;Set objExcel = CreateObject("Excel.Application")&lt;/P&gt;
  &lt;P&gt;Set objWorkbook = objExcel.Workbooks.Open("C:\Users\itdatacenter\Desktop\3rd shift process\BATCH SCRIPT\OSBDL1.xlsx")&lt;/P&gt;
  &lt;P&gt;Set objSheet = objWorkbook.Sheets("BAL")&lt;/P&gt;
  &lt;P&gt;For i = 2 to objSheet.UsedRange.Rows.Count&lt;/P&gt;
  &lt;P&gt;COL1 = Trim(CStr(objSheet.Cells(i, 1).Value)) 'Column1&lt;/P&gt;
  &lt;P&gt;COL2 = Trim(CStr(objSheet.Cells(i, 2).Value)) 'Column2&lt;/P&gt;
  &lt;P&gt;COL3 = Trim(CStr(objSheet.Cells(i, 3).Value)) 'Column3&lt;/P&gt;
  &lt;P&gt;COL4 = Trim(CStr(objSheet.Cells(i, 4).Value)) 'Column4&lt;/P&gt;
  &lt;P&gt;COL5 = Trim(CStr(objSheet.Cells(i, 5).Value)) 'Column5&lt;/P&gt;
  &lt;P&gt;COL6 = Trim(CStr(objSheet.Cells(i, 6).Value)) 'Column6&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/tbar[0]/okcd").text = "zdown_osb_v14"&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]").sendVKey 0&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/ctxtP_MRDATE").text = COL1&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/ctxtSO_MRU-LOW").text = COL2&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/radPA_RD2").setFocus&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/radPA_RD2").select&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/ctxtPA_PAT2").text = COL3&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/txtP_INFILE").text = COL4&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/txtP_INFILE").setFocus&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/txtP_INFILE").caretPosition = 12&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]").sendVKey 9&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/tbar[0]/btn[13]").press&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/btnDATE_PUSH").press&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTDT").text = COL5&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTTM").text = COL6&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTTM").setFocus&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTTM").caretPosition = 8&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/tbar[0]/btn[11]").press&lt;/P&gt;
  &lt;P&gt;Next&lt;/P&gt;
  &lt;P&gt;MsgBox " END" &lt;/P&gt;</description>
    <pubDate>Thu, 02 Feb 2023 23:02:17 GMT</pubDate>
    <dc:creator>former_member840026</dc:creator>
    <dc:date>2023-02-02T23:02:17Z</dc:date>
    <item>
      <title>sap gui scripting  using multiple sheet as reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-gui-scripting-using-multiple-sheet-as-reference/m-p/12697148#M2018084</link>
      <description>&lt;P&gt;Hi i got some project using SAP Gui Recording and Playback function and i already got some input and code for a single sheet. now i need to to get the data from multiple sheet example. Sheet1BAL , Sheet2CUB and etc.&lt;/P&gt;
  &lt;P&gt;this is my running code for sheet1BAL:&lt;/P&gt;
  &lt;P&gt;If Not IsObject(application) Then&lt;/P&gt;
  &lt;P&gt; Set SapGuiAuto = GetObject("SAPGUI")&lt;/P&gt;
  &lt;P&gt; Set application = SapGuiAuto.GetScriptingEngine&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;If Not IsObject(connection) Then&lt;/P&gt;
  &lt;P&gt; Set connection = application.Children(0)&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;If Not IsObject(session) Then&lt;/P&gt;
  &lt;P&gt; Set session = connection.Children(0)&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;If IsObject(WScript) Then&lt;/P&gt;
  &lt;P&gt; WScript.ConnectObject session, "on"&lt;/P&gt;
  &lt;P&gt; WScript.ConnectObject application, "on"&lt;/P&gt;
  &lt;P&gt;End If&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]").resizeWorkingPane 138,41,false&lt;/P&gt;
  &lt;P&gt;Dim objExcel, objWorkbook, objSheet, i&lt;/P&gt;
  &lt;P&gt;Set objExcel = CreateObject("Excel.Application")&lt;/P&gt;
  &lt;P&gt;Set objWorkbook = objExcel.Workbooks.Open("C:\Users\itdatacenter\Desktop\3rd shift process\BATCH SCRIPT\OSBDL1.xlsx")&lt;/P&gt;
  &lt;P&gt;Set objSheet = objWorkbook.Sheets("BAL")&lt;/P&gt;
  &lt;P&gt;For i = 2 to objSheet.UsedRange.Rows.Count&lt;/P&gt;
  &lt;P&gt;COL1 = Trim(CStr(objSheet.Cells(i, 1).Value)) 'Column1&lt;/P&gt;
  &lt;P&gt;COL2 = Trim(CStr(objSheet.Cells(i, 2).Value)) 'Column2&lt;/P&gt;
  &lt;P&gt;COL3 = Trim(CStr(objSheet.Cells(i, 3).Value)) 'Column3&lt;/P&gt;
  &lt;P&gt;COL4 = Trim(CStr(objSheet.Cells(i, 4).Value)) 'Column4&lt;/P&gt;
  &lt;P&gt;COL5 = Trim(CStr(objSheet.Cells(i, 5).Value)) 'Column5&lt;/P&gt;
  &lt;P&gt;COL6 = Trim(CStr(objSheet.Cells(i, 6).Value)) 'Column6&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/tbar[0]/okcd").text = "zdown_osb_v14"&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]").sendVKey 0&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/ctxtP_MRDATE").text = COL1&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/ctxtSO_MRU-LOW").text = COL2&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/radPA_RD2").setFocus&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/radPA_RD2").select&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/ctxtPA_PAT2").text = COL3&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/txtP_INFILE").text = COL4&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/txtP_INFILE").setFocus&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]/usr/txtP_INFILE").caretPosition = 12&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[0]").sendVKey 9&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/tbar[0]/btn[13]").press&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/btnDATE_PUSH").press&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTDT").text = COL5&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTTM").text = COL6&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTTM").setFocus&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/usr/ctxtBTCH1010-SDLSTRTTM").caretPosition = 8&lt;/P&gt;
  &lt;P&gt;session.findById("wnd[1]/tbar[0]/btn[11]").press&lt;/P&gt;
  &lt;P&gt;Next&lt;/P&gt;
  &lt;P&gt;MsgBox " END" &lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 23:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-gui-scripting-using-multiple-sheet-as-reference/m-p/12697148#M2018084</guid>
      <dc:creator>former_member840026</dc:creator>
      <dc:date>2023-02-02T23:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: sap gui scripting  using multiple sheet as reference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-gui-scripting-using-multiple-sheet-as-reference/m-p/12697149#M2018085</link>
      <description>&lt;P&gt;Thank you for visiting SAP Community to get answers to your questions.&lt;/P&gt;&lt;P&gt;As you're looking to get most out of your community membership, please consider include a profile picture to increase user engagement &amp;amp; additional resources to your reference that can really benefit you:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Profile &lt;A href="https://developers.sap.com/tutorials/community-profile.html"&gt;https://developers.sap.com/tutorials/community-profile.html&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Tips for Questions: &lt;A href="https://community.sap.com/resources/questions-and-answers"&gt;https://community.sap.com/resources/questions-and-answers&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Consider to take our Q&amp;amp;A tutorial at: &lt;A href="https://developers.sap.com/tutorials/community-qa.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-qa.html&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope you find this advice useful, and we're happy to have you as part of SAP Community!&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2023 23:02:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-gui-scripting-using-multiple-sheet-as-reference/m-p/12697149#M2018085</guid>
      <dc:creator>AlexGourdet</dc:creator>
      <dc:date>2023-02-02T23:02:27Z</dc:date>
    </item>
  </channel>
</rss>

