I am using VBA to read data from SAP GUI. Now I can open the destination page of SAP Logon, but cannot read data because I don't know table ID.
Set Table = Session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760")
This table ID is incorrect:
wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760
When the table (grid) shows up, how can I get its ID for VBA scripts?
From the SAP GUI technical information, I see:
- Program name:
SAPMM61R
- Table name:
MDSU
After click with the mouse on the table, its recorded script is like below:
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,4]").setFocus
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,4]").caretPosition = 11
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,6]").setFocus
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,6]").caretPosition = 12
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,7]").setFocus
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,7]").caretPosition = 12
session.findById("wnd[0]").sendVKey 2
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS").columns.elementAt(2).width = 12
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS").columns.elementAt(3).width = 12
session.findById("wnd[0]/usr/subINCLUDE1XX:SAPMM61R:0770/tabsPS_TAB/tabpPS_W/ssubPS_SUBSCR:SAPMM61R:0760/tblSAPMM61RTC_PS/txtMDSU-MNG02[2,7]").caretPosition = 14
session.findById("wnd[0]").sendVKey 2
Can you tell me from the above info what the table ID is? (Session.findById("?")
)
Thanks a lot!