Are there one or two tables on screen?: I'm using a script to read Service data from Purchase Order (SAPLMLSP.0201) and I have referenced the table as "Table". However, if the "Limit" button has previously been selected there are 2 tables and mine is now Table.2, and therefore my script will fail. How can I ascertain if there are 1 or 2 tables on the screen?
You may use

if T[Table.2]
...
endif

For example,

if T[Table.2]
  Set V[tabname] "Table.2]"
else
  Set V[tabname] "Table"
endif

Set cell[&V[tabname],Material,1]" "&V[matnr]"

Another option is to use the technical field name for the table.