HowTo Create Custom Queries v02

20
How to create custom Workcenter Queries in POWL With Solution Manager 7.1 SP07 Introduction: This guide describes how you can create own role-based queries in the workcenter Technical Operations. Queries in the workcenters help you to create predefined views on your data and to access the data you are interested in quicker and more efficient. There are several ways to create new queries. The easiest way is to create them directly from the workcenter. But these queries are only visible for the user that created them. This is not always what the customer wants. So the queries described in this guide are created in the POWL framework directly and can be assigned to roles. This way they are visible to all users that have a specific role. TABLE OF CONTENTS Overview over Workcenter Queries .......................................................................................................... 2 Step 1: Find POWL Application and Query Type...................................................................................... 4 Find POWL Application and Query Type by example ................................................................................... 5 Optional: Define Query Category .............................................................................................................. 7 Step 2: Define Query.................................................................................................................................. 9 Create a new Query ..................................................................................................................................... 9 Maintain Query Parameters ......................................................................................................................... 9 Maintain Query Settings ..............................................................................................................................10 Calculated Dates ........................................................................................................................................12 Maintain Layout Variants.............................................................................................................................13 Step 3: Assign Query to an POWL Application .......................................................................................16 Result ........................................................................................................................................................17 Change the Parameters of a Custom Query ............................................................................................19

description

HowTo Create Custom Queries v02aaa

