Skip to main content

I'm developing a task to automate service contracts in SAP. I'm performing the following actions using the SAP Package:

  • Connect
  • Set text (to get to the correct screen)
  • Send virtual key (Enter)
  • Set text (to enter a contract number)
  • Send virtual key (Enter to search)
  • Get Text (extract specific field information)
  • Export Table (to get all the info from a table into a data table) or * Recorder Capture get entire table (to get the data into a data table)

After that I need to navigate to other areas like the Conditions screen. SAP becomes unresponsive on any other actions that navigate away from this screen at this point. I've experienced the screen hanging for up to 5 minutes before it carries out the action. Even performing a keystroke to navigate back (F3) causes the app to hang. It eventually DOES carry out the action. If I eliminate the table capture action I do NOT experience this. It navigates anywhere without any delay at all. I've tried creating a fresh task with just these actions in it and I get the same results after I capture a table.

Curious if anyone has experienced quirks like this when automating SAP and are there certain actions that should be avoided.

Other details:

  • Developing on Windows Server 2016 Datacenter
  • A360 Cloud

Hi @JMarino ,

 

Have you tried to change the Package version? If not, please try it and check after that.


@Padmakumar Do you mean downgrade the package? It’s already using the latest SAP package.


@JMarino  can you try this approach to read data 

 

Table data can be extracted easily using the SAP GUI command however at few places in SAP, the table has been incapsulated into GridView where the whole table/grid will be highlighted when capturing the grid view.

Example.


And the AA workbench shows below properties in AAE client


 

Instructions

In this case in order to loop through each record of the grid we can use the "Execute script" action and pass the script that is generated using the SAP recording.

Pre-requisites

  • This feature is included from AAE client 11.3.3.1 version so the client version must be equal or more than 11.3.3.1
  • In order to see the action 'Execute script', we must capture the whole window of SAP, example below.

After Capture we should see the SAP Control Type : GUIMainWindow

Additional Information

Automation using Execute script

  • In the script we can use variables, for example below script selects Row 5 and column name Tcode from the Grid 
  • session.findById("wndd0]/usr/cntlGRID1/shellcont/shell").setCurrentCell 5,"TCODE"
  • Here in place of Row/column, any of AA variable can be used. i.e.session.findById("wndI0]/usr/cntlGRID1/shellcont/shell").setCurrentCell $Counter$,"$Colum Name$"

Extracting Data

  • In order to extract data Keystroke Ctrl+C can be used to store the cell data which can be used using the 'Clipboard' variable.
  • When using keystrokes, please make sure to use the window title "Currently active window"
  • If looping through each record please make sure to use "Clear clipboard" command in each iteration

@rbkadiyam we are using A360 Cloud on Prem not V11


@JMarino Does it hang for all the tables ? or just for large tables, these commands scroll through table to fetch next set of rows and it can take time.

 

“Curious if anyone has experienced quirks like this when automating SAP and are there certain actions that should be avoided.”- SAP actions currently don't timeout, bot will stay stuck if some transaction takes long to load and SAP Login timeouts/connection closed due to server or connection error. 


@Sumit.K7 its does not hang on the table capture. It hangs afterwards when navigating anywhere else. It take 5-10 seconds for the table capture and then the BOT moves on to the next action (like F3 to navigate back). SAP literally says (Not responding) in the status bar when a navigation action is taken and the hourglass spins for 2+ minutes. And my bot does NOT stay stuck. AA does error out if I don’t have a delay in there waiting for SAP to be responsive to the keystrokes.

I’ve tried various methods of navigation including vb script but all have this result. IF I take the table capture out then navigation happens as expected.


The work around I have come up with is to NOT use any table capture actions (either recorder or SAP actions that get an entire table).

  1. Navigate the first table using SAP: Get Table Cell Text.
  2. When I’m on the row I want I execute keystrokes to get to the appropriate screen (contract conditions)
  3. Once on that screen I close the SAP session and call another subtask (note that this was necessary as the SAP: Get Table Cell Text stops working on the next screen with the error: Incorrect field path entered. Verify correct field path and try again. SAP stops being able to find correct paths for table cells at that point.)
  4. In the subtask I start a new SAP session and use SAP: Get Table Cell Text to get the data I need from multiple rows and return that data back to my main task
  5. I again start another SAP Session and continue.

I should mention I spent 90 minutes on the phone with AA support on this issue and this is the best we could come up with. Not ideal, but not as much of a hack as I was worried about.


Reply