Last filled row in a table control: I use the GetTableAttribute command in order to find out how many rows in a table are filled. But it doesn't work, since the variable  "lastvisiblerow" is higher than the number of filled table rows.

"lastvisiblerow" is the last visible row, but some table rows can be empty if the SAP application decides to append a couple of empty rows.

You need  to check for empty rows at the end of the table in your script, starting with "lastvisiblerow", and decreasing the index until you find a non-empty row.