Transcript of HowTo Create Custom Queries v02

  • How to create custom Workcenter Queries inPOWLWith Solution Manager 7.1 SP07

    Introduction: This guide describes how you can create own role-based queries in the workcenterTechnical Operations. Queries in the workcenters help you to create predefined views on your dataand to access the data you are interested in quicker and more efficient.There are several ways to create new queries. The easiest way is to create them directly from theworkcenter. But these queries are only visible for the user that created them. This is not alwayswhat the customer wants. So the queries described in this guide are created in the POWLframework directly and can be assigned to roles. This way they are visible to all users that have aspecific role.

    TABLE OF CONTENTSOverview over Workcenter Queries .......................................................................................................... 2Step 1: Find POWL Application and Query Type...................................................................................... 4Find POWL Application and Query Type by example ................................................................................... 5Optional: Define Query Category .............................................................................................................. 7Step 2: Define Query .................................................................................................................................. 9Create a new Query ..................................................................................................................................... 9Maintain Query Parameters ......................................................................................................................... 9Maintain Query Settings ..............................................................................................................................10Calculated Dates ........................................................................................................................................12Maintain Layout Variants .............................................................................................................................13Step 3: Assign Query to an POWL Application .......................................................................................16Result ........................................................................................................................................................17Change the Parameters of a Custom Query ............................................................................................19

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    OVERVIEW OVER WORKCENTER QUERIES

    SAP Solution Manager workcenters are based on the POWL (Personal Object Work List) framework. POWLenables the user to create queries cut out to display exactly the data the user is interested in. A lot of queriesare delivered by default with the SAP Solution Manager workcenters, but it is also possible for users tocreate own queries. Usually an end-user would create these queries in the workcenter itself. Thedisadvantage of these queries is that they are only visible to the user that initially created them. In the POWLframework it is also possible to create queries which can be assigned to a specific role. These queries willthen be visible to every user that has this specific role.

    To understand how to create a role-based query it is important to understand the different elements aworkcenter consists of. Each workcenter consists of one or more views. A view can contain one or morePOWL applications. Which application is displayed is determined by the type selected in the Type Selectionarea. A POWL application is a set of POWL queries based on one or more POWL types.

    One POWL application can be used in several workcenters. E.g. the POWL application in the workcenterTechnical Monitoring System Monitoring Systems is the same POWL application as the one used inthe workcenter Root Cause Analysis End-to-End Analysis Systems. This means, if you create a newquery in this POWL application, it will be visible in all workcenters where this POWL application is used.

    The POWL type is based on a feeder class which defines the columns that can be displayed in a query, theactions (buttons) that a query provides and which selection criteria you have to select data for a query.Additionally it contains a method that describes how the data for the query is retrieved.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    To create your own query in a specific workcenter view you need to know the POWL application it should beplaced in and also the POWL type for the query. How you can get this information is described in the nextchapters. In this example we will create a new custom query in the workcenter Technical MonitoringSystem Monitoring Systems.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    STEP 1: FIND POWL APPLICATION AND QUERY TYPE

    The first step is to decide in which workcenter view you want to add your custom query. Once this is done,you can now determine the POWL application your query will have to be assigned to.

    You can find the POWL application via the URL API Application Manager. The URL API Application Managercan be accessed via the link:

    http://:/sap/bc/webdynpro/sap/urlapi_app_manager

    In the URL API Application Manager switch to the tab Groups. Here you find a tree view that contains allWorkcenters which are currently supported for this kind of queries. The tree view has the same structure asthe workcenter would have. Under the workcenter name you find the different views and under the views thedifferent types of POWL applications you can display in the views. Select the type you want to place yourquery in. In our example we select the type Systems. The POWL application can be found in the propertykey POWL_APP_ID (marked in orange in the screenshot below).

    Now you have to find the POWL query type that can be displayed on this POWL application. This informationcan be found in the transaction POWL_TYPER. Search for the POWL application you found out before. Youcan use the Position button below the table to jump to it directly.

    One application can have assignments to more than one POWL type. As mentioned before, the POWL typedetermines the different selection criteria, the columns and the actions for a POWL query. In case anapplication has more than one assignment, you might want to check the different query types to check whichone suits your needs best.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    Find POWL Application and Query Type by example

    In some cases it is not possible to find a POWL_APP_ID in the URL API Application Manager. In this caseyou can also try to find the information by using an example query.

    In this example you want to know which application type we have to use for a query in alert inbox.

    The easiest way is to get the information from another query which is delivered with alert inbox:

    Its best to use a query that doesnt appear in other workcenter applications.

    Call transaction POWL_QUERY and search for the query:

    Double-click the query. In the field type you find the query type:

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    Use this to define your own query as described in the following in this guide. Remember also the query ID, tofind out the correct POWL application for your query. Call transaction POWL_QUERYR and find the query inthe column Query ID:

    The Application ID is in the same row in the column Application.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    OPTIONAL: DEFINE QUERY CATEGORY

    In this optional step you can create a category for your query. Per default in most of the workcenters thequeries are displayed as tab strips. In this view categories are usually not useful.

    This layout can be changed using the Personalize link in the upper right corner of the tab strip. Select theLayout tab and switch the layout to Link Matrix.

    In this view the queries are shown as a matrix of links with and sorted by the categories (if a category isassigned). This layout can be useful if you have a bigger amount of queries and want to be able to accessthem all without scrolling thru the tabs.

    To define a category for your query, call transaction POWL_CAT and press the New Entries button.

    Enter a technical name and a description for your category and save your changes.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    You will be prompted for a customizing request on saving.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    STEP 2: DEFINE QUERYCreate a new Query

    New queries are created using the transaction POWL_QUERY. In this transaction you define the query itselfand also predefined values for selection criteria and query settings.

    At first click New Entries to create a new query.

    Enter a name and a description for the query. The description will show up as the name of the tab in the tabstrip view in the workcenter. Make sure you select the query type you found out before. You can also selectthe refresh type for the query. This defines when the data in the table will be refreshed.

    It is recommended to use Manual Only as refresh type. The other refresh types can cause recurring waittimes and should only be used if you use a very quick query or you have a status in your query that needs tobe updated.

    Save your query. You will be prompted for a customizing request on saving. The further customizing optionswill not be visible until after you saved the query.

    Maintain Query Parameters

    The next step is to maintain query parameters. The query parameters can be used to define values for thequery to preselect the data. Click the Query Parameters button. When you click the Query Parameters

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    button for the first time you will receive a pop-up asking you to enter a BP version. Click NEVER DISPLAYAGAIN to suppress this pop-up in future.

    Now you can add parameters to your query. Which parameters are available depends on the POWL querytype.

    Maintain Query Settings

    Via the query settings you can determine if your query parameters are changeable later on in the workcenterand if you want to display a quick maintenance area for the query. Select the button Query Settings tomaintain the query settings.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    If you want to make sure that no-one changes your query at runtime, you should set all parameters to Readonly and Hidden.

    To enable users to change the query at runtime using the quick maintenance criteria, you can turn on thisfeature by setting the selected parameters as Quick search.

    Selecting this option will cause an additional button to appear at runtime, where the user can quickly changethe query parameters.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    Calculated Dates

    If your query type includes date selection criteria, you can use the settings for Calculated Dates. This wayyou can restrict the time range of the result data dynamically. Our example query doesnt contain any dateselection criteria, so we use another query as an example to explain this particular concept.

    The example below shows a query created for Incident Management. This query type contains data fields torestrict the age of the messages found. In a default query that is assigned to a role you wouldnt want tomake this field static, but keep it generic and show e.g. the messages from the last 10 days.

    By clicking on the Calculated Dates button you open a dialog in which all date selection criteria fields aredisplayed. Now you can select a reference date.

    If your reference date contains a calculation, e.g. Today Minus N Day(s) a second dialog will open, in whichyou can enter the amount of days you want to go back.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    After entering the values the date calculated for the query for today is displayed. It will adjust automaticallyduring runtime.

    Save your query.

    Maintain Layout VariantsWith the layout variants you can create views inside your query. Views are used to save a specific layoutcontaining e.g. only a subset of the available columns or a filter or sorting.

    To be able to maintain layout variant the ICF service powl_master_query has to be activated in transactionSICF.

    In the Maintain Layout application you first see the [Standard View]. This view is provided by the POWLtype. The standard view shows what your query would look like if you call it in the workcenter right now.

    Now you can apply a filter on this view by clicking on the Filter link.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    To save this filter as a new view for the query, click on the Settings link. Under settings you can change thecolumns that are displayed, you can add a sorting for different columns, add calculations on columns thatcontain numbers and change the number of displayed rows etc. After adjusting the view to your needs youcan save it by clicking on Save as

    Enter a meaningful name for your new view. You can also make the view the initial view. Then this view willbe the view the user sees when he enters the query.

    Click on OK after saving your new view, to close the settings dialog.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    You can close the explorer window with the Maintain Layout application after you finished. Do not forget toalso save your query in the transaction POWL_QUERY to make sure the layout is correctly assigned andstored to the query.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    STEP 3: ASSIGN QUERY TO AN POWL APPLICATION

    Now you have created a new query, but to make this query visible to the users you have to assign it to thecorrect application. It is the application you found out in step 1. This assignment is done in the transactionPOWL_QUERYR. Also the assignment of the query to a role is done in this transaction.

    Click the New Entries button to create an entry for your query.

    Enter the correct application and select your query in the Query ID field. You can optional add a Category foryour query. The sequence number determines where your query will show up in the tab strip or the linkmatrix. Make sure that you check the Activate checkbox to activate your query.

    If you want to make sure, that your query is only visible if a user has a specific role, add the exact role nameinto the Role field.

    Save your entries.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    RESULT

    The new query you created will now show up in the workcenter you created in for.

    It already contains the view we created in the section Maintain Layout Variants.

    Additionally you find the Show Quick Criteria Maintenance button that allows the user to change theselection criteria of the query during runtime.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    When you change to the Link Matrix layout you will also see the category you assigned to your query.

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    CHANGE THE PARAMETERS OF A CUSTOM QUERY

    Occasionally you might want to change the search parameters for your custom query or you want to changethe search fields. However after you made the change you will not see your changes in the workcenter,when you try to test your changes with a user that already used the custom query.

    First you have to delete the query cache for the user to be able to see the changes to the query in theworkcenter.

    For example you have changed the parameters in the customer query Only Alerts for SI7

    When a user calls the workcenter for the first time an entry for this query is created in the query cache. To beable to see changes to the pre-defined query delete the cache with report POWL_D01.

    Call transaction SA38 and run report POWL_D01:

    Run it for the user in question in DISPLAY mode:

    http://www.sap.com/company/legal/copyright/index.epx

  • Copyright/Trademark

    You get a list with all cached queries for the user. Sort by query ID to find the Z-queries:

    Select the query you changed and use the Delete query button to delete the query.

    With the next start of the workcenter the new parameters will be used and a new cache entry will be created.

    http://www.sap.com/company/legal/copyright/index.epx

    OVERVIEW OVER WORKCENTER QUERIESSTEP 1: FIND POWL APPLICATION AND QUERY TYPEFind POWL Application and Query Type by example

    OPTIONAL: DEFINE QUERY CATEGORYSTEP 2: DEFINE QUERYCreate a new QueryMaintain Query ParametersMaintain Query SettingsCalculated DatesMaintain Layout Variants

    STEP 3: ASSIGN QUERY TO AN POWL APPLICATIONRESULTCHANGE THE PARAMETERS OF A CUSTOM QUERY