djchaney3 0 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. Share this post Link to post Share on other sites
djchaney3 0 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. Share this post Link to post Share on other sites
djchaney3 0 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. Share this post Link to post Share on other sites
JLogan3o13 1,637 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! Share this post Link to post Share on other sites
water 2,387 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 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
djchaney3 0 Posted July 3, 2019 Yes, I am trying to figure it all out. Share this post Link to post Share on other sites