This website is not affiliated with, sponsored by, or approved by SAP AG.

SAP GUI Scripting API - Maintain Selection Options

Interfaces (ALE, IDOC, RFC, EDI etc.)

Moderators: Snowy, thx4allthefish

SAP GUI Scripting API - Maintain Selection Options

Postby leppy » Fri Aug 23, 2013 7:47 am

I have been using this for some time to automate SAP but have come across something that I thought there might be a simpler method to do.

I have created a script to run SE16 for table MAPL and then export the data to a file. The only thing I haven't figured out is an easy method to set the Selection Option (Not Equal, Less Than, Etc)

Code: Select all
Func _NotEqual($textfield, $btnname, $value)
   $sess.ActiveWindow().FindByID($textfield).Text = $value
   $sess.ActiveWindow().findById($btnname).press
   $sess.ActiveWindow().findById("usr/tabsTAB_STRIP/tabpSIVA/ssubSCREEN_HEADER:SAPLALDB:3010/tblSAPLALDBSINGLE/btnRSCSEL-SOP_I[0,0]").press
   $sess.ActiveWindow().findById("usr/cntlOPTION_CONTAINER/shellcont/shell").currentCellRow = 5
   $sess.ActiveWindow().findById("usr/cntlOPTION_CONTAINER/shellcont/shell").selectedRows = "5"
   $sess.ActiveWindow().findById("usr/cntlOPTION_CONTAINER/shellcont/shell").doubleClickCurrentCell
   $sess.ActiveWindow().findById("tbar[0]/btn[8]").Press()
EndFunc

Func _ExtractMAPL()
   $sess.SendCommand("/nSE16")
   $sess.ActiveWindow().FindByID("usr/ctxtDATABROWSE-TABLENAME").Text = "MAPL"
   $sess.ActiveWindow().FindByID("tbar[1]/btn[7]").Press()
   _NotEqual("usr/ctxtI11-LOW", "usr/btn%_I11_%_APP_%-VALU_PUSH", "X")
   $sess.ActiveWindow().FindByID("tbar[1]/btn[8]").Press()
   _SaveLocalFile($mypath, "MAPL.txt")
   $sess.ActiveWindow().SendVKey(12)
   $sess.ActiveWindow().SendVKey(12)
EndFunc


Essentially what I want to know is if there is a one- or two-liner to replace _NotEqual. FYI the code is for AutoIt, but the API calls are all standard.

Thanks in advance.
leppy
 
Posts: 1
Joined: Fri Aug 23, 2013 6:32 am

Return to Interfaces

Who is online

Users browsing this forum: No registered users and 7 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.