SAPTLIST_TREE_CONTROL_DEMO

In the SAPTLIST_TREE_CONTROL_DEMO there is an property of an item usebgcolor which makes the items grey when set to 'X'. If I run this example on my computer, only the item 'SAPTROX1', node_key 'new3' item name '1' appears in grey. Other computers on other systems from collegues display all items in grey, because it's written in the code, every item has the usebgcolor set to 'X'.
The question is:
Why is only the SAPTROX1-item grey on my computer, a college on the same system has the same output. If it would be a question wether display colors are set or not, wouldn't <b>every</b> item appear (or not at all) in a different color??
This is a complete mystery for me.
If this question is solved, you can provide me with the help for setting the background color for an item of the list_tree_control to green, to display all items of a node in this color...
Could this be a sapgui problem? We are here on 710 Final Release, 7100.1.1.1028, Build 898946, Patch Level 1.
Message was edited by:
        Mario Schmidt

It was a sap gui problem.

Similar Messages

  • Problem: SAPTLIST_TREE_CONTROL_DEMO

    Hi all,
    right now i m working with SAPTLIST_TREE_CONTROL_DEMO program.
    now the problem is that, i have an internal table which have multiple records, now i want to print all records in internal table through
    INCLUDE TLIST_TREE_CONTROL_DEMOF01
    my code is look like :
    LOOP AT I_FINAL.
      CLEAR ITEM.
      item-node_key = c_nodekey-new1.
      ITEM-ITEM_NAME = '2'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 4.
      ITEM-USEBGCOLOR = 'X'.
      ITEM-TEXT = I_FINAL-MTART.
      "ITEM-TEXT = '01'.
      APPEND ITEM TO ITEM_TABLE.
      CLEAR ITEM.
      item-node_key = c_nodekey-new1.
      ITEM-ITEM_NAME = '3'.
      ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
      ITEM-LENGTH = 11.
      ITEM-USEBGCOLOR = 'X'.                                    "
      "ITEM-TEXT = 'Zert'.
      ITEM-TEXT = I_FINAL-IDNRK+9(9).
      APPEND ITEM TO ITEM_TABLE.
    CLEAR ITEM.
    item-node_key = c_nodekey-new1.
    ITEM-ITEM_NAME = '4'.
    ITEM-CLASS = CL_GUI_LIST_TREE=>ITEM_CLASS_TEXT.
    ITEM-ALIGNMENT = CL_GUI_LIST_TREE=>ALIGN_AUTO.
    ITEM-FONT = CL_GUI_LIST_TREE=>ITEM_FONT_PROP.
    item-text = ''(006).
    APPEND ITEM TO ITEM_TABLE.
    ENDLOOP.
    but dump error is occured when record is greater than one.
    with one record report is running successfully.
    plz reply as soon as possible
    thanx in advance.

    1 FUNCTION AC_SYSTEM_FLUSH .
      2 *"----
      3 ""Lokale Schnittstelle:
      4 *"  IMPORTING
      5 *"     VALUE(CALLED_BY_SYSTEM) TYPE  C OPTIONAL
      6 *"  EXCEPTIONS
      7 *"      CNTL_SYSTEM_ERROR
      8 *"      CNTL_ERROR
      9 *"----
    10   data: sysubrc like sy-subrc.
    11
    12   CALL FUNCTION 'AC_FLUSH_CALL'
    13        EXPORTING
    14             SYSTEM_FLUSH = 'X'
    15             CALLED_BY_SYSTEM = CALLED_BY_SYSTEM
      16        IMPORTING
      17             MESSAGE_NR   = sysubrc
      18             MESSAGE_TEXT = SY-MSGLI.
      19
      20   sy-subrc = sysubrc.
      21
      22   CASE SY-SUBRC.
      23     WHEN 0.
      24     WHEN 1.
      25 *     system_error
      26       MESSAGE ID 'CNDP' TYPE 'X' NUMBER 007 RAISING CNTL_SYSTEM_ERROR.
      27     WHEN 2.
      28 *     method_call_error
    >>>>       MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.
      30     WHEN 3.
      31 *     property_set_error
      32       MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.
      33     WHEN 4.
      34 *     property_get_error
      35       MESSAGE ID 'CNDP' TYPE 'X' NUMBER 006 RAISING CNTL_ERROR.
      36     WHEN OTHERS.
        Technical information about the m
        Message class....... "CNDP"
        Number.............. 006
        Variable 1.......... " "
        Variable 2.......... " "
        Variable 3.......... " "
        Variable 4.......... " "

  • Org unit tree

    hallow did some have a exemple of report like tree of org unit that when you open u see org unit and under org unit and employee regards

    U can have a look at some demo reports by SAP for tree structure development.
    SAPSIMPLE_TREE_CONTROL_DEMO
    SAPCOLUMN_TREE_CONTROL_DEMO
    SAPTLIST_TREE_CONTROL_DEMO
    Hope these reports will be helpful for U.
    Award points if helpful info.
    ~BiSu

  • ALV Tree Edit mode

    Hi,
    I have wrote a program using CL_GUI_ALV_TREE.
    I want to make some of the columns editable.
    Alternatively, is it possible to include a tree structure in normal CL_GUI_ALV_GRID?
    Thanks.
    Michael Pang

    Hi Leif,
    I have not achieved that myself. Maybe you could use a different approach: display the fields into the tree, then use another subscree to show the field contents and allow the user to chage it.
    You could find useful these demo programs: SAPSIMPLE_TREE_CONTROL_DEMO, SAPCOLUMN_TREE_CONTROL_DEMO, SAPTLIST_TREE_CONTROL_DEMO, SAPTLIST_TREE_CONTROL_DEMO_HDR, because they show a tree and then, in another subscreen, they show some properties of the selected fields and so.
    I hope it helps. Best regards,
    Alvaro

  • Problem with Copied Code finding Public Method

    Hi Guys,
    I'm an old R/2 programmer trying to get my head around OO coding.
    I have copied, in it's entirety, the SAP example program SAPTLIST_TREE_CONTROL_DEMO, as I'm trying to create a Tree based access to reports (don't ask, the user just wants it!).
    I've copied and activate all the standard include programs as follows:
    *& Modulpool         ZMM_COCKPIT_DISPLAY                               *
    INCLUDE ZMMC_COCKPIT_DISPLAY_TOP.
    INCLUDE ZMMC_COCKPIT_DISPLAY_CL1.
    INCLUDE ZMMC_COCKPIT_DISPLAY_O01.
    INCLUDE ZMMC_COCKPIT_DISPLAY_I01.
    INCLUDE ZMMC_COCKPIT_DISPLAY_F01.
    All the programs syntax check successfully, except ZMMC_COCKPIT_DISPLAY_F01 which displays the error message <i>'Method "HANDLE_NODE_DOUBLE_CLICK" is unknown or PROTECTED or PRIVATE'</i>, yet this does not prevent the include program from activating.
    The Section of code that is failing is:
    assign event handlers in the application class to each desired event
      SET HANDLER G_APPLICATION->HANDLE_NODE_DOUBLE_CLICK FOR G_TREE.
      SET HANDLER G_APPLICATION->HANDLE_ITEM_DOUBLE_CLICK FOR G_TREE.
      SET HANDLER G_APPLICATION->HANDLE_EXPAND_NO_CHILDREN FOR G_TREE.
      SET HANDLER G_APPLICATION->HANDLE_LINK_CLICK FOR G_TREE.
      SET HANDLER G_APPLICATION->HANDLE_BUTTON_CLICK FOR G_TREE.
      SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR G_TREE.,
    When double clicking on the HANDLE_NODE_DOUBLE_CLICK, the SAP then goes to the following code in the ZMMC_COCKPIT_DISPLAY_CL1 program:
    CLASS LCL_APPLICATION DEFINITION.
      PUBLIC SECTION.
       METHODS:
         HANDLE_NODE_DOUBLE_CLICK
           FOR EVENT NODE_DOUBLE_CLICK
           OF CL_GUI_LIST_TREE
           IMPORTING NODE_KEY,
         HANDLE_EXPAND_NO_CHILDREN
           FOR EVENT EXPAND_NO_CHILDREN
           OF CL_GUI_LIST_TREE
           IMPORTING NODE_KEY,
         HANDLE_ITEM_DOUBLE_CLICK
           FOR EVENT ITEM_DOUBLE_CLICK
           OF CL_GUI_LIST_TREE
           IMPORTING NODE_KEY ITEM_NAME,
         HANDLE_BUTTON_CLICK
           FOR EVENT BUTTON_CLICK
           OF CL_GUI_LIST_TREE
           IMPORTING NODE_KEY ITEM_NAME,
         HANDLE_LINK_CLICK
           FOR EVENT LINK_CLICK
           OF CL_GUI_LIST_TREE
           IMPORTING NODE_KEY ITEM_NAME,
         HANDLE_CHECKBOX_CHANGE
           FOR EVENT CHECKBOX_CHANGE
           OF CL_GUI_LIST_TREE
           IMPORTING NODE_KEY ITEM_NAME CHECKED.
    ENDCLASS.
    CLASS LCL_APPLICATION IMPLEMENTATION.
      METHOD  HANDLE_NODE_DOUBLE_CLICK.
        " this method handles the node double click event of the tree
        " control instance
        " show the key of the double clicked node in a dynpro field
        G_EVENT = 'NODE_DOUBLE_CLICK'.
        G_NODE_KEY = NODE_KEY.
      ENDMETHOD.
    Lastly, the class definition, implementation and other required objects are defined in the ZMMC_COCKPIT_DISPLAY_TOP program as:
    *& Include  ZMMC_COCKPIT_DISPLAY_TOP                                   *
    REPORT SAPTLIST_TREE_CONTROL_DEMO MESSAGE-ID TREE_CONTROL_MSG.
      Screen Element Components   *********************
      CLASS LCL_APPLICATION DEFINITION DEFERRED.
      CLASS CL_GUI_CFW DEFINITION LOAD.
    CAUTION: MTREEITM is the name of the item structure which must
    be defined by the programmer. DO NOT USE MTREEITM!
      TYPES: ITEM_TABLE_TYPE LIKE STANDARD TABLE OF ZMMC_TREEITM
             WITH DEFAULT KEY.
      DATA: G_APPLICATION TYPE REF TO LCL_APPLICATION,
            G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
            G_TREE TYPE REF TO CL_GUI_LIST_TREE,
            G_OK_CODE TYPE SY-UCOMM.
    (NB:  ZMMC_TREEITM is a copy of the structure MTREEITM).
    All the programs are active, and have no syntax errors.
    Any ideas on how to make the error message vanish?  I don't know, but it must be resolved because it is causing the program to abend at runtime, claiming that the HANDLE_NODE_DOUBLE_CLICK cannot pass value 'NULL' to G_TREE.
    Thanks in advance.
    Stephen

    Hello Stephen
    I have made the following changes in the module pool (double-clicking on node executes a report (PFCG_MASS_TRANSPORT):
    <b>Include  TLIST_TREE_CONTROL_DEMOTOP:</b>
    * Fields on Dynpro 100
      DATA: G_EVENT(30),
            G_NODE_KEY TYPE TV_NODEKEY,
            G_ITEM_NAME TYPE TV_ITMNAME.
    * Collect nodes and items in globally accessible itabs
      DATA:
        gt_nodes    TYPE TREEV_NTAB,       " added
        gt_items    type ITEM_TABLE_TYPE.  " added
    *** INCLUDE TLIST_TREE_CONTROL_DEMOTOP
    <b>
      METHOD handle_expand_no_children.:</b>
    * Items of node with key 'New3'
          CLEAR item.
          item-node_key = 'New3'.
          item-item_name = '1'.
          item-class = cl_gui_list_tree=>item_class_text.
          item-length = 11.
          item-usebgcolor = 'X'. "
    *      ITEM-TEXT = 'SAPTROX1'.            " deleted
          item-text = 'PFCG_MASS_TRANSPORT'.  " added
        CALL METHOD g_tree->add_nodes_and_items
          EXPORTING
            node_table                     = node_table
            item_table                     = item_table
            item_table_structure_name      = 'MTREEITM'
          EXCEPTIONS
            failed                         = 1
            cntl_system_error              = 3
            error_in_tables                = 4
            dp_error                       = 5
            table_structure_name_not_found = 6.
        IF sy-subrc <> 0.
          MESSAGE a000.
        ENDIF.
        APPEND LINES OF node_table TO gt_nodes.  " added
        APPEND LINES OF item_table TO gt_items.   " added
      ENDMETHOD.                    "HANDLE_EXPAND_NO_CHILDREN
    <b>Form  CREATE_AND_INIT_TREE:</b>
    * add some nodes to the tree control
    * NOTE: the tree control does not store data at the backend. If an
    * application wants to access tree data later, it must store the
    * tree data itself.
      PERFORM build_node_and_item_table USING node_table item_table.
      CALL METHOD g_tree->add_nodes_and_items
        EXPORTING
          node_table                     = node_table
          item_table                     = item_table
          item_table_structure_name      = 'MTREEITM'
        EXCEPTIONS
          failed                         = 1
          cntl_system_error              = 3
          error_in_tables                = 4
          dp_error                       = 5
          table_structure_name_not_found = 6.
      IF sy-subrc <> 0.
        MESSAGE a000.
      ENDIF.
      APPEND LINES OF node_table TO gt_nodes.  " added
      APPEND LINES OF item_table TO gt_items.   " added
    ENDFORM.                               " CREATE_AND_INIT_TREE
    <b>METHOD  handle_node_double_click.:</b>
      METHOD  handle_node_double_click.
        " this method handles the node double click event of the tree
        " control instance
        BREAK-POINT.
        " show the key of the double clicked node in a dynpro field
        g_event = 'NODE_DOUBLE_CLICK'.
        g_node_key = node_key.
        DATA:
          ls_node    TYPE treev_node,
          ls_item    TYPE mtreeitm.
        READ TABLE gt_items INTO ls_item
             WITH KEY node_key  = node_key
                      item_name = '1'.
        IF ( syst-subrc = 0     AND
             ls_item-text IS NOT INITIAL ).
          SUBMIT (ls_item-text) VIA SELECTION-SCREEN
            AND RETURN.  " report !!!
        ENDIF.
      ENDMETHOD.                    "HANDLE_NODE_DOUBLE_CLICK
    I am not sure if I am correct but it appears that class CL_GUI_LIST_TREE does not provide any method to get hold of the node or item details. Thus, I collect them in my global itabs.
    Regards
      Uwe

  • Securing action box items with authority-check object

    In a 4.6c environment I have setup action box items for various sm and QM notifications.
    I would like to secure some of the action box items that their execution is only allowed by authorized personnel using authority-check objects.
    Is there a way to secure the action box item by the item number? If not the action box items are using a function module. Maybe I could use the fm name in the authority-check.
    Any ideas would be greatly appreciated.

    Hi,
    just see these examples
    SAPTLIST_TREE_CONTROL_DEMO_HDR
    SAPTLIST_TREE_CONTROL_DEMO
    SAPTLIST_TREE_MODEL_DEMO
    and for getting a checkbox we have to repalce the icon what is there in the example program and handle the checked and unchecked event for the checkbox.
    this can be achieved by using object oriented methods...
    reward if helpful
    rgds,
    Prajith
    Prajith

Maybe you are looking for