Solved

SAP Table Row Position Inconsistent

  • 12 December 2023
  • 2 replies
  • 174 views

Userlevel 2
Badge +8

I have a case where I need to loop a table in SAP and find the next blank row for entering new data. Currently, I’m looping the table and incrementing a iRow number variable to keep track of the position and I’m using the SAP action to get the value of column 1. I keep looping until vColValue is blank.

I have an issue when the SAP table screen scrolls down when using the SAP: Get table cell text action. This happens when all of the rows in the table are NOT visible on the screen. So for example, my counter may increment to row 15 being the next available row, but the row in SAP becomes a different number (like 1) after what’s visible on the screen after scrolling changes. So when I go to use SAP: Select Item By Text and use the row value from the counter, it fails because the row is in correct.

Please note that I am NOT scrolling the table using keystrokes or anything. I’m only using the get table cell and incrementing iRow.

I’ve been told by a coworker that there is both a visible row count and vertical scrollbar position in SAP and he’s sometimes used that in a SAP VB Script. I want to AVOID using VB Script. I prefer AA commands from a maintenance perspective.

Is there a way to reference the actual real row position in AA using an AA SAP command?

icon

Best answer by LoganPrice 14 December 2023, 21:27

View original

2 replies

Userlevel 3
Badge +9

I have no SAP experience, but since no one else has provided a solution yet, I’ll go ahead and take a look to see if I can give a fresh perspective or idea.

 

First of all, can you describe more about what you are trying to get from the table and whether you are performing any other operations on the table during or after the iterations?

 

Just looking at the AA SAP package, I wonder if there are other actions that could help you achieve what you want:

  1. If you are just extracting data, could you use the Export Table action?
  1. If you are iterating over the rows and stopping at each row, could you use the Get Row Count action to and use a For Number loop instead? Let’s say the table had 30 rows, so you would iterate 30 times and the iRow counter would continue increasing until the end of the table.
  1. Last one seems like a shot in the dark, but would sending virtual keys (SAP package) help? Again, I don’t know SAP, so maybe none of the SAP virtual keys would help in your case.

 

Userlevel 3
Badge +9

Hi @JMarino,

 

For the purpose of rounding out the Community knowledge base, would you mind sharing how you accomplished your goal? Your answer could help someone else in the future!

 

Thanks,

L. Price

Reply