Page 1 of 1

SAP GUI Scripting API - Maintain Selection Options

Posted: Fri Aug 23, 2013 7:47 am
by leppy
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("usr/cntlOPTION_CONTAINER/shellcont/shell").currentCellRow = 5
	$sess.ActiveWindow().findById("usr/cntlOPTION_CONTAINER/shellcont/shell").selectedRows = "5"

Func _ExtractMAPL()
	$sess.ActiveWindow().FindByID("usr/ctxtDATABROWSE-TABLENAME").Text = "MAPL"
	_NotEqual("usr/ctxtI11-LOW", "usr/btn%_I11_%_APP_%-VALU_PUSH", "X")
	_SaveLocalFile($mypath, "MAPL.txt")
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.