on 2016 Apr 05 4:11 PM
Extending Example - SMP 3.0: Custom Agentry Android client supporting native NFC (RFID) scanning capabilities.
Hi All
I use an artice
to extend Custom Agentry Android client to support native NFC (RFID).
I works.
How can I take a scanned value to use it in a search function?
I don't need to put scanned value in the Text Edit but in the Rule
like this
@COLLECTION_FIND
|_____FlightScheduleCollection Property
| |__@EQSTR
|___ScheduleID Property
|_"" |____<Scanned Value>
Just like the demo article text field has an update rule referencing the Open UI control to put the value into the text field you would use the same reference in your rule to use in comparing to the ScheduleID value.
--Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bill
It works.
But this is not exactly what I expected.
Now I need to have two buttons on the screen
Button1 - Connected to class Z_RFIDButtonAdapter and have ExtRFID Extrernal Value
Button2 - Connectec to the Action that takes value from Extrernal Value - ExtRFID and perform the search.
User have to press Button1 then Button2.
Can I put them in One action that successively
- perfrom Z_RFIDButtonAdapter.Click event
- fill ExtRFID
- and then peform Action of Button2.
Hi Bill.
I would not want to change the Z_RFIDButtonAdapter class for two reasons:
--
SAP Help contains too little information on how to use there classes:
http://help.sap.com/saphelp_smp3010sdk/helpdata/en/7c/0588c0700610148082ad7d63bd19b9/content.htm
--
It is bettter to create universal function (or class) that reads the data from RFC and then put it in global variable.
So I could call this function (or class) in the first Action Step.
Then get value of global variable and perform required actions in the next Action Steps.
Is it possible?
Not really. The Open UI code is not a "function" that you can call. The Open UI code replaces a default field on the screen with your own code. The user can interact with it just like any other field. In this case, press the button your Open UI code created to invoke your NFC scanning code.
The better way would be to have your Open UI code invoke the Agentry Action as a secondary step. The Agentry action can read the value from Open UI and store it in a main object property that can be used by your search or you search can read the value directly from the Open UI control.
Look at the MyAgentryActionExtension.java sample for how your Open UI code can invoke an Agentry Action.
Ultimately the correct answer for this is your NFC code should be implemented as an OpenScan interface instead of an Open UI control. Then you can use the built in scanning capabilities of Agentry instead of having to write your own search (although it is a good learning exercise).
--Bill
User | Count |
---|---|
68 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.