djchaney3 Posted June 19, 2019 Share Posted June 19, 2019 Hello all, I am new to Autoit, I have been coding in VBA for a while now and now I am trying to do some .exe files. I am trying to write a program to do the following: open SAP Go to a company TCODE Once in the TCODE I need to hide Columns and Filter by one column I am not sure how to select a column and hide it, or how to select it and apply a filter. Here is my current code (I blocked out company data) expandcollapse popup#include <Constants.au3> #include <SAP.au3> ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win10 ; Author: ; ; Script Function: ; Opens TCODE ZFAS within SAP. ; ;-Begin----------------------------------------------------------------- ; Open SAP Run("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\sapgui.exe /H/saperp.xxxxxxx.com") ; Wait 1 second to allow SAP to open WinWaitActive ("[CLASS:SAP_FRONTEND_SESSION]","SAP",1) Send ("UserName") Send ("{TAB}") Send ("Password") Send ("{ENTER}") ; Attach to the session window _SAPSessAttach("[CLASS:SAP_FRONTEND_SESSION]") ; Put the value "/nZFAS" into the command field. _SAPObjValueSet("tbar[0]/okcd", "/nZFAS") _SAPVKeysSend("Enter") ; Press the Multiple Selection button. _SAPObjSelect("usr/btn%_PARBPL_%_APP_%-VALU_PUSH") ; Attach to the selection window _SAPSessAttach("Multiple Selection for Work center") ; Put the Work Center into the lower and upper field. _SAPObjValueSet("usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,0]","76") _SAPObjValueSet("usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,1]","76R") _SAPVKeysSend("F8") ; Attach to the session window _SAPSessAttach("[CLASS:SAP_FRONTEND_SESSION]") _SAPVKeysSend("F8") Sleep (5000) _SAPObjSelect Any help would be appreciated. Link to comment Share on other sites More sharing options...
djchaney3 Posted June 19, 2019 Author Share Posted June 19, 2019 1 hour ago, djchaney3 said: Hello all, I am new to Autoit, I have been coding in VBA for a while now and now I am trying to do some .exe files. I am trying to write a program to do the following: open SAP Go to a company TCODE Once in the TCODE I need to hide Columns and Filter by one column I am not sure how to select a column and hide it, or how to select it and apply a filter. Here is my current code (I blocked out company data) expandcollapse popup#include <Constants.au3> #include <SAP.au3> ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win10 ; Author: ; ; Script Function: ; Opens TCODE ZFAS within SAP. ; ;-Begin----------------------------------------------------------------- ; Open SAP Run("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\sapgui.exe /H/saperp.xxxxxxx.com") ; Wait 1 second to allow SAP to open WinWaitActive ("[CLASS:SAP_FRONTEND_SESSION]","SAP",1) Send ("UserName") Send ("{TAB}") Send ("Password") Send ("{ENTER}") ; Attach to the session window _SAPSessAttach("[CLASS:SAP_FRONTEND_SESSION]") ; Put the value "/nZFAS" into the command field. _SAPObjValueSet("tbar[0]/okcd", "/nZFAS") _SAPVKeysSend("Enter") ; Press the Multiple Selection button. _SAPObjSelect("usr/btn%_PARBPL_%_APP_%-VALU_PUSH") ; Attach to the selection window _SAPSessAttach("Multiple Selection for Work center") ; Put the Work Center into the lower and upper field. _SAPObjValueSet("usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,0]","76") _SAPObjValueSet("usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/ctxtRSCSEL_255-SLOW_I[1,1]","76R") _SAPVKeysSend("F8") ; Attach to the session window _SAPSessAttach("[CLASS:SAP_FRONTEND_SESSION]") _SAPVKeysSend("F8") Sleep (5000) _SAPObjSelect Any help would be appreciated. Link to comment Share on other sites More sharing options...
djchaney3 Posted June 19, 2019 Author Share Posted June 19, 2019 Did not mean to double post... Meant to say I figured out the Filter, but not how to hide the other columns. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 19, 2019 Moderators Share Posted June 19, 2019 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted June 19, 2019 Share Posted June 19, 2019 Did you have a look at the SAP UDF to automate the SAP GUI? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
djchaney3 Posted July 3, 2019 Author Share Posted July 3, 2019 Yes, I am trying to figure it all out. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now