SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Nov 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    check sap popupmenu

    hello,

    I want to check a popup menu that appears when clicking on an icon in a SAPToolBarControl. I am not sure how to do this though. The items in this popup menu are either set or not. I want to check if they are set.
    I do not know how to get the items of that popup menu. I don't know how to attach to it.
    The clicking on the item is no problem. When recording the code is now:
    <font class="small">Code:</font><hr /><pre>SAPToolBarControl("SAPToolBarControl ~1").Attach
    SAPToolBarControl.PopupMenuSelect "Value1"</pre><hr />
    So setting is no problem. Just checking if something's set. I cannot find a routine in SAPToolBarControl that seems capable of fetching the values. I have methods as FindItem and GetMenu, but aren't they only returning the menu of the ToolBarControl and not the Popupmenu?

    I also tried a rather not so nice method. When checking or unchecking the values in the popup menu other things change in the window. So I tried to test if a certain value in a TreeView exists. But TextSelect or SelectItem both have an error as result, which I cannot work with because the script stops. Isn't there a method wich does not crash the script but just returns false? tpAttachNoWait didn't help this.

  2. #2
    Junior Member
    Join Date
    Nov 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    no ideas or tips what i could have a look into?

  3. #3
    Senior Member
    Join Date
    Apr 2003
    Location
    Wisconsin, USA
    Posts
    5,338
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    Did you try calling Compuware tech support?

    Even though there is a lot of expertise here, that doesn't mean that we have all the answers. Your best bet is to always check with tech support for the particular problem you are having. Chances are they have a much more extensive knowledge base on their product than we do.

  4. #4
    Junior Member
    Join Date
    Nov 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    tech support will be here tomorrow, but i thought, if somebody had an answer, i could go on working a lot sooner [img]/images/graemlins/smile.gif[/img]

  5. #5
    Member
    Join Date
    Jul 2003
    Location
    Germany
    Posts
    458
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    Did you examine the SAPToolBar object (or in your case SAPToolBarControl)? See sample script below, modify the script so that is uses your SAPToolBarControl. Add a breakpoint in the line "Set sapToolBarObj = ...", execute the script, it should stop in the breakpoint. Press F8 to execute a single script line. Right click the variable sapToolBarObj and select "Add watch" from the context menu. Use the "+" icons to navigate through the objects and try to find the information you need. You can then access the information programatically.

    Sub Main()

    SAPWindow("SAP Easy Access SAPWindow").Attach

    SAPToolBar("SAPToolBar").Attach
    Set sapToolBarObj = SAPToolBar.Object

    End Sub

    Another easy way would be to create a property check for the menu, but for the menu I tested it was not able to retrieve the information.

  6. #6
    Junior Member
    Join Date
    Nov 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    That's a cool trick. [img]/images/graemlins/smile.gif[/img]

    Only problem is, that it doesn't show any of the information I want. Neither the listed buttons in the toolbarcontrol, nor, more importantly, the popupmenu items.

    It seems weird to me, that there is only a PopupMenuSelect method and not one to show which items are selectable. What does the PopupMenuSelect method do? Or better - how can I find out, what it does? Does it create a new popupmenu object which uses its reference to the SAPToolBarControl to select the item?

    Thanks for the help, by the way. Even if it did not solve this specific problem (or I didn't recognize it as solution), it still taught me something new [img]/images/graemlins/smile.gif[/img]

  7. #7
    Junior Member
    Join Date
    Nov 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    Okay, since we solved that yesterday by looking at another object that changed when something in the popup was clicked, there now is another problem with the popup menu.

    As we noticed yesterday it is pretty slow. Now it doesn't even want to PopupMenuSelect an item.

    This is what my code looks like:
    SAPWindow("Name='wnd[0]'").Attach
    Window("Window_0002", tpAttachChild).Attach
    SAPToolBarControl("SAPToolBarControl ~1").Select "Einstellungen", tpMouseDown
    Sleep 2
    SAPWindow("Name='wnd[0]'").Attach
    Window("Window_0002", tpAttachChild).Attach
    SAPToolBarControl("SAPToolBarControl ~1").PopupMenuSelect "Technische Sicht"

    As you see, I put sleep commands in it in order to wait for the menu to appear. I am sure after 2 seconds it's there, but still it says: "The window does not have a menu"

    This is also happening with 4 or whatever seconds. I can see the PopupMenu, so it does exist. This also happens with freshly recorded code.

  8. #8
    Member
    Join Date
    Jul 2003
    Location
    Germany
    Posts
    458
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    Did you try SAP's VBS recording? It can be found on the left-most colored icon the upper icon bar of the SAP GUI (next to the ? icon for help). If you click on it a context menu appear. Select "Script Recording an Playback" here. This is a very simple script recorder, just trhee buttons!

    If this works you can copy/paste the script to TestPartner and execute it there, all you need is the global session object, see below. I also added a sample script.

    Regards,
    Tom


    ' global SAP sesssion object

    ' Put this in a shared module to make the sap session object available globally
    ' This allows you to copy/paste sap vbs macros to TestPartner an execute it directly
    ' All you need is to attach to SAPWindow, see sample script below

    Public Property Get session() As Object
    Set session = SAPWindow.Object.Parent
    End Property



    --------------------------------------------------------------------------------------------------------------
    ' Sample script:
    Sub Main()

    SAPWindow("Application=saplogon.exe").Attach
    session.findById("wnd[0]").resizeWorkingPane 137, 28, False
    session.findById("wnd[0]/tbar[0]/okcd").Text = "bibs"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/usr/subSA_0100_1:SAPLEXAMPLE_ENTRY_SCREEN:0200/subSA_200_1:SAPLEXAMPLE_ENTRY_SCREEN:0800/cntlCC_HTML_INDEX/shellcont/shell").sapEvent "", "", "sapevent:TLC_SHORT?TLC"
    session.findById("wnd[0]/usr/subSA_0100_1:SAPLEXAMPLE_ENTRY_SCREEN:0200/subSA_200_2:SAPLEXAMPLE_ENTRY_SCREEN:2100/tblSAPLEXAMPLE_ENTRY_SCREENTC535").verticalScrollb ar.Position = 1

    End Sub

  9. #9
    Junior Member
    Join Date
    Nov 2006
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check sap popupmenu

    Thanks.

    This worked. Too bad that it is kind of unflexible.
    Should probably only be used, if there's no other way, right?

    Btw, it was the right-most icon ;-)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.34%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:35 AM.

Copyright BetaSoft Inc.