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 Stefan
I searched a long time how select an item in CS02.
The problem with 'getAbsoluteRow().selected = true' and 'VisibleRowCount' is that it does not work proprely and I had to use 'on error resume next'. Now I could find the row number after use menu 'edit\Position'.
You can find the position on field RC29P-ENTAC, example select pos. 305
session.findById("wnd[0]/tbar[0]/okcd").text = "/ncs02"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/ctxtRC29N-MATNR").text = "material number"
session.findById("wnd[0]/usr/ctxtRC29N-WERKS").text = "plant"
session.findById("wnd[0]/usr/ctxtRC29N-STLAN").text = "1"
session.findById("wnd[0]/tbar[1]/btn[5]").press
session.findById("wnd[0]/mbar/menu[1]/menu[11]").select
session.findById("wnd[1]/usr/subPOS_SETP:SAPLCSDI:0710/txtRC29P-SELPO").text = "0305"
session.findById("wnd[1]/tbar[0]/btn[0]").press
Pos_nb = (session.findById("wnd[0]/usr/txtRC29P-ENTAC").text)
session.findById("wnd[0]/usr/tabsTS_ITOV/tabpTCMA/ssubSUBPAGE:SAPLCSDI:0152/tblSAPLCSDITCMAT").getAbsoluteRow(Pos_nb - 1).selected = True
Best regards
Jean-Luc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| 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.