Forum Discussion

roli62's avatar
roli62
Occasional Contributor
2 years ago
Solved

How to work on a SAP ShellTree object and where to find SAP methods documentation?

I have bee using SAPWebGui for testing but I found that the SAPGui is more reliable and I am trying to switch over. But here I am facing issues with addressing objects.

 

I am testing SAPGui Release 800 with Quartz theme. I want to work on a ShellTree object with a couple of lines and columns. In the object browser, there are a lot of SAP methods for the ShellTree and my assumption is that I can use them for example to select items. I tried the SelectNode(NodeKey) in the assumption that the node is highlighted. But I don't know how the NodeKey is composed, so I took just simple integer values. Nothing is highlighted.

 

Then I executed shelltree.SelectedItemNode. This returned an object, but I cannot get a sensible content of the object and I don't know what I could expect from it. 

 

The bottom line of my question is how can I use the SAP methods in TC and where to find the documentation for them.

 

Thank you very much for supporting me.

 

 

  • The coding will be something like,

     

    var shelltree = sapsession.FindById("wnd[0]/usr/cntlTREE_CONTAINER/shellcont/shell/shellcont[1]/shell"); // Get tree control
    shelltree.currentCellRow = 2
    shelltree.doubleClickCurrentCell;

     

     

    See GuiTree Object to see methods and parameters, and Special Functions of the Tree Structure to understand the tree structure.

     

    Also, if you do a internet search, you can get snippets of coding.

5 Replies

    • roli62's avatar
      roli62
      Occasional Contributor

      Thank you rraghvani, but I know this page. My SAPGui is supported and I automated already a couple of things with SAPGui. However, I cannot operate on the ShellTree  and I cannot find any instructions on that.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    What does the Object Browser tree view look like for your control?

     

    For example,

     

    • roli62's avatar
      roli62
      Occasional Contributor

      Hi rraghvani,

      the first screenshot shows the object browser tree and the object typ "ShellTree":

      The following screenshot shows the methods I want to use (or should I say, that I think I can use for my purpose 😉 )  :

      And finally, this is the GUI I want to work on, e.g. select a node or enable a checkmark:

       

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The coding will be something like,

     

    var shelltree = sapsession.FindById("wnd[0]/usr/cntlTREE_CONTAINER/shellcont/shell/shellcont[1]/shell"); // Get tree control
    shelltree.currentCellRow = 2
    shelltree.doubleClickCurrentCell;

     

     

    See GuiTree Object to see methods and parameters, and Special Functions of the Tree Structure to understand the tree structure.

     

    Also, if you do a internet search, you can get snippets of coding.