<?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 Script - Handle Error - VBA in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/script-handle-error-vba/m-p/334208#M5631</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm having difficulties to set up my VBA code in order to handle error. &lt;/P&gt;&lt;P&gt;I'm using it to create data and the system send back the error : 'entry already exists'. I would like to set up something like this : &lt;/P&gt;&lt;P&gt;(See bold) &lt;/P&gt;&lt;P&gt;session.findById("wnd[0]/usr/ctxtBNKA-BANKS").Text = BANKS&lt;BR /&gt;  session.findById("wnd[0]/usr/ctxtBNKA-BANKL").Text = BANKL&lt;BR /&gt;  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF &lt;/STRONG&gt;session.findById("wnd[0]").sendVKey 0 &lt;STRONG&gt;Sends back an error then &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stop script &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End if &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;session.findById("wnd[0]/usr/txtBNKA-PROVZ").Text&lt;BR /&gt;session.findById("wnd[0]/usr/txtBNKA-PROVZ").Text = PROVZ&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-BANKA").Text = BANKA&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-STRAS").Text = STRAS&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-ORT01").Text = ORT01&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-BRNCH").Text = SWIFT&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-SWIFT").Text = BANKL&lt;BR /&gt;  session.findById("wnd[0]/tbar[0]/btn[11]").press&lt;/P&gt;&lt;P&gt; Do you have any idea ? I having issue when using 'onerror'. 
&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Martin. &lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2017 15:11:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-01-23T15:11:58Z</dc:date>
    <item>
      <title>Script - Handle Error - VBA</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/script-handle-error-vba/m-p/334208#M5631</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm having difficulties to set up my VBA code in order to handle error. &lt;/P&gt;&lt;P&gt;I'm using it to create data and the system send back the error : 'entry already exists'. I would like to set up something like this : &lt;/P&gt;&lt;P&gt;(See bold) &lt;/P&gt;&lt;P&gt;session.findById("wnd[0]/usr/ctxtBNKA-BANKS").Text = BANKS&lt;BR /&gt;  session.findById("wnd[0]/usr/ctxtBNKA-BANKL").Text = BANKL&lt;BR /&gt;  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IF &lt;/STRONG&gt;session.findById("wnd[0]").sendVKey 0 &lt;STRONG&gt;Sends back an error then &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Stop script &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End if &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;session.findById("wnd[0]/usr/txtBNKA-PROVZ").Text&lt;BR /&gt;session.findById("wnd[0]/usr/txtBNKA-PROVZ").Text = PROVZ&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-BANKA").Text = BANKA&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-STRAS").Text = STRAS&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-ORT01").Text = ORT01&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-BRNCH").Text = SWIFT&lt;BR /&gt;  session.findById("wnd[0]/usr/txtBNKA-SWIFT").Text = BANKL&lt;BR /&gt;  session.findById("wnd[0]/tbar[0]/btn[11]").press&lt;/P&gt;&lt;P&gt; Do you have any idea ? I having issue when using 'onerror'. 
&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Martin. &lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 15:11:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/script-handle-error-vba/m-p/334208#M5631</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-01-23T15:11:58Z</dc:date>
    </item>
  </channel>
</rss>

