Lucene Bottom N type report

I have a requirement to write a report which shows the least occurances
of some events. I have found example of Top N type reports, but is it
possible to reverse the order to get Bottom N report in lucene?
For Top N we have following:
GROUP BY $P{EventTag} TOP $P{TopN}, sev TOP 6
Changing TOP to BOTTOM in this query doesn't work. Also, I can change
TOP to WHATEVER and it still does not complain about syntax.
Could you help?
Adam
admroz
admroz's Profile: https://forums.netiq.com/member.php?userid=3440
View this thread: https://forums.netiq.com/showthread.php?t=46307

Hi Adam,
you could try to use a PrintWhen expression based on the build-in
REPORT_COUNT variable:
http://jasperreports.sourceforge.net...engine/JRVaria
ble.html#REPORT_COUNT
Norbert
>>> On 12.12.2012 at 14:14, admroz<[email protected]> wrote:
> Norbert,
>
> Thanks for your reply. We are trying to go a way you described, but we
> still have some problems ‑ let me explain.
>
> The Top 10 Report (which is our base for Bottom 10 Report) uses
> following lucene query:
> SELECT
> $P{EventTag} AS event_tag_value,
> sev AS severity
> WHERE
> sev:[$P{MinSevStr} TO $P{MaxSevStr}] AND notnull:$P{EventTag}
> $P{VendorProduct_Query} $P{SEARCH_QUERY_USE}
> GROUP BY $P{EventTag} TOP $P{TopN},sev TOP 6
> OVER $P{FromDtQry}, $P{ToDtQry}
> $P{MaximumResultsStr}
>
> and there is also:
> <field name="count" class="java.lang.Integer"/>
>
> Now, I don't know how the magic "TOP" clause is implemented, but I
> assume that it does its job. Important thing is that there is grouping
> on both on EventTag (eg. sip) and severity. Which means that "count"
> columns contain amout of occurances of sip/sev pairs rather than sum of
> sip occurances with any sev.
>
> So the first question is ‑ is the Top 10 Report working correctly? Does
> it take biggest values in regards of sums for sip with any sev?
>
> As you advised, to have Bottom 10 we've removed TOP clause for EventTag
> from lucene query. We also have to add sorting on count:
> <sortField name="count" order="Ascending"/>
>
> and filter to limit results on a chart:
> <filterExpression><![CDATA[new Boolean($V{SumOfCNT}.intValue() <=
> Integer.parseInt($P{TopN}))]]></filterExpression>
>
> With an assumption that $P{TopN} is 10 then it should show 5 bars on a
> chart. However, let's consider following data:
>
> sip | sev | count
> 10.0.0.1 | 1 | 1
> 10.0.0.1 | 2 | 1
> 10.0.0.1 | 3 | 1
> 10.0.0.2 | 1 | 2
> 10.0.0.3 | 1 | 2
> 10.0.0.4 | 1 | 2
> 10.0.0.5 | 1 | 2
> 10.0.0.6 | 1 | 2
> 10.0.0.7 | 1 | 2
>
> Because data is ordered by "count" then it takes three times 10.0.0.1
> and puts it on a first bar with a value of 3 (which is a sum for each
> severity). It also increases counter by 3, so it shows only two more
> bars on a chart for 10.0.0.2 and 10.0.0.3. Of cours the value for
> 10.0.0.1 should not appear at all, because its sum is bigger than values
> for other IPs.
>
> The only solution which we have for now is removing "sev" from group by
> clause, but that way we are loosing some functionality of original Top
> 10 Report.
>
> Is it possible to solve it in any other way? Even if it was normal sql
> query I would doubt if it was possible to be done with one query only.
>
> Thanks
> Adam

