Search code examples
treeviewsilktest

Text in tree does not match text which is displayed


When creating a relation in SAP and in case there are several possible types of relations, SAP shows a dialog to choose the relation like this:

Screenshot SAP create relation

However, when I query the node text using SapTree.getText() of Silk4J, I get the following results:

U
    B ZE3 9V
    B ZE3 U
    B 003 O

Where does this text come from, what does it mean and how do I get the text that is displayed to the user?

I have tried

  • there are no column names returned by SapTree.getColumnNames()
  • there are no column titles returned by SapTree.getColumnTitles()
  • SapTre.getColumnHeaders() returns two items, HierarchyHeader and ListItems. Calling getItemText() with any of those header names does not return the text displayed to the user.

Solution

  • You can right click the relation and choose "Show keys":

    Screenshot SAP context menu on relation

    This results in

    Dialog showing keys

    which explains the text. It consists of three parts:

    • X is the relationship type (A: bottom up, B: top down)
    • YYY is the relationship (relations starting with Z are custom relations)
    • ZZ is the type of the object to be linked (objects starting with 9 are custom objects)

    To get the text displayed to the user:

    • you can call SapTree.getItemText(key, "1") to get the relation text (e.g. B ZE3 9V)
    • you can call SapTree.getItemText(key, "2") to get the human readable relation description (e.g. beinhaltet)
    • you can call SapTree.getItemText(key, "3") to get the human readable target object text (e.g. Externe Person)