<?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: Barcode scanner without pressing Scan Button in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726414#M202255</link>
    <description>&lt;P&gt;sap.ndc.BarcodeScanner.closeScanDialog();&lt;/P&gt;
  &lt;P&gt;sap.ui.getCore().byId("barc").getAggregation("_btn").firePress();&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 02:53:41 GMT</pubDate>
    <dc:creator>surya_jangareddy</dc:creator>
    <dc:date>2018-07-12T02:53:41Z</dc:date>
    <item>
      <title>Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaq-p/726410</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
  &lt;P&gt;Iam using Barcode scanner in my fiori app. Every thing is working fine....&lt;/P&gt;
  &lt;P&gt;But my client requirement is once he finish the scan, then immediately again another scan should be opened with out pressing button. &lt;/P&gt;
  &lt;P&gt;I done this requirement by using firePress event.But i am getting an issue like below.&lt;/P&gt;
  &lt;P&gt;First time when i press button and cancel, then from next time only its working as per requirement&lt;/P&gt;
  &lt;P&gt;So, how can i achieve it from first press onwards..&lt;/P&gt;
  &lt;P&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt;Surya..&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2018 05:43:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaq-p/726410</guid>
      <dc:creator>surya_jangareddy</dc:creator>
      <dc:date>2018-07-07T05:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726411#M202252</link>
      <description>&lt;P&gt;How are you calling the second scan?? &lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2018 08:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726411#M202252</guid>
      <dc:creator>rakesh2901</dc:creator>
      <dc:date>2018-07-07T08:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726412#M202253</link>
      <description>&lt;P&gt;Does the cancel fire the &lt;A href="https://ui5.sap.com/#/api/sap.ndc.BarcodeScannerButton/events/scanFail"&gt;scanFail&lt;/A&gt; event?&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jul 2018 13:02:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726412#M202253</guid>
      <dc:creator>gregorw</dc:creator>
      <dc:date>2018-07-07T13:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726413#M202254</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;First thanks to rakesh and Gregor for your response.&lt;/P&gt;
  &lt;P&gt;You can find my code below.&lt;/P&gt;
  &lt;P&gt;In View:&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;var oScanButton = new sap.ndc.BarcodeScannerButton({id: "barc",&lt;BR /&gt; provideFallback: true,&lt;BR /&gt; visible: true,&lt;BR /&gt; scanSuccess: onScanSuccess,&lt;BR /&gt; scanFail: onScanError,&lt;BR /&gt; inputLiveUpdate: onScanLiveupdate&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt;now in function onScanSuccess.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;function onScanSuccess(oEvent) &lt;/P&gt;
  &lt;P&gt;{&lt;BR /&gt;if (oEvent.getParameter("cancelled")) &lt;BR /&gt; {&lt;BR /&gt; sap.m.MessageToast.show("Scan cancelled", { duration:1000 });&lt;BR /&gt; }&lt;BR /&gt; else&lt;/P&gt;
  &lt;P&gt; {&lt;BR /&gt;aData.push({Sname: oEvent.getParameter("text")}); // Push data to Model&lt;BR /&gt; oModel.setData({modelData: aData}); // Set Model&lt;/P&gt;
  &lt;P&gt;sap.ndc.BarcodeScanner.closeScanDialog();&lt;/P&gt;
  &lt;P&gt; sap.ui.getCore().byId("barc").getAggregation("_btn").firePress();&lt;BR /&gt;}&lt;/P&gt;
  &lt;P&gt;}&lt;/P&gt;
  &lt;P&gt;this code is working fine like below.&lt;/P&gt;
  &lt;P&gt;1. when i press scan button , &lt;/P&gt;
  &lt;P&gt; come back and cancel dialog. &lt;/P&gt;
  &lt;P&gt; now again press scan button . then only the repeated scan is working fine with out pressing scan button next time onwards.&lt;/P&gt;
  &lt;P&gt;otherwise i am getting an message like "&lt;STRONG&gt;barcode scan is already started.&lt;/STRONG&gt;"&lt;/P&gt;
  &lt;P&gt;Please help me.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Surya.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 03:34:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726413#M202254</guid>
      <dc:creator>surya_jangareddy</dc:creator>
      <dc:date>2018-07-10T03:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726414#M202255</link>
      <description>&lt;P&gt;sap.ndc.BarcodeScanner.closeScanDialog();&lt;/P&gt;
  &lt;P&gt;sap.ui.getCore().byId("barc").getAggregation("_btn").firePress();&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 02:53:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726414#M202255</guid>
      <dc:creator>surya_jangareddy</dc:creator>
      <dc:date>2018-07-12T02:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726415#M202256</link>
      <description>&lt;P&gt;Hi Surya,&lt;/P&gt;
  &lt;P&gt;As much as I understood your requirement, I think you should not fire the button again &lt;/P&gt;
  &lt;P&gt;sap.ui.getCore().byId("barc").getAggregation("_btn").firePress();/// remove this &lt;/P&gt;
  &lt;P&gt;instead call the:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;sap.ndc.BarcodeScanner.scan&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; directly after first successful scan.&lt;/P&gt;
  &lt;P&gt;Hope I understood your requirement correctly. Let me know if it worked.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 09:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726415#M202256</guid>
      <dc:creator>rakesh2901</dc:creator>
      <dc:date>2018-07-12T09:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Barcode scanner without pressing Scan Button</title>
      <link>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726416#M202257</link>
      <description>&lt;P&gt;Hi Rakesh,&lt;/P&gt;
  &lt;P&gt;Initially i have written the code as you suggested.But its not triggering Scan second time without pressing button.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 09:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/barcode-scanner-without-pressing-scan-button/qaa-p/726416#M202257</guid>
      <dc:creator>surya_jangareddy</dc:creator>
      <dc:date>2018-07-16T09:59:49Z</dc:date>
    </item>
  </channel>
</rss>