Similar Messages

  • BI Publisher report ends with Warning Message for Pivot  type reports..

    Hi,
    I had used BI reporting(xml publisher) to develop our all reports and registered in R12 and works fine for all the tabular/forms type reports but it fails with the warning message(colored in yellow) for Pivot type reports. The output comes in xml..
    When I changed the pivot table type report to tabular it comes with pdf. No issues.I do not know how to solve this issue...
    Please help me on this..
    Thanks
    Imran

    Welcome to the forums !
    Pl post details of OS, database and EBS versions, along with the complete error message.
    HTH
    Srini

  • User Signature at the bottom of BI Report

    Hi All,
    Is it possible to provide <User Signature / Name> space / section at the bottom of BI report output (both Web & Analyzer)?
    Best Regards,
    Jatin Gusain

    Hello Jatin Gusain
    At the Web Aplication Design you can insert a text item and at this item you can insert the name of the author of the report manually or by a General Text Element.
    To arrange it you will need to use a conainer layout.
    Thanks,
    Diego Ferrary

  • Creation of customized Wage Type Reporter

    Hi,
    My client were using the Standard Wage Type reporter i.e.PC00_M11_WTK. Now beacuse of security of not viewing the amounts of the employees , Client has taken away the authorization from the users the standard Tcode.
    They want me to preapare the report for wage type -196E,9IPI,9IPC,9IP3,9IP5,9IP6,9IP7,9IP8,/3F1,/3F2,/3F3 AND /3F4. They dnot want the standard report. They want to customized a new report with above mention wage types?
    I have already defined the FS to my ABAP HR,
    I required your help to know the table from where the amount of the above wage type will pick up?
    Please help.
    Regards
    Sanjib

    Payroll results are kept in cluster. You have to access and read the cluster.
    But instead of creating a report with abap I can suggest you trying this solution.
    Create a payroll infotype by using system standart for the wage types to be reported.
    Assign authorization for this infotype to only related employee
    Put payroll infotype in info group.
    After that employee can have the report by using ad-hoc query.
    About payroll clusters this link will help you:
    http://wiki.sdn.sap.com/wiki/display/ERPHCM/HRPayrollClusters
    Regards;
    Okan
    Edited by: Okan Caliskan on Sep 16, 2011 12:07 PM

  • How to call a Include type Report Program in Executable Program. ?

    Hi experts,
    I have created a Include type report program and I want to run this include program in other report program. Which abap statement should i use ?
    Thanks
    Saurabh

    Hi Saurabh,
    We can make use of programs of Type - Include(I) in other type of ABAP Programs.
    These Include programs cannot be executed directly but can be used as a part of the main program i.e Executable program - Type E.
    So after creating your main program of type executable program then use the below line
    REPORT ZM_SAMPLE_PROGRAM.
    INCLUDE INC_PRG_NAME.
    Now the code as availablein INC_PRG_NAME becomes part of the  main program ZM_SAMPLE_PROGRAM.le
    Also you can make use of this Include program in other executable/include programs too...
    Regards,
    Rafi

  • How do I display a MS RDL type Report within a Coldfusion Application

    I have a Coldfusion application that exist already, but would like to display a MS Report Builder Report within the application.  How can I display the RDL type report within Coldfusion?

    Are you talking about an SSRS report?  I looked into that a while back, looked to be a real pain because the report viewer web app is built to be part of an ASP page.  I would just write the ASP.NET page to handle the report, and maybe put it inside of an I-FRAME on the CF page.  You're probably going to have a mess on your hands for managing the access security to the reports.
    Would be a nice idea for CF11, if the CF guys wanted to add a really useful piece of Microsoft integration that act as a nice replacement for the never-loved CFREPORT facility.  Works really nice in ASP.NET.
    -reed

  • SSRS Header Image extension for Cross Tab type Reports to full page width

    Hi All,
    I'm trying  to adjust  a Image  on Header ,the problem I'm facing is the image doesnt extend with the page full width  when there is cross tab type reports.
    Many thanks

    Solved
    There  is a property for background repeat setting  when set to Repaet X has worked for me

  • Tree type report

    Hi all,
           Can anyone give sample code for TREE TYPE REPORT(simple code), like for example: The list should contain 2 main items (parent item) and when i expand each item i should have 1 item(child item) .and when i double click on that it should perform some action say it should go to new list.
    like :
    + food
    + tools
    (this is in first list , 2 main items) when i expand this
    - food
           noodles
    - tools
           hammer
    (this sub item , when i click on this it should go to new list)
    thanks in advance.
    kumaran.c

    HI Kumaran,
    Have a look at the following code of simple tree control ...Its in module pool style.. will copy each include as well..
    *& Module Pool       ZKM_SIMPLETREE_CONTROL
    REPORT  ZKM_SIMPLETREE_CONTROL.
    INCLUDE ZKM_TOP.
    INCLUDE ZKM_CL.
    INCLUDE ZKM_PBO_100O01.
    INCLUDE ZKM_FORM01.
    INCLUDE ZKM_PAI_100I01.
    START-OF-SELECTION.
    create the application object
    this object is needed to handle the ABAP Objects Events of
    Controls
    CREATE OBJECT G_APPLICATION.
    SET SCREEN 1000.
    *&  Include           ZKM_TOP
    *REPORT ZKM_SIMPLETREE_CONTROL MESSAGE-ID TREE_CONTROL_MSG.
    CLASS lcl_application  DEFINITION DEFERRED.
    CLASS cl_gui_cfw DEFINITION LOAD.
    TYPES: node_table_type LIKE STANDARD TABLE OF zkm_treesnode
               WITH DEFAULT KEY.
    CAUTION: MTREESNODE is the name of the node structure which must
    be defined by the programmer. DO NOT USE MTREESNODE!
    *internal table and work area for storing all the nodes that are created
    DATA: gt_nodetable TYPE node_table_type,
          gw_nodetable TYPE zkm_treesnode.
    *objects refering to the classes used.
    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_simple_tree.
    Fields on Dynpro 1000
    DATA: g_event(30),
          g_key TYPE i,
          g_node_key TYPE tv_nodekey.
    Fields on Dynpro 2000
    DATA: g_relatship TYPE i,
          g_cb_sub,
          g_cb_same,
          g_cb_under VALUE 'X',
          g_nodename(30).
    Structure for preserving the skeleton
    TYPES: BEGIN OF ty_flag,
           relatkey TYPE tv_nodekey,
           node_key TYPE tv_nodekey,
           flag TYPE i,                "1  =  skeleton
                                       "2  =  service line
                                       "3  =  levels
           END OF ty_flag.
    DATA: gt_flag TYPE TABLE OF ty_flag,
          gw_flag TYPE ty_flag.
    *structure storing the hierarchy and the nodes under them.
    ***INCLUDE ZKM_PBO_100O01 .
    *&      Module  PBO_1000  OUTPUT
          text
    MODULE pbo_1000 OUTPUT.
      SET PF-STATUS 'ZMAIN'.
      SET TITLEBAR 'ZTITLE'.
      IF g_tree IS INITIAL.
        " The Tree Control has not been created yet.
        " Create a Tree Control and insert nodes into it.
        PERFORM create_and_init_tree.
      ENDIF.
    *registering keys which can trigger the event
      PERFORM register_key_strokes.
    *checking status of the actions performed
      CASE sy-ucomm.
        WHEN 'ADD'.               "node successfully added
          MESSAGE s002(zkm_class).
        WHEN 'YES'.               "node successfully deleted
          MESSAGE s003(zkm_class).
        WHEN 'NO' OR 'CANCEL'.    "action cancelled
          MESSAGE s007(zkm_class).
      ENDCASE.
    ENDMODULE.                 " PBO_1000  OUTPUT
    *&      Module  PBO_2000  OUTPUT
          text
    MODULE pbo_2000 OUTPUT.
      SET PF-STATUS 'ZDIALOG'.
      SET TITLEBAR  'ZADD'.
    *setting the attributes of the screen field depending on node attributes
      READ TABLE gt_flag INTO gw_flag WITH KEY node_key = g_node_key.
      IF gw_flag-flag = 3.
        LOOP AT SCREEN.
          IF screen-name      = 'BRANCH'.
            screen-invisible = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDMODULE.                 " PBO_2000  OUTPUT
    *&      Module  PBO_3000  OUTPUT
          text
    MODULE pbo_3000 OUTPUT.
      SET PF-STATUS 'ZDIALOG'.
      SET TITLEBAR  'ZCONFIRM'.
    ENDMODULE.                 " PBO_3000  OUTPUT
    ***INCLUDE ZKM_PAI_100I01 .
    *&      Module  PAI_1000  INPUT
          text
    MODULE pai_1000 INPUT.
      DATA: return_code TYPE i.
    CL_GUI_CFW=>DISPATCH must be called if events are registered
    that trigger PAI
    this method calls the event handler method of an event
      CALL METHOD cl_gui_cfw=>dispatch
        IMPORTING
          return_code = return_code.
      IF return_code <> cl_gui_cfw=>rc_noevent.
        "a control event occured => exit PAI.
        EXIT.
      ENDIF.
      CASE sy-ucomm.
        WHEN 'ADDND'.
    *check whether node has been selected or not
          IF g_event NE 'NODE_DOUBLE_CLICK'. "AND g_node_key EQ ' '.
            MESSAGE e000(zkm_class).
          ELSE.
    *whether selected node can have sub-branches or not
            READ TABLE gt_nodetable INTO gw_nodetable WITH KEY node_key = g_node_key.
            IF gw_nodetable-isfolder = ' '.
              MESSAGE e006(zkm_class).
            ELSE.
    *call screen for adding the node.
              CALL SCREEN 2000 STARTING AT 20 10.
            ENDIF.
          ENDIF.
          CLEAR g_event.
        WHEN 'DELND'.
    *check whether node has been selected or not
          IF g_event NE 'NODE_DOUBLE_CLICK'.
            MESSAGE e000(zkm_class).
          ELSE.
    *skeleton should not be deleted.
            IF g_node_key EQ 'Capgemini'   OR
               g_node_key EQ 'TSP-SAP-CRM' OR
               g_node_key EQ 'MANAGERS'    OR
               g_node_key EQ 'TEAM LEAD'.
              MESSAGE e004(zkm_class).
            ENDIF.
    *call screen for confirmation
            CALL SCREEN 3000 STARTING AT 20 10.
          ENDIF.
          CLEAR g_event.
        WHEN 'TEST'.
          CALL METHOD g_tree->expand_node
            EXPORTING
              node_key = 'New1'.
        WHEN 'BACK'. " Finish program
          IF NOT g_custom_container IS INITIAL.
    destroy tree container (detroys contained tree control, too)
            CALL METHOD g_custom_container->free
              EXCEPTIONS
                cntl_system_error = 1
                cntl_error        = 2.
            IF sy-subrc <> 0.
             MESSAGE a000.
            ENDIF.
            CLEAR g_custom_container.
            CLEAR g_tree.
          ENDIF.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " PAI_1000  INPUT
    *&      Module  pai_2000  INPUT
          text
    MODULE pai_2000 INPUT.
      DATA: node_table TYPE node_table_type,
            node LIKE zkm_treesnode.
      CASE sy-ucomm.
        WHEN 'BACK'.
          CALL SCREEN 1000.
        WHEN 'ADD'.
          IF g_nodename IS INITIAL. "Has to enter the Node name
            MESSAGE s005(zkm_class).
            CALL SCREEN 2000 STARTING AT 20 10.
          ELSE.
    *Checking whether specified node already exists or not
            READ TABLE gt_nodetable INTO gw_nodetable WITH KEY node_key =  g_nodename.
            IF sy-subrc EQ 0.
              CLEAR gw_flag.
              MESSAGE s008(zkm_class).
              CALL SCREEN 2000 STARTING AT 20 10.
            ENDIF.
    *assigning attributes to the node
            CLEAR node.
            CLEAR node_table.
            node-node_key = g_nodename.            "Key of the Node.
            node-relatkey  = g_node_key.           "Relationship with the selected node
            node-relatship =  cl_gui_simple_tree=>relat_last_child.
    *checking whether the node would be a folder or a leaf
            READ TABLE gt_flag INTO gw_flag WITH KEY node_key = g_node_key.
            IF gw_flag-flag = 1 OR gw_flag-flag = 2.
              node-hidden    = ' '.
              node-disabled  = ' '.
              node-isfolder  = 'X'.
              CLEAR node-n_image.
              CLEAR node-exp_image.
              CLEAR node-expander.
              IF gw_flag-flag EQ 1.
                gw_flag-flag = 2.
              ELSE.
                gw_flag-flag = 3.
              ENDIF.
            ELSEIF gw_flag-flag = 3.
              node-n_image   = '@XY@'.
              node-isfolder  = ' '.
              node-expander  = ' '.
              gw_flag-flag = 3.
            ENDIF.
            CLEAR node-exp_image.
            node-text = g_nodename.
            APPEND node TO node_table.
    *keeping records of all the nodes added in the tree
            gw_nodetable = node.
            APPEND gw_nodetable TO gt_nodetable.
            CLEAR gw_nodetable.
    *append structure 'FLAG' to group the added node according to position
            gw_flag-relatkey = g_node_key.
            gw_flag-node_key = g_nodename.
            APPEND gw_flag TO gt_flag.
            CLEAR gw_flag.
    *adding nodes in the tree
            CALL METHOD g_tree->add_nodes
              EXPORTING
                table_structure_name           = 'ZKM_TREESNODE'
                node_table                     = node_table
              EXCEPTIONS
                error_in_node_table            = 1
                failed                         = 2
                dp_error                       = 3
                table_structure_name_not_found = 4
                OTHERS                         = 5.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            CLEAR g_nodename.    "clearing screen field
            CALL SCREEN 1000.
          ENDIF.
        WHEN 'CANCEL'.
          CALL SCREEN 1000.
      ENDCASE.
    ENDMODULE.                 " pai_2000  INPUT
    *&      Module  PAI_3000  INPUT
          text
    MODULE pai_3000 INPUT.
      CASE sy-ucomm.
        WHEN 'YES'.      "user agrees to delete the node
          CALL METHOD g_tree->delete_node
            EXPORTING
              node_key          = g_node_key
            EXCEPTIONS
              failed            = 1
              node_not_found    = 2
              cntl_system_error = 3
              OTHERS            = 4.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                       WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ELSE.
            gw_nodetable-node_key = g_node_key.
            gw_flag-node_key      = g_node_key.
            READ TABLE gt_nodetable INTO gw_nodetable WITH KEY node_key = g_node_key.
            IF sy-subrc EQ 0.
              DELETE gt_nodetable INDEX sy-tabix.
            ENDIF.
            READ TABLE gt_flag INTO gw_flag WITH KEY node_key = g_node_key.
            IF sy-subrc EQ 0.
              DELETE gt_flag INDEX sy-tabix.
            ENDIF.
            CLEAR gw_flag.
            CLEAR gw_nodetable.
            CALL SCREEN 1000.
          ENDIF.
        WHEN 'NO'.       "user clicks the cancel button
          CALL SCREEN 1000.
      ENDCASE.
    ENDMODULE.                 " PAI_3000  INPUT
    ***INCLUDE ZKM_FORM01 .
    *&      Form  create_and_init_tree
          text
    -->  p1        text
    <--  p2        text
    FORM create_and_init_tree .
      DATA: node_table TYPE node_table_type,
              events TYPE cntl_simple_events,
              event TYPE cntl_simple_event.
    *create a container for the tree control.
      CREATE OBJECT g_custom_container
        EXPORTING
           " the container is linked to the custom control with the
           " name 'TREE_CONTAINER' on the dynpro
          container_name              = 'TREE_CONTAINER'
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          lifetime_dynpro_dynpro_link = 5
          OTHERS                      = 6
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *create tree control.
      CREATE OBJECT g_tree
        EXPORTING
          parent                      = g_custom_container
          node_selection_mode         = cl_gui_simple_tree=>node_sel_mode_single
        EXCEPTIONS
          lifetime_error              = 1
          cntl_system_error           = 2
          create_error                = 3
          failed                      = 4
          illegal_node_selection_mode = 5
          OTHERS                      = 6
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *define events which will be passed to the backend.
      "node double click.
      event-eventid    = cl_gui_simple_tree=>eventid_node_double_click.
      event-appl_event = 'X'.  "process PAI if event occurs.
      APPEND event TO events.
      "expand no children.
      event-eventid    = cl_gui_simple_tree=>eventid_expand_no_children.
      event-appl_event = 'X'.
      APPEND event TO events.
      "node key press
      event-eventid    = cl_gui_simple_tree=>eventid_node_keypress.
      event-appl_event = 'X'.
      APPEND event TO events.
      "NODE_CONTEXT_MENU_REQUEST
      event-eventid    = cl_gui_simple_tree=>eventid_node_context_menu_req.
      event-appl_event = 'X'.
      APPEND event TO events.
      "event node_context_menu_select is automatically registered on registering
      " the event NODE_CONTEXT_MENU_REQUEST
      " process PAI if context menu select event occurs
      CALL METHOD g_tree->set_ctx_menu_select_event_appl
        EXPORTING
          appl_event = 'X'.
      CALL METHOD g_tree->set_registered_events
        EXPORTING
          events                    = events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3
          OTHERS                    = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    *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_expand_no_children    FOR g_tree.
      SET HANDLER g_application->handle_node_keypress         FOR g_tree.
      SET HANDLER g_application->handle_node_context_menu_req FOR g_tree.
      SET HANDLER g_application->handle_node_context_menu_sel FOR g_tree.
    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_table USING node_table.
      CALL METHOD g_tree->add_nodes
        EXPORTING
          table_structure_name           = 'ZKM_TREESNODE'
          node_table                     = node_table
        EXCEPTIONS
          error_in_node_table            = 1
          failed                         = 2
          dp_error                       = 3
          table_structure_name_not_found = 4
          OTHERS                         = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " create_and_init_tree
    *&      Form  BUILD_NODE_TABLE
          text
         -->P_NODE_TABLE  text
    FORM build_node_table
    USING node_table TYPE node_table_type.
      DATA: node LIKE zkm_treesnode.
    Build the node table.
    Caution: The nodes are inserted into the tree according to the order
    in which they occur in the table. In consequence, a node must not
    occur in the node table before its parent node.
    *Node with key 'Capgemini'.
      node-node_key = 'Capgemini'.   "Key of the node.
      CLEAR node-relatkey.      "Special case.. A root node has no parent node.
      CLEAR node-relatship.
      node-hidden   = ' '.      "Node is visible.
      node-disabled = ' '.      "Selectable.
      node-isfolder = 'X'.      "folder.
      CLEAR node-n_image.       "Folder-/ Leaf-Symbol in state "closed":
      "use default.
      CLEAR node-exp_image.     "Folder-/ Leaf-Symbol in state "open".
      "use default.
      CLEAR node-expander.
      node-text = 'Capgemini'.
      APPEND node TO node_table.
      gw_nodetable = node.
      APPEND gw_nodetable TO gt_nodetable.
      CLEAR gw_nodetable.
      CLEAR gw_flag-relatkey.
      gw_flag-node_key = 'Capgemini'.
      gw_flag-flag     = 1.              "Skeleton
      APPEND gw_flag TO gt_flag.
      CLEAR gw_flag.
      CLEAR node.
    *Node with key 'TSP-SAP-CRM'.
      node-node_key = 'TSP-SAP-CRM'. "Key of the Node.
      "Node is inserted as child of the node with key 'Root'.
      node-relatkey  = 'Capgemini'.
      node-relatship = cl_gui_simple_tree=>relat_last_child.
      node-hidden   = ' '.      "Node is visible.
      node-disabled = ' '.      "Selectable.
      node-isfolder = 'X'.      "folder.
      CLEAR node-n_image.       "Folder-/ Leaf-Symbol in state "closed":
      "use default.
      CLEAR node-exp_image.     "Folder-/ Leaf-Symbol in state "open".
      "use default.
      CLEAR node-expander.
      node-text = 'TSP-SAP-CRM'.
      APPEND node TO node_table.
      gw_nodetable = node.
      APPEND gw_nodetable TO gt_nodetable.
      CLEAR gw_nodetable.
    *adding the node for corresponding relatkey
      gw_flag-relatkey = 'Capgemini'.
      gw_flag-node_key = 'TSP-SAP-CRM'.
      gw_flag-flag     = 2.               "Service line
      APPEND gw_flag TO gt_flag.
      CLEAR gw_flag.
    *creating new relatkey in gt_flag
      gw_flag-relatkey = 'TSP-SAP-CRM'.
      gw_flag-node_key = ' '.
      gw_flag-flag     = '2'.
      APPEND gw_flag TO gt_flag.
    *Node with key 'Managers'
      node-node_key  = 'MANAGERS'.
      node-relatkey  = 'TSP-SAP-CRM'.
      node-relatship =  cl_gui_simple_tree=>relat_last_child.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      CLEAR node-expander.   "  = ' '.
      node-isfolder  = 'X'.
      node-text      = 'Managers'.
      APPEND node TO node_table.
      gw_nodetable = node.
      APPEND gw_nodetable TO gt_nodetable.
      CLEAR gw_nodetable.
      gw_flag-relatkey = 'TSP-SAP-CRM'.
      gw_flag-node_key = 'MANAGERS'.
      gw_flag-flag     = 3.                "Levels
      APPEND gw_flag TO gt_flag.
      CLEAR gw_flag.
      gw_flag-relatkey = 'MANAGERS'.
      gw_flag-node_key = ' '.
      gw_flag-flag     = '2'.
      APPEND gw_flag TO gt_flag.
    *Node with key 'Team Lead'.
      node-node_key  = 'TEAM LEAD'.
      node-relatkey  = 'TSP-SAP-CRM'.
      node-relatship =  cl_gui_simple_tree=>relat_last_child.
      CLEAR node-n_image.
      CLEAR node-exp_image.
      CLEAR node-expander.   "  = ' '.
      node-isfolder  = 'X'.
      node-text      = 'TEAM LEAD'.
      APPEND node TO node_table.
      gw_nodetable = node.
      APPEND gw_nodetable TO gt_nodetable.
      CLEAR gw_nodetable.
      gw_flag-relatkey = 'TSP-SAP-CRM'.
      gw_flag-node_key = 'Team_Lead'.
      gw_flag-flag     = 3.               "Levels
      APPEND gw_flag TO gt_flag.
      CLEAR gw_flag.
      gw_flag-relatkey = 'TEAM LEAD'.
      gw_flag-node_key = ' '.
      gw_flag-flag     = '2'.
      APPEND gw_flag TO gt_flag.
    ENDFORM.                    " BUILD_NODE_TABLE
    *&      Form  register_key_strokes
          text
    -->  p1        text
    <--  p2        text
    FORM register_key_strokes .
      g_key = cl_tree_control_base=>key_delete.
      "process PAI if node key press occurs
      CALL METHOD g_tree->add_key_stroke
        EXPORTING
          key               = g_key
        EXCEPTIONS
          failed            = 1
          illegal_key       = 2
          cntl_system_error = 3
          OTHERS            = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      g_key = cl_tree_control_base=>key_enter.
      "process PAI if node key press occurs
      CALL METHOD g_tree->add_key_stroke
        EXPORTING
          key               = g_key
        EXCEPTIONS
          failed            = 1
          illegal_key       = 2
          cntl_system_error = 3
          OTHERS            = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      g_key = cl_tree_control_base=>key_insert.
      CALL METHOD g_tree->add_key_stroke
        EXPORTING
          key               = g_key
        EXCEPTIONS
          failed            = 1
          illegal_key       = 2
          cntl_system_error = 3
          OTHERS            = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " register_key_strokes
    ***INCLUDE ZKM_CL .
    *&       Class LCL_APPLICATION
           Text
    CLASS lcl_application DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_node_double_click
         FOR EVENT node_double_click
         OF cl_gui_simple_tree
         IMPORTING node_key,
        handle_expand_no_children
         FOR EVENT expand_no_children
         OF cl_gui_simple_tree
         IMPORTING node_key,
        handle_node_keypress
         FOR EVENT node_keypress
         OF cl_gui_simple_tree
         IMPORTING node_key key,
        handle_node_context_menu_req
         FOR EVENT node_context_menu_request
         OF cl_gui_simple_tree
         IMPORTING node_key menu,
        handle_node_context_menu_sel
         FOR EVENT node_context_menu_select
         OF cl_gui_simple_tree
         IMPORTING node_key fcode.
    ENDCLASS.               "LCL_APPLICATION
    *&       Class (Implementation)  LCL_APPLICATION
           Text
    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.                    "HANDLE_NODE_DOUBLE_CLICK
      METHOD handle_expand_no_children.
        " this method handles the expand no children event of the tree
        " control instance
        DATA: node_table TYPE node_table_type,
              node TYPE zkm_treesnode.
        "show the key of the double clicked node on the dynpro field.
        g_event = 'EXPAND_NO_CHILDREN'.
        g_node_key = node_key.
        IF node_key = 'TSP-SAP-CRM'.
    *add two nodes to the tree control (The children of Child1).
    *Node with key 'New1'.
          CLEAR node.
          node-node_key  = 'Managers'.
          node-relatkey  = 'TSP-SAP-CRM'.
          node-relatship =  cl_gui_simple_tree=>relat_last_child.
          node-n_image   = '@XY@'.
          CLEAR node-exp_image.
          node-expander  = ' '.
          node-isfolder  = ' '.
          node-text      = 'Managers'.
          APPEND node TO node_table.
    *Node with key 'New2'.
          CLEAR node.
          node-node_key  = 'Team_Lead'.
          node-relatkey  = 'TSP-SAP-CRM'.
          node-relatship =  cl_gui_simple_tree=>relat_last_child.
          node-n_image   = '10'.
          CLEAR node-exp_image.
          node-expander  = ' '.
          node-isfolder  = ' '.
          node-text      = 'Team Lead'.
          APPEND node TO node_table.
        ENDIF.
        CALL METHOD g_tree->add_nodes
          EXPORTING
            table_structure_name           = 'MTREESNODE'
            node_table                     = node_table
          EXCEPTIONS
            error_in_node_table            = 1
            failed                         = 2
            dp_error                       = 3
            table_structure_name_not_found = 4
            OTHERS                         = 5.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDMETHOD.                    "HANDLE_EXPAND_NO_CHILDREN
      METHOD handle_node_keypress.
        g_node_key =  node_key.
        CASE key.
          WHEN 2.
            g_event = 'DELETE KEY PRESSED'.
            READ TABLE gt_flag INTO gw_flag WITH KEY node_key = g_node_key.
            IF gw_flag-flag EQ 1.
              MESSAGE e004(zkm_class).
            ENDIF.
            CALL SCREEN 3000 STARTING AT 20 10.
            CLEAR g_event.
          WHEN 3.
            g_event = 'INSERT KEY PRESSED'.
            READ TABLE gt_nodetable INTO gw_nodetable WITH KEY node_key = g_node_key.
            IF gw_nodetable-isfolder = ' '.
              MESSAGE e006(zkm_class).
            ELSE.
              CALL SCREEN 2000 STARTING AT 20 10.
              MESSAGE s001(zkm_class).
            ENDIF.
            CLEAR g_event.
          WHEN 5.
            g_event = 'ENTER KEY PRESSED'.
            READ TABLE gt_nodetable INTO gw_nodetable WITH KEY node_key =  node_key.
            IF gw_nodetable-isfolder = ' '.
              MESSAGE e009(zkm_class).
            ELSE.
              CALL METHOD g_tree->expand_node
                EXPORTING
                  node_key            = node_key
                EXCEPTIONS
                  failed              = 1
                  illegal_level_count = 2
                  cntl_system_error   = 3
                  node_not_found      = 4
                  cannot_expand_leaf  = 5
                  OTHERS              = 6.
              IF sy-subrc <> 0.
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              ENDIF.
            ENDIF.
        ENDCASE.
        CALL METHOD g_tree->remove_all_key_strokes
          EXCEPTIONS
            failed            = 1
            cntl_system_error = 2.
      ENDMETHOD.                    "HANDLE_NODE_KEYPRESS.
      METHOD handle_node_context_menu_req.
        g_event    = 'NODE_CONTEXT_MENU_REQ'.
        g_node_key = node_key.
        CALL METHOD menu->add_function
          EXPORTING
            fcode = 'ADD'
            text  = 'Add Node'.
        CALL METHOD menu->add_function
          EXPORTING
            fcode = 'DELETE'
            text  = 'Delete Node'.
      ENDMETHOD.                    "handle_node_context_menu_req
      METHOD handle_node_context_menu_sel.
        g_event = 'NODE_CONTEXT_MENU_SELECT'.
        CASE fcode.
          WHEN 'ADD'.
            READ TABLE gt_nodetable INTO gw_nodetable WITH KEY node_key = g_node_key.
            IF gw_nodetable-isfolder = ' '.
              MESSAGE e006(zkm_class).
            ELSE.
              CALL SCREEN 2000 STARTING AT 20 10.
              MESSAGE s001(zkm_class).
            ENDIF.
            CLEAR g_event.
          WHEN 'DELETE'.
            IF g_node_key EQ 'Capgemini'   OR
               g_node_key EQ 'TSP-SAP-CRM' OR
               g_node_key EQ 'MANAGERS'    OR
               g_node_key EQ 'TEAM LEAD'.
              MESSAGE e004(zkm_class).
            ENDIF.
            CALL SCREEN 3000 STARTING AT 20 10.
            CLEAR g_event.
        ENDCASE.
      ENDMETHOD.                    "handle_node_context_menu_sel
    ENDCLASS.               "LCL_APPLICATION
    This is a complete tree control application..  I am sure it will solve all your problems.
    Pls pls reward points if useful.
    Regards,
    Karan

  • Call type Report, Return Value

    Hello,
    I need a understanding description for the Return column in the call type report, i need a description other than what is already described in the webview template reference .
    Thanks.
    Amer

    Hello Ahmed,
    So you meant to say that for the whole day the Call Type Report is starting only from 15:30 ?  And you are not able to find 10:30 Interval ?
    Have you checked for any other Call Types ? Was there any failure happened in any of the components ? The RouterCallKey's doesn't look normal.
    Regards,
    Senthil

  • Webview call type report missing a completed call

    i have a call handled by an agent in my call center but i cannot find it in the webview call type report but in the webview database route_call_detail table i find it ? hope for your help
    call is received at 10:34 but the call type first period start from 15:30  !!
    and i have attached the SQL query results.

    Hello Ahmed,
    So you meant to say that for the whole day the Call Type Report is starting only from 15:30 ?  And you are not able to find 10:30 Interval ?
    Have you checked for any other Call Types ? Was there any failure happened in any of the components ? The RouterCallKey's doesn't look normal.
    Regards,
    Senthil

  • Reporting Services web service complex xml type report parameters

    Hi,
    I have the following xml type parameter in my request query that I use in reporting services.
    <Parameter Name="accountDetails" Type="XML" xmlns:d4p1="thevalue" xmlns:i="thevalue">
    <DefaultValue>
    <d4p1:AccountDetailDto>
    <d4p1:AccountNumber>12345</d4p1:AccountNumber>
    <d4p1:AccountType>Sales</d4p1:AccountType>
    </d4p1:AccountDetailDto>
    </DefaultValue>
    I want to know how I can assign values to the accountDetails parameter from report parameters, I've tried to call it from the dataset parameter properties but it doesn't return any values. I created Parameters!accountDetails.Value on the dataset parameters
    properties and assigned it the following value: it only returns empty columns
    ="<AccountDetailDto><AccountNumber>"& Parameters!AccountNumber.Value &"</AccountNumber><AccountType>"& Parameters!AccountType.Value &"</AccountType></AccountDetailDto>"
    You're help will be highly appreciated as I've been trying to solve this for a while now

    Hi Alisa,
    Perhaps I should explain my problem clearly...
    This is my query request that I send to the webservice:
    <Query>
    <Method Name="GetPerAccountAssetAllocation" Namespace="http://tempuri.org/">
    <Parameters>
    <Parameter Name="accountDetails" Type="XML" xmlns:d4p1="thevalue" xmlns:i="thevalue">
    <DefaultValue>
    <d4p1:AccountDetailDto>
    <d4p1:AccountNumber>12345</d4p1:AccountNumber>
    <d4p1:AccountType>JSE</d4p1:AccountType>
    </d4p1:AccountDetailDto>
    </DefaultValue>
    </Parameter>
    </Parameters>
    </Method>
    <SoapAction>http://tempuri.org/IPortfolioManagementService/GetPerAccountAssetAllocation</SoapAction>
    <ElementPath IgnoreNamespaces="true">*</ElementPath>
    </Query>
    It works well when I run it just like this, that is without specifying any parameters in the report data dialogue window or on the dataset parameters properties, it returns the values and columns correctly.
    So my problem is, I need to find out how(xml parameter syntax, steps e.t.c)
    I can do to allow users to specify the accountDetails parameter, its quite tricky for me coz its an xml type parameter, Im not sure if I should just specify the AccountNumber and
    ReportType parameters separately:
    I've tried the following without any success:
    1. Under the dataset properties:  I tried not to specify a default value for the accountDetails parameter on the xml query, then I added a parameter called "accountDetails" under the dataset parameters properties, then under parameter
    value I added the following xml value :
    <d4p1:AccountDetailDto>
    <d4p1:AccountNumber>Parameters!AccountNumber.Value</d4p1:AccountNumber>
    <d4p1:AccountType>Parameters!AccountType.Value</d4p1:AccountType>
    </d4p1:AccountDetailDto> 
    (I also added the AccountNumber and AccountType parameters under the report data dialogue window)
    This returns empty columns, is there something I'm missing, or am I doing this incorrectly?

  • Creating Profile type report that hold fields with multiple values

    Really hoping someone can please help me out as I am very new to Crystal Reports.
    We use Maximizer CRM and we have been in need of some custom reports to rule out risk for regulators. I contacted Max and they suggested the only possible way is to create through Crystal. Its been almost one month already and I still cannot for the likes of me get this report operating properly. I have been inside and out on all sorts of forums, posted topics but no luck! So I will give it one more attempt in hopes that one of you geniuses can show me the way.
    In Maximizer CRM there is date, numeric, alphanumric and table. Our table fields items can be set to either single value or multi-value. So in crystal i did a default join of Client.tbl and the user-defined fields from view and joined the client id and contact number from all the view fields to client table. See Image:
    and I have dragged all the relevant fields in rows (in details section) rather then columns because we would be reporting on more then 1 record at a time. My problem is - If there is a table with multiple items selected (values), the records triple in count and it will show the same record over and over with just single field value changing at a time.
    The formula field you see in the image is from when I posted a discussion and Abhilash assisted me by providing the formulas I should add:
    1) Create a formula with this code and place this on the Details Section:
    whileprintingrecords;
    stringvar s := s + {field_with_multiple_values} + ", ";
    2) Next, move all the fields (except the formula field above) from the Details section to the Report Footer
    3) Create a formula with this code and place this on the Report Footer. This field would replace the existing field that contains multiple values:
    whileprintingrecords;
    stringvar s;
    Left(s, len(s)-2);
    This method is not working out for this type of report. When I add the formula Crystal is still counting my 2 records as 5 records but I can only view it as a single record and the multi-field has all the values for both records and displaying as a single record. See image:
    Can anyone please assist and advise where I am going wrong?
    -Jared

    Hi Jared,
    Thanks for taking down memory lane that is Maximizer.  Nice to see their table structure hasn't been simplified in the last 20 years.
    If I understand what's happening, you should only see 2 records and not 5.  That means your joins are creating duplicate records.  For now I'm going to skip over trying to optimize your query because I still have bad dreams of linking Maximizer tables.
    There are a couple of ways to work around the duplicates, one is to create a group and instead of having your formula in the Detail section, put it in the Group Header.  The question is what would you create your group on that would get you a unique record?
    If you know where the duplicates are coming from, create a Record Selection Formula that will remove the duplicates.
    There is also the menu option Database | Select Distinct Records.  I've never really had success with this one but there's no harm in giving it a shot.
    I would have you try and find which table or combination of tables is generating the duplicates but that requires playing with your links.  Normally I'd start by adding one table at a time and dropping one field onto the report.  If it doesn't repeat then add another table and field and repeat until you get your duplicates.  Once you know where they are coming from then you can either drop that table from your query or create a selection formula that removes the duplicates.
    Good luck,
    Brian

  • How to hide Bottom Line in Report ?

    Hi everyone,
    We are working on Reports 11gr2 64-bit.
    In every report, when text is completed on a page, a horizonal line (i.e. bottom line) at the end of the every page is shown and printed unnecessarily.
    But creates problem in printed stationary, specially in Cheque-printing.
    Kindly advise me how to hide this bottom-line, specially in printing.
    Thanks.
    Dev.
    Edited by: ocpdev on Apr 5, 2013 6:29 PM

    HI
    Is these reports are developed on 11g or migrated from earlier version.
    Anyhow, to test it, - create a report from scratch on 11g and run it, Also check the Footer for any Lines on it.
    I hope you can identify the issue by redoing the thing for testing
    Best of luck
    ocpdev wrote:
    Hi everyone,
    We are working on Reports 11gr2 64-bit.
    In every report, when text is completed on a page, a horizonal line (i.e. bottom line) at the end of the every page is shown and printed unnecessarily.
    But creates problem in printed stationary, specially in Cheque-printing.
    Kindly advise me how to hide this bottom-line, specially in printing.
    Thanks.
    Dev.
    Edited by: ocpdev on Apr 5, 2013 6:29 PM

  • How to Print File Path and File Name at the bottom of the Report?

    Hi guys,
    I have situation where i have to display my file path where i save my file. For example: U:\Reports\Monthly_Reports\Compay_xyz.jsp
    also, after the file path line if its possible i would like to display the date where the last modification done on the file.
    I read one of the post and some one suggested that use srw.get_report_name() but since i am a new to Reporting i am not sure how to use it.
    Can anyone describe me little bit in detail please?
    Thank You.

    Hi,
    Your logic seems to be fine and you should put it in the additional plsql code section "After displaying the page". But you may have to check you syntax by compiling it. You cannot use "LINEFEED". It should be '<br>'. This is the line break in html. Please check your type declaration. Also some ';' is missing after some statements.
    Hope that helps.
    Thanks,
    Sharmila

  • Grid or light box type report in SSRS 2012

    Hi I am trying to create a grid report like a light box type display in SSRS. I want to display images horizontally across the report and then down. I am using VS 2013. I understand from my searching that this can be done using a matrix control and grouping
    using an expression to limit the number of cells displayed across the page (in my case 3) and this works partly. I get a display where my images are off set like below:
    data data data
                          data data data
    data data data
    I can't work out how to have each row of images progress down the page so that I see each row of three starting from the left and not off set like this:
    Data data data
    Data data data
    data data data
    Grateful for your help.
     

    Hi WhyIsItSoHard,
    According to your description, you want to display values in a matrix from left to right and each row align to left, right?
    In Reporting Services, values in matrix cells display aggregate values scoped to the intersection of the row and column groups to which the cell belongs. If there is no corresponding value for each intersection, it’s possible that the matrix will display
    like the first structure you mentioned. In your scenario, if you want to display as the second structure, you could embed the matrix in a list. Please refer to steps below:
    1. Query  the table except the null values, then create a list and a matrix, then drag the matrix into the list, and delete the first row of the matrix.
    2. The final design should look like below. Then preview the report.
    Reference:
    Lists (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

Maybe you are looking for

  • How can I sync different iphones to one computer

    I have an iphone 4 alread and recently updated my husbands phone to a iphone 4 as well. Can I sync and set up as sepparte itunes account on the same computer? If so, how do I delete my itunes account from his iphone? Thanks!

  • Date is not shown in messages list

    For many emails that I am receiving from different accounts, date is not shown in messages list, only time. It looks like these messages were received today, in fact they are old. Encountered this problem on 2 different PCs, 3 different mail accounts

  • How to install app in sd card in lenovo A328?

    Dear, lenovo community.                     please tell me how to move app in sd card , please give us answer in a video or in a detailed form . So , that i should solve the problem?

  • Large Photoshop Document opens strange. Frames Lost?

    <Sorry I have no idea if this has been posted before><br /><br />I'm not sure how to describe it.<br />I've been trying to find out what the problem is with my document.<br /><br />I've been animating in HD and i have about 300 frames. Which I've spe

  • SOAP- RFC- FTP Scenario

    Hi experts, Could you please show me the link which guides to create a scenario such as: request sent from SOAP client to XI server to get data from an ECC system, then the response will be sent to FTP server as file. Thanks in advance