JTree first displayed node

Hi,
I was looking at JTree API and I find a difference between viewable and displayed nodes: a viewable node is a child of an expanded node, and a displayed node is a viewable one that is indeed displayed in the screen (it falls in the tree visible area).
Now I want to know the first displayed node in the tree, but I don't see how to obtain it.
Any help would be appreciated.

Thanks, tjacobs.
I tried it but it is difficult to determine it this way.
I have a JScrollPane; then I try this:
int x = 50;
int y = getVerticalScrollBar().getValue() + 5;
TreePath firstPath = _tree.getPathForLocation(x, y);x = 50 is an attempt to know where the child is; as long as the tree gets expanded, it is greater, but I don't know at which level the tree is expanded in that location.
Any ideas?

Similar Messages

  • JTree problem displaying nodes

    I have created a GUI, in which part of it allows the user to view files in a selected folder in a JTree format.
    The tree only shows selected files with certain extensions (such as ".txt", ".doc", etc.. see code below)
    I'll try to show what it looks like, for example:
    - RootFolder
        - SomeOpenFolder
            - someFile
            - anotherFile
        + SomeClosedFolder
        - File_in_RootFolder
        - Another_file_in_RootFolder Anyhow, when I shipped it to my boss he occasionally cannot view the full file names..
    for example:
    - RootFolder
        - SomeOp....
            - some....
            - anothe...
        + SomeClo...
        - File_in_R...
        - Another_fil...I have the JTree inside a JScrollPane with horizontalScrollBarPolicy set to "AS_NEEDED"
    I have run several tests, with both LONG and SHORT names... and it all works just fine for me
    For example:
    - RootFolder
        - SomeOpenFolder
            - someFile
            - anotherFile_With_A_VERY_VERY_VERY_VERY_LOOOOOOOOOOOOOOOOOOOONG_NAME
        + SomeClosedFolder_With_A_VERY_VERY_VERY_VERY_LOOOONG_NAME
        - File_in_RootFolder
        - Another_file_in_RootFolder And i am able to scroll left&right to view the full name within the scroll panel.
    But for some reason, on my Bosses computer sometimes it has the full name,
    and other times it cuts the name short with "FolderNa..."
    Is anyone aware of why such a problem could happen?
    Here is my code setting up the tree.
    public void setMyTree(String myFolder)
    File rootFile = new File(myFolder);
            JTree targetTree = new JTree(TreeSetup(rootFile, InputIncludeFilter()));
            targetTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
            targetTree.setCellRenderer(new TreeCellRenderer() {
                  public Component getTreeCellRendererComponent(JTree tree, Object value,
                                boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
                      JLabel label = new JLabel(value.toString());
                      TreePath p = tree.getPathForRow(row);
                      if(p != null){
                          File node = getInputFile(p);                    
                      if (selected) {
                             label.setOpaque(true);
                             label.setBackground(tree.getBackground().darker());
                          return label;
                  private File getInputFile(TreePath path) {
                      StringBuffer fName = new StringBuffer();
                        boolean isroot = true;
                        for (Object s : path.getPath()) {
                                  fName.append(s + File.separator);                          
                      return new File(getUserDomain()+File.separator +
                                 fName.toString().substring(0, fName.toString().length() - 1));
    }Any ideas? Do would it help to see my method "InputIncludeFilter()"

    DefaultTreeCellRenderer extends from JLabel, so whatever you are doing to the JLabel you create you can do to the DefaultTreeCellRenderer too.
    This would be more like it:
           targetTree.setCellRenderer(new DefaultTreeCellRenderer() {
                  public Component getTreeCellRendererComponent(JTree tree, Object value,
                                boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
                     super.getTreeCellRendererComponent(tree,value,selected,expanded,leaf,row,hasFocus);
                      TreePath p = tree.getPathForRow(row);
                      if(p != null){
                          File node = getInputFile(p);                    
                      if (selected) {
                             this.setOpaque(true);
                             this.setBackground(tree.getBackground().darker());
                          return this;
                  }

  • How do I control the order in which JTree displays nodes?

    I'm trying to display the nodes in a JTree in a specific fashion, but I can't figure out how to change the order JTree displays them in. It seems the default is alphabetically, with leaves first and nodes with children second. I've spent a few hours pouring through the documentation, but I haven't been able to find out what I need to do. Anyone know?

    They are displayed in the order they are added on the same level.

  • How to not display nodes in a tree if Oracle roles are NOT used?

    How to not display nodes in a tree if Oracle roles are NOT used?
    We don't use Oracle DB roles to grant users access to Forms from the menu. We use a template and role system of our own. Basically a few tables with templates and roles.
    We want to convert our normal Forms menu to a tree menu and one of our key requirements is that when the tree is populated ONLY nodes with programs (i.e. forms) he has been granted to execute is shown.
    Since we don't use Oracle Roles how to do this in a tree?
    I created a function to show/hide LEAF nodes, BUT problem is that there are sub-menu nodes showing even if the leaf-nodes under it has not being displayed. My function has suppressed it.
    My tree query is like this:
    SELECT
         t.status, LEVEL, t.label, t.icon, t.node VALUE
    FROM
         tma_tree_menu t
    WHERE
    tma_authenticate_sys_chk_role(USER, t.node) = 1
    CONNECT BY
         PRIOR t.node = t.master
    START WITH
         t.MASTER IS NULL
    ORDER SIBLINGS BY
    t.position
    The tma_authenticate_sys_chk_role will return 1 only if the user has access to the form under that node.
    I tried the FTree functions in Forms but even that has nothing.
    Any help would be greatly appreciated.
    Edited by: Channa on Mar 17, 2010 6:49 AM

    Would you share the source code? I guess what I need is how exactly you retreive the user credentials from the DB table and set that boolean variable.
    and then how to condition it in UIX?

  • Error while installaing First MSCS Node in windows 2008 server

    Dear Gurus,
    I am facing a problem while installing the First MSCS Node on Windows Server 2008 SP2 with MSSQL.
    SAP: SAP ERP 6.0 SR3
    OS: Windows Server 2008 SP2
    MSS: MSSQL Server 2005 SP3
    please follow the below sapinst log.
    WARNING 2009-12-19 18:20:06.992
    Execution of the command "change user /install" finished with return code 1. Output:
    Install mode does not apply to a Terminal server configured for remote administration.
    INFO 2009-12-19 18:20:06.999
    Execute step replaceDLLs of component |MSCS_A|windows|ind|ind|ind|0|0|FirstSteps|windows|ind|ind|ind|0|0
    INFO 2009-12-19 18:20:07.007
    File not found: [C:/Users/ADMINI~1.JYO/AppData/Local/Temp/2/sapinst_exe.840.1261226937/msvcp71.dll].
    INFO 2009-12-19 18:20:07.008
    File not found: [C:/Users/ADMINI~1.JYO/AppData/Local/Temp/2/sapinst_exe.840.1261226937/msvcr71.dll].
    INFO 2009-12-19 18:20:07.13
    Execute step registerEventsDll of component |MSCS_A|windows|ind|ind|ind|0|0|FirstSteps|windows|ind|ind|ind|0|0
    INFO 2009-12-19 18:20:07.38
    Execute step NTpatch of component |MSCS_A|windows|ind|ind|ind|0|0|FirstSteps|windows|ind|ind|ind|0|0
    INFO 2009-12-19 18:20:07.51
    Execute step AddPrivileges of component |MSCS_A|windows|ind|ind|ind|0|0|FirstSteps|windows|ind|ind|ind|0|0
    INFO 2009-12-19 18:20:07.078
    Successfully added privileges 'SeTcbPrivilege SeAssignPrimaryTokenPrivilege SeIncreaseQuotaPrivilege' to account 'JYOTISAP\Administrator' on host '.'.
    INFO 2009-12-19 18:20:07.87
    Execute step sExtractClusterDLLs of component |MSCS_A|windows|ind|ind|ind|0|0|PrepareSAPClusterResource|windows|ind|ind|ind|1|0
    INFO 2009-12-19 18:20:07.105
    Creating file C:\Program Files\sapinst_instdir\ERP\SYSTEM\MSS\HA\ABAP\MSCS-A\NTCLUST.log.
    INFO 2009-12-19 18:20:07.108
    Output of C:\Users\ADMINI~1.JYO\AppData\Local\Temp\2\sapinst_exe.840.1261226937\SAPCAR.exe is written to the logfile NTCLUST.log.
    INFO 2009-12-19 18:20:07.297
    Output of C:\Users\ADMINI~1.JYO\AppData\Local\Temp\2\sapinst_exe.840.1261226937\SAPCAR.exe -x -v -g -i -f F:/DUMP/Inst-Master\IM_WINDOWS_X86_64\NTCLUST.SAR,:
    SAPCAR: processing archive F:/DUMP/Inst-Master/IM_WINDOWS_X86_64/NTCLUST.SAR (version 2.01)
    x NTCLUSTER/SapClus.dll
    x NTCLUSTER/Saprc.dll
    x NTCLUSTER/Saprcex.dll
    x NTCLUSTER/coclgrp.exe
    x NTCLUSTER/crclgrp.exe
    x EXE/disablewp.exe
    x NTCLUSTER/disaprct.exe
    x EXE/enablewp.exe
    x NTCLUSTER/insaprct.exe
    x NTCLUSTER/rfcoscol.exe
    x NTCLUSTER/takeresoff.exe
    x NTCLUSTER/takereson.exe
    SAPCAR: 12 file(s) extracted
    INFO 2009-12-19 18:20:07.310
    Execute step sCopySAPClusterDLLs of component |MSCS_A|windows|ind|ind|ind|0|0|PrepareSAPClusterResource|windows|ind|ind|ind|1|0
    INFO 2009-12-19 18:20:07.617
    Execute step sRegisterSAPClusterDLL of component |MSCS_A|windows|ind|ind|ind|0|0|PrepareSAPClusterResource|windows|ind|ind|ind|1|0
    INFO 2009-12-19 18:20:07.629
    Creating file C:\Program Files\sapinst_instdir\ERP\SYSTEM\MSS\HA\ABAP\MSCS-A\insaprct.log.
    INFO 2009-12-19 18:20:07.633
    Output of insaprct.exe is written to the logfile insaprct.log.
    INFO 2009-12-19 18:20:07.950
    Execution of the command "insaprct.exe" finished with return code 0. Output:
      SAP Resource
    Resourcetype "SAP Resource" successfully installed
    INFO 2009-12-19 18:20:07.964
    Execute step dScanForDrives of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:20:08.34
    Execute step AskForInstanceType of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:20:15.341
    Execute step dInvokeInstanceInformationClusterA of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.263
    Creating file C:\Program Files\sapinst_instdir\ERP\SYSTEM\MSS\HA\ABAP\MSCS-A\cluster.exe.log.
    INFO 2009-12-19 18:21:46.268
    Output of cluster.exe RESOURCE "SAP JRP 00 Service" is written to the logfile cluster.exe.log.
    WARNING 2009-12-19 18:21:46.302
    Execution of the command "cluster.exe RESOURCE "SAP JRP 00 Service"" finished with return code 5007. Output:
    Listing status for resource 'SAP JRP 00 Service':
    Resource             Group                Node            Status
    System error 5007 has occurred (0x0000138f).
    The cluster resource could not be found.
    INFO 2009-12-19 18:21:46.369
    Creating file C:\Program Files\sapinst_instdir\ERP\SYSTEM\MSS\HA\ABAP\MSCS-A\msg_server.exe.log.
    INFO 2009-12-19 18:21:46.378
    Working directory changed to C:\Program Files\sapinst_instdir\ERP\SYSTEM\MSS\HA\ABAP\MSCS-A.
    INFO 2009-12-19 18:21:46.381
    Output of L:\usr\sap\JRP\ASCS00\exe\msg_server.exe -v is written to the logfile msg_server.exe.log.
    INFO 2009-12-19 18:21:46.417
    Execution of the command "L:\usr\sap\JRP\ASCS00\exe\msg_server.exe -v" finished with return code 0. Output:
    msgserver information
    kernel release                700
    kernel make variant           700_REL
    DBMS client library          
    compiled on                   NT 5.2 3790 Service Pack 1 x86 MS VC++ 14.00
    compiled for                  64 BIT
    compilation mode              UNICODE
    compile time                  Jan 23 2008 20:12:02
    update level                  0
    patch number                  137
    source id                     0.144
    supported environment
    database (SAP, table SVERS)   700
    operating system
    Windows NT 5.0
    Windows NT 5.1
    Windows NT 5.2
    Windows NT 6.0
    msgserver patch information
    ( 0.001) MS: enable server shutdown (note 821875)
    ( 0.001) MS: dont bind external port for SCS instance (note 821875)
    ( 0.002) MS: new pseudo parameter rdisp/msserv_no (note 834052)
    ( 0.007) CST patch collection 21 2005 (note 845887)
    ( 0.011) CST patch collection 24 2005 (note 851195)
    ( 0.014) CST Patch Collection 28 2005 (note 860319)
    ( 0.018) CST Patch Collection 31 2005 (note 867690)
    ( 0.023) CST Patch Collection 36 2005 (note 874665)
    ( 0.023) CST Patch Collection 37 2005 (note 877058)
    ( 0.023) VMC Patch Collection 6 (note 865932)
    ( 0.026) CST Patch Collection 39 2005 (note 884266)
    ( 0.033) CST Patch Collection 45 2005 (note 895230)
    ( 0.034) J2EE engine can't reconnect (note 895230)
    ( 0.036) CST Patch Collection 49 2005 (note 904777)
    ( 0.046) CST Patch Collection 06 2006 (note 921223)
    ( 0.049) CST Patch Collection 09 2006 (note 928898)
    ( 0.050) Avoid deadlock in exception handler, when writing the stacktrace (note 907123)
    ( 0.053) CST Patch Collection 14 2006 (note 937223)
    ( 0.057) CST Patch Collection 17 2006 (note 944284)
    ( 0.060) CST Patch Collection 22 2006 (note 950845)
    ( 0.065) P4HTTP added as logon type (note 958374)
    ( 0.065) CST Patch Collection 26 2006 (note 957514)
    ( 0.069) CST Patch Collection 29 2006 (note 962917)
    ( 0.073) CST Patch Collection 33 2006 (note 970657)
    ( 0.079) CST Patch Collection 39 2006 (note 981959)
    ( 0.083) CST Patch Collection 42 2006 (note 991211)
    ( 0.087) CST Patch Collection 47 2006 (note 999284)
    ( 0.094) CST Patch Collection 03 2007 (note 1017050)
    ( 0.096) Fix for HTTP Redirect with unusual Query String in URL (note 1021425)
    ( 0.098) CST Patch Collection 08 2007 (note 1027100)
    ( 0.105) CST Patch Collection 13 2007 (note 1039566)
    ( 0.110) CST Patch Collection 19 2007 (note 1051296)
    ( 0.110) CST Patch Collection 19 2007 (note 1051296)
    ( 0.116) CST Patch Collection 26 2007 (note 1067668)
    ( 0.118) ICM: AGS logging enhancements (filter, HTTP header) (note 851852)
    ( 0.121) CST Patch Collection 29 2007 (note 1076241)
    ( 0.128) NI: TCP connect fails with EINVAL on AIX (note 1087831)
    ( 0.133) CST Patch Collection 42 2007 (note 1104914)
    ( 0.133) CST Patch Collection 42 2007 (note 1104914)
    ( 0.137) CST Patch Collection 47 2007 (note 1115331)
    ( 0.137) Higher values for parameter gw/max_sockets than 2048 (note 1117484)
    ( 0.137) Values > 2048 don't work for max_sockets in msg_server (note 1117484)
    ( 0.137) Correction on 2048 sockets in msg_server (note 1117484)
    INFO 2009-12-19 18:21:46.468
    Execute step dInvokeAddInInstanceInformationClusterA of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.482
    Execute step dInvokeInstanceInformationClusterB of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.495
    Execute step dInvokeAddInInstanceInformationClusterB of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.507
    Execute step sSetGlobalParameters of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.519
    Execute step dLookForLinkD of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.531
    Execute step dAskForLimkD of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:21:46.543
    Execute step dAskForKernelDVD of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:22:00.370
    Execute step dAskForSecondKernelDVD of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:22:00.382
    Execute step dAskForuserDomain of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:22:01.923
    Execute step dBuildAccountInformation of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:22:01.937
    Execute step dAskForUserPAsswords of component |MSCS_A|windows|ind|ind|ind|0|0|UserDialogs|windows|ind|ind|ind|2|0
    INFO 2009-12-19 18:22:14.245
    Execute step dCollectMSCSNodesInformations of component |MSCS_A|windows|ind|ind|ind|0|0|CollectClusterParameters|windows|ind|ind|ind|3|0
    INFO 2009-12-19 18:22:14.266
    Execute step dGetSAPClusterParameters of component |MSCS_A|windows|ind|ind|ind|0|0|CollectClusterParameters|windows|ind|ind|ind|3|0
    INFO 2009-12-19 18:22:14.333
    Creating file C:\Program Files\sapinst_instdir\ERP\SYSTEM\MSS\HA\ABAP\MSCS-A\summary.html.
    INFO 2009-12-19 18:22:20.888
    Execute step dCheckAndCreateLocalGroups of component |MSCS_A|windows|ind|ind|ind|0|0|CreateLocalGroupsAndAddUsers|windows|ind|ind|ind|4|0
    INFO 2009-12-19 18:22:41.193
    Execute step dAddUsersToLocalGroups of component |MSCS_A|windows|ind|ind|ind|0|0|CreateLocalGroupsAndAddUsers|windows|ind|ind|ind|4|0
    INFO 2009-12-19 18:24:09.102
    Execute step dCreateSAPClusterFolder of component |MSCS_A|windows|ind|ind|ind|0|0|PrepareFileSystem|windows|ind|ind|ind|5|0
    INFO 2009-12-19 18:24:09.146
    Execute step dCopyFiles of component |MSCS_A|windows|ind|ind|ind|0|0|PrepareFileSystem|windows|ind|ind|ind|5|0
    INFO 2009-12-19 18:24:09.266
    Execute step dDeleteSAPLOC of component |MSCS_A|windows|ind|ind|ind|0|0|PrepareFileSystem|windows|ind|ind|ind|5|0
    ERROR 2009-12-19 18:24:09.339
    FSL-00001  System call failed. Error 2310 (This shared resource does not exist.
    ) in execution of system call 'SyWinGetSecurityDescriptor' with parameter (saploc), line (836) in file (synxc_security_desc.cpp).
    ERROR 2009-12-19 18:24:09.339
    FSL-02002  Unable to determine list of access rights ACL of saploc. This shared resource does not exist.
    ERROR 2009-12-19 18:24:09.340
    MUT-03025  Caught ESyException in Modulecall: ESAPinstException: error text undefined.
    ERROR 2009-12-19 18:24:09.343
    FCO-00011  The step dDeleteSAPLOC with step key |MSCS_A|windows|ind|ind|ind|0|0|PrepareFileSystem|windows|ind|ind|ind|5|0|dDeleteSAPLOC was executed with status ERROR ( Last error reported by the step :Caught ESyException in Modulecall: ESAPinstException: error text undefined.).
    Thanks in advance.
    Regards,
    Narendra

    Hi Everyone,
    While installing ASCS,  Run the below mentioned command:
    sapinst.exe SAPINST_USE_HOSTNAME=<Virtual Host Name> as it was mentioned in the Installation guide. This command is valid for ASCS Step only.
    Call the sapinst.exe with out any command line arguments for rest of the steps.
    Hope this will reslove your issue.
    Warm Regards,
    Narendranath

  • How to create JTree without root node

    Hello;
    I like to create a JTree without root node?
    Any help?
    Thanks!
    --tony                                                                                                                                                                                   

    javadocs JTree,
    setRootVisible
    public void setRootVisible(boolean rootVisible)
    Determines whether or not the root node from the TreeModel is visible.
    Parameters:
    rootVisible - true if the root node of the tree is to be displayedSee Also:
    rootVisible

  • How to make subtotal when first displaying ALV report

    Hi friends,
    I develop a report need to subtotalize some column, for example Goods Receipt Qty and DN quantity by Purchase order or PO line item. My parts of ABAP coding are below:
    ******fieldcat coding
    CLEAR fieldcat_in.
    fieldcat_ln-fieldname = 'EBELN'.
    fieldcat_ln-tabname = 'I_OUTPUT'.
    fieldcat_ln-key = 'X'.
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-seltext_l = 'Purchase Order'.
    APPEND fieldcat_ln TO gt_fieldcat.
    CLEAR fieldcat_in.
    fieldcat_ln-fieldname = 'EBELP'.
    fieldcat_ln-key = ''.
    fieldcat_ln-tabname = 'I_OUTPUT'.
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-seltext_l = 'PO item'.
    APPEND fieldcat_ln TO gt_fieldcat.
    CLEAR fieldcat_in.
    fieldcat_ln-fieldname = 'GR_QTY'.
    fieldcat_ln-tabname = 'I_OUTPUT'.
    fieldcat_ln-key = ' '.
    fieldcat_ln-no_out = ' '.
    fieldcat_in-do_sum = 'X'.
    fieldcat_ln-seltext_l = 'GR Quantity'.
    APPEND fieldcat_ln TO gt_fieldcat.
    CLEAR fieldcat_in.
    fieldcat_ln-fieldname = 'DNQTY'.
    fieldcat_ln-tabname = 'I_OUTPUT'.
    fieldcat_ln-key = ' '.
    fieldcat_ln-no_out = ' '.
    fieldcat_ln-seltext_l = 'DN Qty'.
    fieldcat_in-do_sum = 'X'.
    APPEND fieldcat_ln TO gt_fieldcat.
    *****sorting coding
    data spos type i.
    spos = spos + 1.
    CLEAR gs_sort.
    gs_sort-fieldname = 'EBELN'.
    gs_sort-tabname = 'I_OUTPUT'.
    gs_sort-spos = spos.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'.
    gs_sort-expa = 'X'.
    APPEND gs_sort TO gt_sort.
    spos = spos + 1.
    CLEAR gs_sort.
    gs_sort-fieldname = 'EBELP'.
    gs_sort-tabname = 'I_OUTPUT'.
    gs_sort-spos = spos.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'.
    gs_sort-expa = 'X'.
    APPEND gs_sort TO gt_sort.
    But it does not work. I chekc my report and fuond that the Subtotal button is not existed in application toolbar when first displaying it. I do the subtotal manually and it can subtotalize my desired column. Any have suggestion/solution on this case. Thanks very much in advance.

    hi,
    pls chk this.
    In order to do the sub-total the main total has to be calculated and then the sub-total process can be performed.
    In the main fieldcat mark this field
    wa_line_fieldcat-fieldname = 'VALUE'.
    wa_line_fieldcat-tabname = 'I_OUTPUT'.
    wa_line_fieldcat-reptext = text-021.
    wa_line_fieldcat-do_sum = 'X'.
    APPEND wa_line_fieldcat TO i_fieldcat.
    this will do the main total part.
    Sub-total:
    you will have to create an internal table sort
    CLEAR struct_sort.
    struct_sort-spos = 1.
    struct_sort-fieldname = 'VALUE'.
    struct_sort-up = 'X'.
    struct_sort-subtot = 'X'.
    APPEND struct_sort TO i_sort.
    Now pass these two internal tables to the display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    IT_SORT = i_sort
    TABLES
    t_outtab = I_OUTPUT
    Hope this solves ur issue.
    Reward if helpful.
    Regards,
    anver

  • Install Java Add-In for existing ABAP == 'First MSCS Node' step fails

    I am in the process of installing the Java Add-In for an existing ABAP System.
    I am doing the High-Availability Installation Services.
    There are seven (7) steps:
    1. Central Services Instance (CSC) Java Add-In
    2. First MSCS Node
    3. Database Instance Java Add-In
    4. Additional MSCS Node
    5. Enqueue Replication Server
    6. Central Instance Java Add-In
    7. Dialog Instance
    Step #1 was completed successfully.
    Step #2 (First MSCS Node) keeps failing with the following warnings/error:
    <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
    WARNING 2011-11-02 07:38:04.928
    Execution of the command "cluster.exe RESOURCE "SAP BWP 00 Service"" finished with return code 5007. Output:
    Listing status for resource 'SAP BWP 00 Service':
    Resource             Group                Node            Status
    System error 5007 has occurred (0x0000138f).
    The cluster resource could not be found.
    <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
    WARNING 2011-11-02 07:40:29.085
    Execution of the command "M:\usr\sap\BWP\ASCS00\exe\sapstartsrv.exe -u -q -s BWP -n 00" finished with return code 128. Output:
    <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
    ERROR 2011-11-02 07:40:29.210
    FCO-00011  The step dCreateSecondNewSCSServiceWithVirtualHostName with step key |MSCS_A|windows|ind|ind|ind|0|0|SAPServices|windows|ind|ind|ind|9|0|dCreateSecondNewSCSServiceWithVirtualHostName was executed with status ERROR .

    This seems to be an issue with the clustering solution. Please, refer to the following article link:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;281796
    See if that helps
    Edited by: David Fitzgibbon on Nov 2, 2011 2:18 PM

  • Xpath: get attributes from first child node

    Hi,
    I have some problems by getting the attributes from the first child node, if i try to get child elements everything works fine, but whenever i need the elementvalue from a node with attributes i doesn't return anything.
    The xpath expression works fine if i want to get the element value from all childs, but not when i just want from one of them.
    This one works,
    XPathFactory factory1 = XPathFactory.newInstance();
        XPath xpath = factory1.newXPath();
        xpath.setNamespaceContext(new PersonalNamespaceContext());
        XPathExpression expr
         = xpath.compile("//default:DeviceExchange[1]/default:Status/text()");
       // gets the value of the node picked out
        Object result = expr.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes = (NodeList) result;
        for (int i = 0; i < nodes.getLength(); i++) {
          names[i] = nodes.item(i).getNodeValue();
          String a = names;
    // checks if status is exchanged, if it is sets status to 1
    if (a.length() == 9){
    names[i] = "1"; }
    else{  names[i] = "0";}
    System.out.println(names[i]);This doesn'tXPathFactory factory2 = XPathFactory.newInstance();
    XPath xpath2 = factory2.newXPath();
    xpath2.setNamespaceContext(new PersonalNamespaceContext());
    XPathExpression expr2 = xpath2.compile("//default:DeviceExchange[1]/default:Field[@names='MLPKTID']/text()");
    Object result2 = expr2.evaluate(doc, XPathConstants.NODESET);
    NodeList nodes2 = (NodeList) result2;
    for (int i = 0; i < nodes2.getLength(); i++) {
    names2[i] = nodes2.item(i).getNodeValue();
    System.out.println(names2[i]);}Does anyone have any ideas? I will apreciate all help!
    Edited by: fusen on Oct 25, 2007 1:12 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Sorry, solved myself. Just � typo that that i couldn't detect.

  • Querying for first child node's value of a certain tag

    Hi,
    I am using the java parser 2 from Oracle. Given a XML document
    containing the following
    <course>
    <Name>Calculus</Name>
    <Dept>Math</Dept>
    <Instructor>
    <Name>Jim Green</Name>
    </Instructor>
    <Student>
    <Name>Jack</Name>
    <Name>Mary</Name>
    <Name>Paul</Name>
    </Student>
    </course>
    I want to efficiently obtain the value of first child node of
    <course> whose tag is <Name>.
    I could not find any mtd that can do that efficiently. The
    nearest match is the mtd getElementsByTag("Name") which
    traverses the entire tree under <course>.
    Any help appreciated !
    Thanks in advance
    Mak
    null

    Mak (guest) wrote:
    : Hi,
    : I am using the java parser 2 from Oracle. Given a XML document
    : containing the following
    : <course>
    : <Name>Calculus</Name>
    : <Dept>Math</Dept>
    : <Instructor>
    : <Name>Jim Green</Name>
    : </Instructor>
    : <Student>
    : <Name>Jack</Name>
    : <Name>Mary</Name>
    : <Name>Paul</Name>
    : </Student>
    : </course>
    : I want to efficiently obtain the value of first child node of
    : <course> whose tag is <Name>.
    : I could not find any mtd that can do that efficiently. The
    : nearest match is the mtd getElementsByTag("Name") which
    : traverses the entire tree under <course>.
    : Any help appreciated !
    : Thanks in advance
    : Mak
    Your best bet, if you do not need the entire tree, is to use the
    SAX interface to return the desired data. Since it is event
    driven it does not have to parser the while document.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Change field catlog after the first display

    Hello,
    I am trying to change field catlog after the first display.
    Problem I am facing is at runtime fild catlog is not changing. Could some one suggest where I might have gone wrong.
    Thanks in advance.
    Regards,
    Vimal.
    IF sy-ucomm = 'CATLOG'.
        CALL METHOD g_alv_grid->get_frontend_fieldcatalog
          IMPORTING
            et_fieldcatalog = it_fieldcat[].
        LOOP AT it_fieldcat INTO str_fcat .
          IF str_fcat-fieldname = 'EBELP' .
            str_fcat-hotspot = 'X' .
            MODIFY it_fieldcat FROM str_fcat .
          ENDIF .
        ENDLOOP .
        CALL METHOD g_alv_grid->set_frontend_fieldcatalog
          EXPORTING
            it_fieldcatalog = it_fieldcat[].
      ENDIF.

    In that You change the Field catalog and
    call this method..
      CALL METHOD G_GRID->REFRESH_TABLE_DISPLAY
        EXCEPTIONS
          FINISHED = 1
          OTHERS   = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    try this...

  • Select ALV row right after first display

    Hi,
    I want to pre-select specific rows in my ALV already when it`s first displayed. I tried to use method set_selected_rows in the PBO where the ALV object is created, but it did not work. It only worked when I put the method in the PAI.
    Can I select rows of the ALV when it is initially displayed, that is before it`s screen`s PAI is called?
    Thanks.
    Krisz

    Hi
    Its possible to have the rows pre-selected using buttons.
    In PBO, after calling method-set_table_for_first_display
         CALL METHOD cl_grid->get_selected_rows
           IMPORTING
             et_index_rows = tb_row_id[]
    Loop on the internal table whose records are displayed in ALV,
    and set the parameter index in TB_ROW_ID as SY_TABIX.
    endloop.
         CALL METHOD cl_grid->set_selected_rows
           EXPORTING
             it_index_rows = tb_row_id.
    I have tested it and works.
    Please let me know whether it works or not
    BR
    Lavanya

  • Hiding customer container in first display

    Hello all,
    How to hide custom container during first display of screen. Loop at screen at PBO does not work as screen name field does not capture container name.
    Regards,
    DPM

    Hi,
        It is not possible to hide the custom container in dynpro , if you can brief your requirement will try to help
        you out.
        Instead of hiding you can use an empty subscreen and navigate to it before displaying actual screen with
        the custom container.

  • JTree, where every node has a checkbox.

    I need a JTree, where every node has a checkbox. Each checkbox will be selected if all childnodes are selected, deselected if all childnodes are deselected, and semi-selected if some childnodes are selected and some are not.
    I've seen this in some applications. It would really surprise me if no-one has done this yet, but I've googled without results.
    If you have some links or samples that can help me and send them I'll appreciate it very much.
    Thank you

    Hello,
    I guess you want those JCheckBoxes to act as editors (not just renderers of their model node's state).
    What is supposed to happen when I click on a half selected parent node? Will it select all sub nodes? How do you want to represent half selection?

  • Installing First cluster node cluster service offline

    Hi ,
    While i'm trying to install the first cluster node on Node1 cluster disk shows online but the cluster service shows offline .
    as shown below in the screenshot .
    I have  run the prerequisite checker on both the nodes but  it was successful kindly give your input to resolve this issue 

    you are performing this actions as a domain administrator?
    If not repeat the stuff you want to perform as domain administrator.
    kind regards
    Peter

Maybe you are looking for