Skip to main content

Hi there!!

I’m building an automation that connects to SAP. In one step I need to double-click the 4th option in the ALV filter list. What SAP GUI Scripting records (works in SAP GUI)

session.findById("wndw1]/usr/subSUB_DYN0500:SAPLSKBH:0600/cntlCONTAINER1_FILT/shellcont/shell").currentCellRow = 4
session.findById("wndw1]/usr/subSUB_DYN0500:SAPLSKBH:0600/cntlCONTAINER1_FILT/shellcont/shell").selectedRows = "4"
session.findById("wndw1]/usr/subSUB_DYN0500:SAPLSKBH:0600/cntlCONTAINER1_FILT/shellcont/shell").doubleClickCurrentCell

However, at runtime it selects the 3rd option, not the 5th. (Bloqueo de pago) which I need to be selected

Questions

  1. In Community Edition, is there a native way to target a specific row index (e.g., row 5) on this SAP table and perform a double-click—similar to the SAP GUI script above?

  2. If “Invoke/Perform action by ID” is not available in CE, what’s the recommended approach?

    • e.g., Recorder with row parameter, keystrokes (Home + Down x4) before double-click, or another SAP package action?

  3. Is there any known zero-based vs one-based index behavior or scrolling offset that could explain why Recorder hits row 3 instead of row 5?

Hi ​@andrelo_jimenez,

 

1. Is there a native way in Community Edition (CE) to target a specific row index like SAP GUI scripting?
 

In the Community Edition, there is no direct equivalent to SAP GUI scripting currentCellRow or doubleClickCurrentCell methods. CE relies on Recorder, Object Cloning, or SAP-specific packages, but these often lack granular control over ALV grid internals.

However, you can try:

  • Recorder (Object-based): If the ALV grid rows are exposed as individual elements, you might be able to target them by index.
  • Keystroke Simulation: Use keyboard navigation (e.g., then Down x4) followed by Enter or Double-click.
  • Image Recognition (last resort): If rows are visually distinct, you can use image-based clicks, but this is fragile.

 

2. If “Invoke/Perform action by ID” is not available, what’s the recommended approach?

Since CE lacks direct scripting access:

Recommended workaround:

  • Use Keystrokes:
    1. Send Home to ensure you're at the top of the list.
    2. Send Down key 4 times to reach the 5th row.
    3. Send Enter or simulate a double-click.

This mimics the behavior of selecting a specific row without relying on object IDs.

Alternative:

  • Use Recorder with dynamic coordinates (if the row positions are consistent).
  • Use SAP GUI automation via VBScript (outside AA CE) and trigger it from AA if needed.

 

3.Is there any known zero-based vs one-based index behavior or scrolling offset?

Yes, this is very likely the root cause of your issue.

  • SAP GUI scripting uses zero-based indexing for many controls, but ALV grids can behave differently depending on:
    • Whether the grid is scrolled.
    • Whether the header is counted.
    • Whether filters are applied.

So when you set currentCellRow = 4, it might actually be selecting the 5th visible row, but if the grid is scrolled or filtered, it could be off by one.

Suggested fix:

Try setting currentCellRow = 5 and see if it selects the correct row. Also, ensure the grid is scrolled to the top before executing the script.


Reply