Sunteți pe pagina 1din 39

SAP APO Demand Planning

SAP Queries
The application SAP Query is used to create lists not already contained in the SAP standard. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists

| 31-Dec-13

SAP APO Demand Planning

Creating Queries
User Groups Define Data InfoSet What data is needed? How to get the data Design the Query Selection Fields Report Fields Type of Query Layout of Report Sort Order Totals option Output Length for each field Formatting Color, Label etc. Page Header and Footer

Who can access the data

Field Groups What fields can be used? How can they be grouped?

Query Area Group the above objects logically and for access purpose
3 | 31-Dec-13

SAP APO Demand Planning

Components of Query

Data Source For Query Field Groups User Groups Query Areas Authorizations

| 31-Dec-13

SAP APO Demand Planning

Data Sources for Query


Table Join Direct Table Read Logical Databases Data Retrieval using programs Sequential Dataset

| 31-Dec-13

SAP APO Demand Planning

Field Groups
An Infoset contains all the fields which can be accessed for building a query.
A field group combines related fields together from an infoset into a meaningful unit. It provides you with a preselection, so that you do not have to search through all fields of a data source just to produce a simple list. This means that the end-user only has access to precisely those fields assigned to a field group. Fields must be assigned to a field group before they can be used in queries. The field group can thus also be used as a filter for restricting access to sensitive data.

| 31-Dec-13

SAP APO Demand Planning

User Groups in Queries


SAP Query is used by three different groups of people. Each of these groups works with different SAP Query components. Departmental users These are end-users who create new queries and generate lists by executing queries. System administrators System administrators set up the necessary environment for end users and carry out transports. Translators Translators perform a language comparison for the different texts. Users groups are used for setting up the environment and controlling the access. Users working within the same application are thus assigned to the same user group. Within a user group, it is irrelevant who has defined a certain query, since anyone who belonging to that group can execute it. However, only users with the appropriate authorization can change queries or define new ones. Users are not allowed to modify queries from other user groups, although they may, under certain circumstances, copy and execute them . Each user can be assigned to several user groups.

| 31-Dec-13

SAP APO Demand Planning

User Groups in Queries


By Default, the system only displays the queries belonging to one user group. Since one user can be assigned to multiple user groups, we can change the user groups Edit->Other User Group

| 31-Dec-13

SAP APO Demand Planning

Maintaining User Groups

| 31-Dec-13

SAP APO Demand Planning

Query Areas
A query area contains a set of query objects (queries, InfoSets, and user groups) that are discrete and consistent. You can differentiate between two different query areas, the standard area and the global area Standard Area The standard query area is primarily designed for ad-hoc queries, that is for queries that are created to fulfill a one-time demand and never used again. Standard area queries are client-specific. They are not connected to the Workbench Organizer. Global Area In the global query area, queries are developed that are used throughout the entire system (that is, they are cross-client). These queries are also intended for transport into other systems. Query objects created in the global area are registered in the Workbench Organizer. They can be created and transported using the normal correction and transport procedure.

10

| 31-Dec-13

SAP APO Demand Planning

Query Area

11

| 31-Dec-13

SAP APO Demand Planning

Types of Infoset Queries


Development The reporting type Development is used for creating queries that are going to be used on a long-term basis. This means that queries can be saved (as executable programs), incorporated into menus, or distributed. Technically speaking, this means that the global area is always used, and a connection to the Workbench Organizer exists whenever you call up the InfoSet Query for the Development reporting type.
Ad-hoc Reporting The reporting type Ad-hoc reporting is used primarily as a quick and simple way of creating specific reports that, as a rule, are not needed more than once. Ad-hoc reporting is possible in both query areas (global and standard), and you can also save your queries. In the global area, they are always saved in a temporary development class, and there is no dialog with the Workbench Organizer. You can save queries that you need frequently. You can then open, and execute them again in InfoSet Query. If you frequently use a query with the same selection fields but different values, you should save it without values. If you frequently use a query with the same selection fields and values, you should save it with a variant, that is, with values and selection options.
12 | 31-Dec-13

SAP APO Demand Planning

InfoSet Query or Adhoc Query


An InfoSet is a special view of a dataset (logical database, table,Sequential File). An HR Infoset provides you with a view of data in specific parts of HR that is structured by infotype.

InfoSet Query contains the Object Selection function with which you should work in order to evaluate HR data.
InfoSet Query is designed in such a way that it can be called directly from roles with a relevant InfoSet and be used directly by the end-user for reporting within his/her roles. This also means that the end-user does not have to carry out any SAP Query administration functions, for example assigning him/herself to a user group. InfoSet Query uses the SAP List Viewer (ALV) as its standard output medium. Transaction code for Infoset Query SQ02

13

| 31-Dec-13

SAP APO Demand Planning

Access control using User Groups


The procedure for controlling access rights using user groups is exactly the same as with the SAP Query. This means that, per user group, you determine which InfoSets can be accessed and which users belong to a user group. Users allowed to create and change queries, must be given the change authorization (authorization object S_QUERY for field ACTVT value 02).

14

| 31-Dec-13

SAP APO Demand Planning

Access control using Roles


Roles The technical background to controlling access authorization using roles is as follows: o Exactly one SAP Query user group must be assigned to a role. o InfoSets have to be assigned to this user group. Users from the user group, and now
also the role, can use these InfoSets for reporting. o It is not necessary to enter the users into the user group as they are assigned in the role assignment. This means that a user who is assigned to a role is automatically copied into the user group assigned to the role. This assignment is only valid, however, if the user uses the role to call the InfoSet Query. If InfoSet Query is accessed in any other way, then the general access authorization implemented using SAP Query user groups applies. o To be able to save queries, a user needs the relevant change authorization for queries (authorization object S_QUERY, for the field ACTVT value 02). If the user does not have this authorization, he or she is able to use the available InfoSets and queries within the role, but is not able to save queries.

15

| 31-Dec-13

SAP APO Demand Planning

Data Source for Query


Table Join using Basis Table o A table join always takes in several tables that are read with the aid of special forms
of the SELECT instructions o The result set is a table, each of the lines of which contains all the fields of all the tables used in the join. The links between the various tables used in the join are all specified separately. These specify the exact combinations of records from the individual tables that become part of the result set.

16

| 31-Dec-13

SAP APO Demand Planning

Data Sources Direct Table Read


Used to allow the end-user to generate reports by performing a direct reading on the contents of a table without having to worry about data retrieval.

17

| 31-Dec-13

SAP APO Demand Planning

Data Sources- Using Logical Databases


In this option, Logical databases become a primary source of providing data. You can use the following logical databases can be used as a data source for HR InfoSets:
o PNP / PNPCE o PAP o PCH

18

| 31-Dec-13

SAP APO Demand Planning

Infosets in HR

19

| 31-Dec-13

SAP APO Demand Planning

Infoset based upon PNP Logical Database


InfoSets based on this logical database enable you to use InfoSet Query to select employees. You can use data from Personnel Administration and Time Management and payroll infotypes as selection criteria. From a technical perspective, this means you can use fields from infotypes 0000 to 0999 and 2000 to 2999 and payroll infotypes as selection criteria. For example, you can use the InfoSet to run a report that determines which employees have a particular place of residence. Furthermore, you can create InfoSets on the basis of this logical database that enable you to report on the infotypes of related objects using InfoSet Query. For example, you can select persons who participated in a particular business event, and output the qualifications of the persons selected. To do this, you must select infotypes from Personnel Planning as well as infotypes from Personnel Administration when you create the InfoSet.

20

| 31-Dec-13

SAP APO Demand Planning

The InfoSet is based on logical database PAP


InfoSets based on this database enable you to use InfoSet Query to select applicants. You can use data from Recruitment as selection criteria and for output. From a technical perspective, this means you can use fields from specific Personnel Administration infotypes (such as 0001 and 0002) and fields from infotypes 4000 to 4999 as selection and output fields.

21

| 31-Dec-13

SAP APO Demand Planning

The InfoSet is based on logical database PCH


Provided that object selection is switched on, InfoSets based on this database enable you to use InfoSet Query to select objects of one object type, such as business events, qualifications, and positions. You can use all of the fields of infotypes allowed for the object in question, and all of the object types and their allowed infotypes that can be related with the selected object type, as selection criteria and for output. When you create an InfoSet, you determine the object type that you can select using an InfoSet. The generated InfoSet can only be used to select this particular object type. If you want to create reports for business events, qualifications, or positions, for example, you must create three separate InfoSets. This means the reports can only be executed separately. If you do not select an object type when you create the InfoSet, you can only use the InfoSet for InfoSet Query if object selection has been switched off.

22

| 31-Dec-13

SAP APO Demand Planning

HR Query using PNP LDB

23

| 31-Dec-13

SAP APO Demand Planning

Datasource - PNPCE

24

| 31-Dec-13

SAP APO Demand Planning

Data Sources Sequential DataSets / File Read


This is used to generate a report by reading the data from a file. For this purpose, the data in the file has to be formatted in a specific fashion. A structure also need to exist in database to define the data format.

25

| 31-Dec-13

SAP APO Demand Planning

Data Sources Reading data using Programs


If the standard table joins or logical databases do not meet the requirement for the dataset to be used for reporting, then this option can be used. In this option a model report is created in a specific format and a predefined DDIC Structure is used for transfer of data.

26

| 31-Dec-13

SAP APO Demand Planning

Designing a Query
1. Which data source corresponds to the requirements? 2. Which fields do you need to include in the InfoSet? 3. Do you need additional information which is not available in the data source? (This calls for the linking of additional tables and the definition of additional fields). 4. Do you need parameters and selection criteria? (parameters and selection criteria appear appear on the selection screen of queries which are created using the InfoSet). 5. Do you have to take any special measures such as access protection? 6. Do you have to change the long texts and headers of the selected fields?

27

| 31-Dec-13

SAP APO Demand Planning

Step 1: Selecting List Fields and Selection Fields

28

| 31-Dec-13

SAP APO Demand Planning

Layout , Sort Order and Totalling Columns

29

| 31-Dec-13

SAP APO Demand Planning

Output Length, Output Position, Field Color

30

| 31-Dec-13

SAP APO Demand Planning

Report layout Header and Footer

31

| 31-Dec-13

SAP APO Demand Planning

Report Layout Other Parameters

32

| 31-Dec-13

SAP APO Demand Planning

Transporting Queries
Standard Area Query objects are stored in the client-specific table AQLDB. They are not connected to the Change and Transport Organizer. Global Area Query objects are stored in the cross-client table AQGDB. They are connected to the Change and Transport Organizer.

33

| 31-Dec-13

SAP APO Demand Planning

Transporting Global Area objects


Global area objects can be transported into other systems. Standard area query objects can not only be transported to other clients within their own system, but into all clients of other systems as well. In addition, query objects can be transported from the global query area to the standard query area and back within the same system.

34

| 31-Dec-13

SAP APO Demand Planning

You can transport objects either from one client (the source client) to another client (the target client) within the same SAP System or from one client (the source client) in one R/3 System (the source system) to another client (the target client) in another R/3 System (the target system).
Option 1:

Using Transport Table AQTDB and Export/Import


Option 2: Using Upload or download interface.

35

| 31-Dec-13

SAP APO Demand Planning

Option 1:
You must first export the objects for transport from the table AQLDB to the transport table AQTDB. This creates a transport request for the transport system that includes all entries created by the export from table AQTDB (transport dataset). The request covers all the entries from table AQTDB (transport dataset) generated by the export and has a name which corresponds to transport system conventions (sysKnnnnnn). The name of the transport request is given in the export log. In the table AQTDB, the transport dataset is stored under a key which matches the name of the transport request. Then you can move or import the transport request.

36

| 31-Dec-13

SAP APO Demand Planning

Option 2:
You must first download the source client objects for transport from the table AQLDB to a file. When doing this, you specify the file name and exactly where it is stored in the file system. A file can only contain one transport dataset, meaning that any existing file is overwritten. Downloading a transport dataset to a file effectively means that it cannot be read back into the table AQLDB. Then, you can upload the transport dataset stored in the file. Here, the transport dataset is read and inserted in the table AQLDB. As with an import, the system performs numerous checks which ensure that no inconsistencies occur in the table AQLDB.

37

| 31-Dec-13

SAP APO Demand Planning

38

| 31-Dec-13

SAP APO Demand Planning

Transporting Queries

39

| 31-Dec-13

SAP APO Demand Planning

Advanced Topics Ranked lists and Statistics


Statistics Lists - With statistics, numerical values (for example, sales) belonging to particular key terms (for example, an airline carrier or a charter flight) are summed. The result is displayed in a table and thus returns an overview of the distribution of numeric values across the individual key terms. Ranked lists are special types of statistics. Here, numeric values are also summed for key terms and displayed in a table. Sorting always takes place using a numerical value. This value is described as a ranked list criterion. Additionally, only a certain number of items are output. Ranked lists are therefore useful for asking questions such as: "Which 10 materials have the highest sales?" "Which 10 customers have the highest sales?"

40

| 31-Dec-13

S-ar putea să vă placă și