Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member638425
Participant
When you are trying to identify an item using the OCR connector, you can select a text on an application and declare it as an item. However, you may find that there might be multiple matches of the same text on the page. If this is the case, the topmost occurrence on the DOM will be always recognized. If you want to identify a different match, you can follow the below steps or look over this documentation.

As a prerequisite, make sure you have identify the OCR page correctly by adding a root item as shown below:


If you want to know in detailed how pages are recognized, check it out here. To identify the text, we need to find its nearest match whether using coordinates or labels.

Getting the correct match using design-time coordinates:


Use the design-time coordinates of the text item and specify the expected difference from that position along the x- or y-axis, or a combination of both.




You can configure the difference in position between design-time and run-time by using one or both of the following parameters:

  • Nearest match along width(%)- This value represents a deviation in margin percentage compared to the width of the application page (screen). At runtime, the nearest text along the x-axis is matched.





  • Nearest match along height (%)-This value represents a deviation in margin percentage compared to the width of the application page (screen). At runtime, the nearest text along the y-axis is matched.






The value for these properties can range between 0 and 100. The default value is 0, meaning that this feature is disabled. If the deviation at runtime is greater than the configured percentage value, the text is not recognized.


When the project runs, the text that is within the area defined by the Nearest Match parameters and at minimum distance from the design-time coordinates will be returned.


 

Getting the correct match using labels:


Pick a text that is close to the item you want and that is unique. In the below case, I picked Lineas, then declare the text and make a new item ( in this case called lbLineas).


Then use this item as a label, to help you identify your item as shown below:


The nearest reference point is returned as a the matched text.