on 06-04-2009 10:31 PM
Hello,
I am developing a WDJ application for Intermec CK61 device on NetWeaver CE 7.1 box. The requirement is to read a 2D barcode and then parse it for display to user via a view. I am using Intermec Browser version 1.01.02.
I have followed [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/949f8421-0a01-0010-59ad-f961a4834c13] SAP example. However, when I scan a barcode using the CK61 barcode scanner, the barcode contents do not appear. I can see the onRead event being triggered, then the screen refreshes, then nothing.
I understand onRead has two parameters: barCode and type. Now, in the wdDoModifyView method, the type parameter returns correctly the barcode type to my context (i.e. PDF417) and am able to display it to the user. However, the barCode parameter just won't return anything.
Has anyone experienced this before? Do I need to do anything special to make it work? I provide my code below for wdDoModifyView and the action assigned to the onRead event:
My action has two parameters: scanData and scanType (both Strings) to which I map barCode and type respectively:
public static void wdDoModifyView(IPrivateBarCodeView wdThis, IPrivateBarCodeView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime)
{
IWDBarCodeReader barCodeReader = (IWDBarCodeReader) view.getElement("BarCodeReader_Scan");
barCodeReader.mappingOfOnRead().addSourceMapping(IWDBarCodeReader.IWDOnRead.BAR_CODE, "scanData");
barCodeReader.mappingOfOnRead().addSourceMapping(IWDBarCodeReader.IWDOnRead.TYPE, "scanType");
}
//@@end
}
On my view I have two context elements - Data & Type - that I set according to action parameters scanData and scanType respectively. These are both strings and are both bound to TextView elements:
public void onActionScanBarCode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String scanData, java.lang.String scanType )
{
//@@begin onActionScanBarCode(ServerEvent)
wdThis.wdGetContext().currentContextElement().setData(scanData);
wdThis.wdGetContext().currentContextElement().setType(scanType);
//@@end
}
Hi
I am using java webdynpro in netwaver 7.1 CE for developing a mobile handheld application
i need to read a barcode in my application
the barcode ui element is not available in my NWDS
I do have a mobile add on but it has only function key ui element
Could you please help me out on this
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem was solved.
To solve, we replaced the following code in method wdDoModifyView:
Replace:
barCodeReader.mappingOfOnRead().addSourceMapping(IWDBarCodeReader.IWDOnRead.BAR_CODE, "scanData");
With:
barCodeReader.mappingOfOnRead().addSourceMapping("data", "scanData");
Edited by: Roman Dubov on Jun 9, 2009 12:51 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have open a occ on SAP, however Sap haven not answer it.
Hello experts thnks for your advice
I have a problem, but I'm using the next:
Mc3000 symbol
Symbol pocket browser 2.02
windows mobile device center 6.1.6995 , beacuse I'm using vista
When I scan a bar code, apperar in the pocket browser the next excepction.
Parameter barcode not found
I have done everything that you recommended me, but I have not solve this problem
Thanks a lot my dear Expets
I am in the exact situation as you Coldplay, same model of mobile device, same exception, also opened an OSS yesterday, unfortunately this is a new development so my priority was low, as no business processes depend or are stopped by the issue, if I get an answer from SAP I'll let you know the solution, please if you get the solution first, share it with the community.
Thanks,
JV
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.