on ‎2018 Sep 07 3:04 PM
Hi,
I'm trying to automate some SAP actions with Excel.
I Recorded some Script from SAP an most is working just fine, I only have a problem selecting the active row in CS02 after positioning the right RowID.
Recording results in:
session.findById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").getAbsoluteRow(39).selected = true
But I can't select a row with the AbsoluteRow number since I don't know that number.
Any ideas how to select the entire line so it can be deleted?
Thanks.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi Daniel,
I tried that but I didn't work 😞
However, in the meantime I tried some other possible tactics and finally got it to work as I wanted.
objSess.FindById("wnd[0]/mbar/menu[1]/menu[10]").Select
objSess.FindById("wnd[1]/usr/subPOS_SETP:SAPLCSDI:0710/txtRC29P-SELPO").Text = <searchValue>
objSess.FindById("wnd[1]/tbar[0]/btn[0]").press
numrRow = objSess.FindById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").VerticalScrollbar.Position
objSess.FindById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").VerticalScrollbar.Position = numrRow + 1
objSess.FindById("wnd[0]").sendVKey 9
objSess.FindById("wnd[0]/tbar[1]/btn[14]").press
objSess.FindById("wnd[0]").sendVKey 0
objSess.FindById("wnd[1]/usr/btnSPOP-OPTION1").press
first 3 lines is positioning to the line I wanted to find.
then get the Vertical scrollbar position.
add 1 to that value (ie. scroll down one line so the line to be selected is just outside the visible window
then press F9 to select the line (for some reasons the line that get selected is the line which is outside the visible window, above the top visible line)
and then 3 lines to delete the selected line as I wanted to do.
Issue is solved with this solution.
Thanks to everybody who tried to help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
glad you got it working the way you wanted. Still, I tested Stefans suggestion in CS02
For i = 0 To session.FindById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").VisibleRowCount - 1
If session.FindById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT/txtRC29P-POSNR[0," & CStr(i) & "]").text = test Then
session.FindById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").GetAbsoluteRow(i).Selected = True
End If
Next
which works as expected. Only additional logic would be if you don't find it within the visible rows & have to page down.
Obviously replace txtRC29P-POSNR with the cell of your choice.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.