Autofill Range in SAP

Hi all,

does anyone know how to set up filling rows in SAP if I don’t know how much I need to fill in? I create an order and the number of materials is different each time and I need to fill in some information. I don’t want to set a number like 20.

Thanks

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 -
    Session.FindById("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/shell").RowCount-1
    Replace the ID(“wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[1]/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.

Good Luck!!

Thank you @vikaskulhari. I will try it and let you know :slight_smile:

Hi @vikaskulhari,

I’m not sure I understand it well. Please could you send me PrintScreen? :no_mouth:

Thank you

Hi @Sajuri, you can refer below links

https://answers.sap.com/questions/11100660/how-to-get-a-correct-row-count-in-sap-table.html