Jump to content
PauloRodrigues

AutoIt combo box SAP manipulation

Recommended Posts

PauloRodrigues

I need to select an item from a SAP combobox, could anyone help me or did something like that? I tried to use some AutoIt functions but without success.

When i try to identify the combobox with au3Info, this is the return:

Nenhum texto alternativo automático disponível.

Could anyone help me with this challange?

Share this post


Link to post
Share on other sites
PauloRodrigues
13 minutes ago, JLogan3o13 said:

@PauloRodrigues have you tried looking at the SAP UDF? It works well as long as the SAP GUI Scripting Interface is enabled.

 

Yes, i look out this SAP UDF i'm using this to automate SAP, but in this challange i have to identify this combo box and this AutoItInfo don't give me something to manipulate.
i'm trying to use the autoit3 functions to manipulate ComboBox and to identify Control ID/Handle to the control:
Func. like this--> '_GUICtrlComboBox_AddDir' ; _GUICtrlComboBox_GetEditText; _GUICtrlComboBox_GetLBText; _GUICtrlComboBox_GetList;

 

Share this post


Link to post
Share on other sites
JLogan3o13

If the Window Info Tool is not giving you what you need, have a look at the IUIAutomation thread in the examples forum. What does Simple Spy show you?

Also, please use the reply button rather than quoting everything, it pads the thread unnecessarily. I know what I said, I was there when I said it ;)

 

Edited by JLogan3o13
  • Like 1

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
PauloRodrigues

" Also, please use the reply button rather than quoting everything, it pads the thread unnecessarily. I know what I said, I was there when I said it ;) "

Oh, i'm sorry !!! :)

I resolve this challenge, after this afternoon i'll share it here.

Share this post


Link to post
Share on other sites
PauloRodrigues
If($itemDoComboBox="") Then

      _registrarLog($PARAMETRO1,$PARAMETRO2,"PARAMETRO3 - MSG ", $PARAMETRO4, 1)

   Else

      $sap_session.findById("wnd[" & $sap_window_num & "]/usr/tabsTABSTRIP1/tabpLAW/ssubMAINAREA:SAPLSUID_MAINTENANCE:1112/cmbSUID_ST_NODE_UCLASS-LIC_TYPE").value = $itemDoComboBox

      If(_SAPObjPropertyGet("usr/tabsTABSTRIP1/tabpLAW/ssubMAINAREA:SAPLSUID_MAINTENANCE:1112/cmbSUID_ST_NODE_UCLASS-LIC_TYPE", "key")="") Then

            _registrarLog($PARAMETRO1,$PARAMETRO2,StringFormat("O usuário será criando sem itemDoComboBox, pois a o item: $s Não existe no combobox",$itemDoComboBox), 1)


      EndIf

EndIf

This resolve my problem. Where i have fixed values in this combobox

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • gahhon
      By gahhon
      So I had compiled my AutoIT script into executable file, I think like few weeks ago.
      But once after I compiled the script to executable file, I tested it and it work as expected.
      Somehow, I just now wanna try to execute it but failed

      Any idea what's is going on? Do I need to recompile the script again? @@
    • gahhon
      By gahhon
      I have a python script automate.py and I wanna run it via CMD.
      As I know to execute python via CMD is something like this
      $CMD = "Something python here" Run(@ComSpec & " /c " & $CMD) But how can I just open the 1 CMD and send multiple commands to the CMD based on the function called?
      For instance like:

      Launch CMD and send python then send import automate If google() function is called - send automate.google() to the CMD If yahoo() function is called - send automate.yahoo() to the CMD  I don't want to execute multiple CMD to call the automate functions. This is due to inside the python script have global variable to handle duplicate flag.
      So if I execute multiple CMD to call the functions, the global variable will be keep new as NULL. Which is not my expectation.
       
      Thanks
    • gahhon
      By gahhon
      I only found that AutoIt can actually execute the entire python script or execute the .exe (converted to .exe from .py)
      But what if I just want call the particular function? If that possible to do so?
      This is because python can't create fancy GUI like AutoIT does. So my plan is use AutoIT to have fancy GUI.
      Then each buttons will trigger specific function in the python script or .exe file.
      For instances:
      btnSum - trigger function in python script or .exe file (funcSum)
      btnMinus - trigger function in python script or .exe file (funcMinus)
       
      Thanks for advance information.
    • nacerbaaziz
      By nacerbaaziz
      Hello my friends
      Can we create a single context menu on more than one item?
      For example, a context menu includes standardized options on more than one control, such as buttons or check boxes
      to Create a context menu on one item am using this function
      GUICtrlCreateContextMenu ($ HWND)
      How to link it with more than one element please?
      or if we can't do that, please give me a solution
      so i tried to add an context menus to all the controls but the script will be long, for that if their are any solutions i hope to give it to me
      thanks in advanced
    • gahhon
      By gahhon
      _Metro_SplashTextScreen(1, "", $iMsg) AdlibRegister("_Metro_LoopInProgress") DirRemove($DIR_WA_FOLDER, 1) Local $iCopy = _WinAPI_ShellFileOperation($CUR_WA_FOLDER, $DIR_WA_FOLDER, $FO_COPY, BitOr($FOF_SIMPLEPROGRESS, $FOF_NOCONFIRMMKDIR)) AdlibUnRegister("_Metro_LoopInProgress") _Metro_SplashTextScree If @error Then _Metro_MsgBox(0, "", $iCopy) _FileWriteLog($LOG_INSTALLATION, "Error: " & $iCopy) Else _Metro_MsgBox(0, "", "Application is up to date!") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is up to date.") EndIf According to the help file of _WinAPI_ShellFileOperation there are a lot of failure and error code. But how can I handle all of them and display corresponding error message based on the help file?
      The incident is like this:
      I'll lock the folder with permission, so when I execute the _WinAPI_ShellFileOperation to copy and overwrite the folder contents, it popped me an error message saying that permission issue to caused I can't access the folder and overwrite the contents.

      Then I clicked Cancel button, and my AutoIT application exit immediately and it's not execute the function _Metro_MsgBox(0, "", $iCopy) to display the message.
       
      Anyway, I did also tried the code below, the it still display "Application is up to date!"
      According to the help file, 120 - Security settings denied access to the source.
      If @error = 120 Then _Metro_MsgBox(0, "", $iCopy) _FileWriteLog($LOG_INSTALLATION, "Error: " & $iCopy) Else _Metro_MsgBox(0, "", "Application is up to date!") _FileWriteLog($LOG_INSTALLATION, "Debug: Application is up to date.") EndIf  
×