Hi @Sajuri, your question is not that much clear to me however I’m trying to answer you.
I think you are creating an order and in that order you need to insert multiple items but the problem is - you dunno how many rows are there, right?
So in order to get the visible row counts you can use below VB Script command and loop through your program till last line -
Replace the ID(“wnd/usr/cntlGRID1/shellcont/shell/shellcont/shell”) with your SAP table ID
You can use keystrokes like first set focus on the first row then keep pressing down arrow key until your program throws an error. you can handle the error using try catch.