I'm trying to automate T-Code-VA03.
I enter the PO number in PO number text box and press F8
.
This prompts a window which contains multiple rows of labels.
My requirement is, I want to select the one with latest date. I tried to record the script for it and below the code.
session.findById("wnd[0]/usr/txtRV45S-BSTNK").text = "123456789"
session.findById("wnd[0]/usr/txtRV45S-BSTNK").setFocus
session.findById("wnd[0]/usr/txtRV45S-BSTNK").caretPosition = 8
session.findById("wnd[0]").sendVKey 8
session.findById("wnd[1]/usr/lbl[49,6]").setFocus
session.findById("wnd[1]/usr/lbl[49,6]").caretPosition = 0
I can see there are labels with indexes. How can I iterate through whole window and take the focus to row with latest date?