Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the IDObject with Attribute in SAP using Automation Anywhere with DLL?

I'm developing an automation process on SAP with Automation Anywhere using the SAP DLLs provided by Automation Anywhere itself. I need to find IDObject with specify attribute to click/get value the specify element , but seems that there are no fuctions that allow you to do it. An example of code generated from the SAP recorder is the following:

session.findById("wnd[0]/shellcont[1]/shell/shellcont[0]/shell").setCurrentCell 0,"ICON_EXEC" session.findById("wnd[0]/shellcont[1]/shell/shellcont[0]/shell").selectedRows = "0" session.findById("wnd[0]/shellcont[1]/shell/shellcont[0]/shell").clickCurrentCell

using the dlls I have already tried the following functions:

Step 1 : Login on existing session (in this case 0)

Step 2 : Search Object by ID (in this case wnd[0]/shellcont[1]/shell/shellcont[0]/shell )

Step 3: CurrentCellRow (in this case 0)

Step 4: DoubleclickCurrentCell

The problem is that it doesn't click where i want, because as you can see there is the attribute "ICON_EXEC" that specify the element that i want to click . (i also tried to insert in the SearchObjectbyID all the string with the attribute, but it doesn't work)

Currently to avoid that i'm using Execute VBscript, but it seems that error handling does not work with scripts, so i would like to avoid them too

Any tips?

Thanks,

U.

like image 707
umbyrulez Avatar asked Oct 26 '25 18:10

umbyrulez


2 Answers

You can find out the SAP-Object ID (IDObject) by recording a (.vbs-)macro in SAP:

  1. Hit Alt + F12 or click the respective icon and choose "Record script and playback" ("Skript-Aufzeichnung und -Playback" in my screenshot):

enter image description here

  1. In the following dialogue window, hit the record button and click the desired object:

enter image description here

  1. Open the recorded .vbs-macro and and look for something like this (=the desired object ID):

enter image description here

like image 133
bromelio Avatar answered Oct 28 '25 07:10

bromelio


You can handle errors in sap vb script , please refer below articles as reference and handle error as per you requirement.

1) https://answers.sap.com/questions/9676858/error-while-logging-to-sap-through-excel.html

2) https://wiki.scn.sap.com/wiki/display/Img/Scripting%3A+Error+Handling+and+Debugging

like image 45
NoSpaceForLove Avatar answered Oct 28 '25 08:10

NoSpaceForLove



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!