Skip to Content

barcode scanning issue in sap.m.input( not scanning properly)

Hi Expert,

I have some issue in barcode scanner.

Requirement:

I have a table with 3 columns and initially I have to add empty row and make focus in one of the cell(lets say cell 2) and when I scanned the barcode, I have read the value and add new row to table and change the focus to cell2 in 2nd row and I have a condition to restrict the adding rows to table.

Issue:

Lets say I have to restricted the table to 5 records and my Barcode value is 'TESTING'. Now when I scanned the barcode it was reading only one letter which is 'T' (basically it has to read the total value ) and i'm able to add the second row and change the focus to cell2 in second row(which is correct) and when I scanned the barcode again it was reading only one letter and added new row in table and changed focus to cell2 in 3rd row and so on. When I scanned the 5th row (which is last record )at the time it was scanning properly and I'm getting the total value in input.

I have written the logic in liveChange event.

Code:

liveBatchChange:function(evt){

var value = evt.getParameter("value");

var oContext = evt.getSource().getParent().getParent().getBindingContext();

var oMaterialIndex = oContext.getPath().split('/')[2]; var object = oContext.getObject(); if(object.Werks == '1' ){

this.gotoNextLine(evt,oContext,oMaterialIndex,object);

// if (value && value.length <= 10) {

// this.timer = setTimeout(this.gotoNextLine(evt,oContext,oMaterialIndex,object), 250)

// } else if (value && value.length == 10) {

// if (this.timer) {

// clearTimeout(this.timer);

// }

// this.gotoNextLine(evt,oContext,oMaterialIndex,object);

// }

}

},

gotoNextLine:function(evt,oContext,oMaterialIndex,object){

this.MaterialIndex = parseInt(oMaterialIndex);

var oItemIndex = parseInt(evt.getSource().getBindingContext().getPath().split('/')[4]); object.BatchData[oItemIndex].QtyPick=1;

object.BatchData[oItemIndex].Batch =evt.getParameter("newValue");

object.BatchData.push({ Lgort : object.MainLgort, Batch : "", QtyDisp : "?", QtyPick : 0, SAPStatus : "", SAP : false, Uecha : object.Posnr });

var oTable = this.getView().byId('idList');

var oItem = oTable.getItems()[olength];

oItem.getCells()[0].$().find('input').focus();

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers