Dynamic Selections в отчетности HCM

Dynamic Selections в отчетности HCM.

Вступление

Работая с HCM отчетностью функциональный консультант обязательно столкнется с таким термином как Dynamic Selections или, как я его интерпретирую для себя, вариант динамической выборки.

См. Dynamic Selections

Use
Dynamic selections considerably improve report performance because the system retrieves data very quickly when these fields are used. Dynamic selections also provide you with increased flexibility with regard to defining reporting criteria because they enable you to use additional selection fields to define reports in the standard system (for example, City and Country key ).

A dialog box that displays all available dynamic selections enables you to select the dynamic selections (fields) that you want to use. The same dialog box enables you to enter the values required for individual fields.

Dynamic Selections

Вариант динамической выборки - это преднастроенный блок фильтров/параметров, готовый для использования в ABAP-отчете или оперативном запросе, отсутствующий в стандартном "исполнении" селекционном экрана программы, созданной на базе ЛБД.

См. Enhancing the Selection Screen - Dynamic Selections

Use
Dynamic selections are used to enhance reports with selection criteria that are not included in the standard selection screen of logical database PNP. They are also used to improve the performance of reports and queries. For more information on the distinction between the two, see the notes under Integration.
Динамические выборки позволяют расширять количество параметров для поиска как в стандартных ABAP-отчетах, так и в _Z_*. Стоит обратить внимание на то, что речь идет про отчеты, созданные на базе ЛБД PNPCE или PCH.
См. Logical Databases

Единожды созданный вариант динамической выборки может быть применен к различным ABAP-отчетам и оперативным запросам, которые вы используете в повседневной работе.
Вендор также обращает наше внимание на улучшение производительности отчетов в которых применяются динамические выборки.

См. Dynamic Selections

Performance is improved when queries are executed because dynamic selections often ensure that the database is accessed more effectively than when selection fields are added to standard selection fields when the query is defined.

Как создать вариант динамической выборки?

1. Selection View

См. Create Dynamic Selections
С помощью транзакции SE80 перейдите на закладку More..., активируйте опцию Selection View и нажмите на кнопку Create

Рисунок 1.

В открывшемся окне активируйте опцию For any tablesи придумайте наименование создаваемого ракурса (Name of View)

Рисунок 2.

Введите наименование таблиц(ы) поля которой будут выступать в качестве новых параметров поиска

Рисунок 3.

Определите функциональные группы и присвойте им поля таблицы

Рисунок 4.

См. Create Dynamic Selections

  • In the Functional groups group box, enter a number and name for the functional group (for example, 01 and Dynamic Selections ).

  • You can group your dynamic selections together in a functional group, or you can group them together by infotype. If you choose the latter option, dynamic selections are sorted by infotype when queries are executed.

  • In the Tables/Nodes group box, select an infotype for processing by double clicking on it.

  • In the Table fields/Node fields group box, enter the number of the functional group or groups in the input fields displayed in front of the fields you want to use as dynamic selections (for example, 01).

  • If you want a field to be immediately available as a dynamic selection when a query is executed, select its Preselection checkbox.

    If fields are not included in the preselection, you can use them as dynamic selections as required.

Вариант динамической выборки создан.

2. Create Report Categories

См. Report Category
Выполните настройку, находящуюся по следующему пути в SPRO:

IMG: Personnel Management -> Human Resources Information System -> Create Report Categories

Рисунок 5.

Активируйте, или деактивируйте доступные опции настройки, которые необходимы вашей категории отчетов. Для блока Selection View for Dynamic Selections выберите TYPE = CUS, NAME = наименование ракурса просмотра ( См. пункт # 1. Selection View ).Для своего примера я деактивировал поиск по организационной структуре и ограничил выбор дат для периода анализа

Рисунок 6.

N.B. Обратите внимание на то, что идентификатор пользовательской категории отчета должен начинаться с цифры.

3. Assign Report Categories

Выполните настройку, находящуюся по следующему пути в SPRO:

IMG: Personnel Management -> Human Resources Information System -> Assign Report Categories

Рисунок 7.

Присвойте созданную категорию отчета (см. пункт #2. Create Report Categories) ABAP-отчету, которому необходимо добавить количество параметров.

Рисунок 8.

4. Как протестировать выполненные изменения?

В пункте #3. Assign Report Categories я присвоил новую категорию отчетов программе RPCEDTU0_CE. Прежде чем искать изменения, предлагаю посмотреть, как же выглядит селекционный экран программы до присвоения ей созданной мной новой категории отчета

Рисунок 9.

А теперь после присвоения

Рисунок 10.

Обратите внимание на появившуюся кнопку 

Чтобы убедиться, что настройки категории отчетов влияют на доступность различных фильтров, я поменяю настройки доступности поиска по организационной структуре, и выполню запуск программы еще раз

5. Присвоение категорий отчетов Z* программам

Разрабатываемым программам вы также можете присваивать пользовательские категории отчетов. Выполнить такое присвоение можно не выходя из транзакции SE38

Рисунок 11.

Например, выполним поиск по таблице PA0006, используя две выборки

При первом запуске - было найдено 3589 записей, при втором запуске, с применением варианта динамической выборки - 1282 записи.

6. Присвоение варианта динамической выборки оперативным запросам

Присвоить вариант динамической выборки можно также инфо-набору на основании которого будет сформирован оперативный запрос.

См. заметку Оперативный запрос

См. заметку Оперативный запрос. Пользовательские поля

См. заметку Как убрать дублирование записей в оперативном запросе?

Добавьте в инфо-набор следующий код

Рисунок 12.

На следующем видеофрагменте представлен пример внесения корректировок в инфо-набор

Описание всех возможных переключателей для оперативных запросов см. в SAP Note 305118 - Eliminating various query problems in HR

REPORT_CLASS

Description

The report class concept, which enables you to determine the structure of the selection screen, applies to logical
databases PNP and PNPCE. A report class can be assigned to each report that is based on one of these two logical
databases. To maintain report classes in Customizing, choose Personnel Management -> Human Resources Information
System -> Reporting -> Adjusting the Standard Selection Screen -> Create Report Categories. Each query is a
generated report, which means that report classes can also be assigned for queries. A default report class is assigned in
the standard system. The REPORT_CLASS switch can be used to specify a report class explicitly.

Standard system conduct

If the InfoSet is based on logical database PNP, report class ___X2001 is used. If this report class does not exist,
report class ___22002 is used instead. If the InfoSet is based on logical database PNPCE, report class QUEPNPCE
is used.

Values

SAP and customer-specific report classes can be used. PNP and PNPCE use different report classes, which means you
must ensure that the specified report class was created for the logical database used in the InfoSet.

Note

Report classes are only supported by logical databases PNP and PNPCE. The switch cannot be used for InfoSets based
on any other logical database.

Ad Hoc Query does not use the logical database selection screen to define selection conditions. Specifying a report class
in Ad Hoc Query does not, therefore, have any recognizable effect.

Example
*$HR$ [COMMON]
*$HR$ REPORT_CLASS = '0MYREPCL'

Надеюсь, что это было полезно. А вы просто восхитительны!

Read more