SAP Function SDOK_LOIOS_PHIOS_GET - Extended Context Resolution (Selection of Physical Documents)

Parameter Reference Type Length Default Optional Text
CLIENT SYST-MANDT C 3 SY-MANDT X Client
X_CALL_FILTER_EXITS SYST-DATAR C 1 SPACE X Call Exit Functions for Filtering Yes/No
X_ONLY_RELEVANT SYST-DATAR C 1 SPACE X Only Take into Account Attributes Modeled as Context-Relevant Yes/No
X_REDUCE_TO_ONE SYST-DATAR C 1 SPACE X Reduce to One PHIO for Every LOIO Yes/No
X_REQ_ALL_PROPERTIES SYST-DATAR C 1 SPACE X Request All Attributes Yes/No

Parameter Reference Length Optional Text
BAD_OBJECTS SDOKERRMSG 268 X Logical Object Without Suitable Physical Object
BAD_SELECTORS SDOKCXASEL 160 X Invalid Attribute Selectors
CONTEXT SDOKPROPTY 89 X Context Description
OBJECT_LIST SDOKOBJECT 42 List of Logical Information Objects
PHYSICAL_OBJECTS SDOKLOGPHY 84 Physical Information Objects for the Logical Information Objects
PROPERTIES_REQUEST SDOKPROPTN 25 X Attribute Request List
PROPERTIES_RESULT SDOKPROPTL 131 X Attribute Results List
SELECTORS SDOKCXSEL 164 X Selectors

Functionality
Context resolution is carried out for all logical documents containedin the table OBJECT_LIST. Context resolution is based on the contextselectors specified in the table SELECTORS. The selection process goesthrough the following stages, in this order:
(1),,PHIO class selectors are used to filter the PHIO classes (thisonly applies to classes that are specified in the KPro modeling layer).
(2),,Generic PHIO selectors are used to filter the remaining PHIOs.
(3),,Lastly, the remaining PHIOs are filtered per LOIO according toper-LOIO selectors, priorities, exit functions, modification date.
Steps (1) and (2) are analogous and are explained below under #GeneralObject Filtering#. In both these steps, an input set of objects isdefined, and the context resolution process reduces this input set toan output set. The output set contains the objects that are returned asa result of the context resolution process.
The input set for step (1) is the set of PHIO classes that areassociated (by means of the relation class LOGOBJECT) with at least oneof the specified LOIO classes. The PHIOs contained in the LOIOs arethen determined from the classes returned as a result of step (1).These PHIOs are in turn the input set for step (2). The output set ofstep (2) is the set of PHIOs contained in the LOIOs. In step (3), thePHIOs belonging to each LOIO are sorted in order of their properties,and the lower-ranking PHIOs are eliminated.
A class-based selection process analogous to that in step (3) is notpossible.

Structure of Context Selectors
Context selectors have a similar structure to SELECT_OPTIONS, with thedifference that context selectors have a selector type ("PHIO class","PHIO") and an attribute. They may also have a priority (see below).The prefix I indicates inclusion, while E indicates exclusion. Besidesthe usual relational operators EQ, NE, CP, BT, and so on, contextselectors also have the operators EX (existence) and NX(non-existence). EX gets any value (similarly to CP * for charactertypes), while NX gets no value. The filtering process in step (3) alsohas the additional operators MA (maximum) and MI (minimum).
When the relational operators are evaluated, the attribute types arewhat are taken in account, so that, for example, '10' GT '2' is nottrue for the type "character string", but is true for the type"integer". (Attribute types are defined in the reference table fields.)

General Object Filtering
The selectors relevant for the filtering process in steps (1) and (2)are linked via the #and# operator. This has the effect that an objectis visible in a context if it is visible to every attribute in therelevant context.
An object is visible to the context attribute A if the followingconditions are fulfilled:

  • Inclusive:

  • Either the context does not contain any inclusive selectors for A,apart from, at most, those with operator MA or MI, or at least one Aproperty fulfils at least one inclusive selector for A, where selectorswith operator MA oder MI can be filled by any property, or
    The context contains one inclusive NX selector for A and the object hasno A properties.
    • Exclusive:

    • No exclusive selectors for A are filled by A properties.
      The context contains no inclusive NX selectors for A, or the object hasno A properties.
      Note that an MA or an MI selector can only have an inclusive effect ifinclusive selectors with other operators (such as EX) can excludeobjects without suitable properties.

      Per-LOIO Filtering
      The number of PHIOs per LOIO can be reduced by means of the extremaloperators MA and MI, and by assigning priority values to selectors. Thelower the priority value of a selector, the higher its priority. Inother words, a selector with priority value "1" has the highestpriority value. Extremal operators and priorities can be used onlywith the selector type "PHIO" and the prefix I. Extremal operators andpriorities can be used in combination with each other. Their use in thecontext of LOIOs is that more than one PHIO is visible after filteringsteps (1) and (2).

      • A PHIO fills an MA-/ MI selector for attribute A if all visible PHIOs
      • belonging to the LOIO in question have the maximum / minimum value forA. (If none of the PHIOs of a particular LOIO have a value for thisattribute, the selector is irrelevant for that LOIO. If, however, aminimum of one PHIO has a value for this attribute, all PHIOs that donot have this attribute become invisible, unless the PHIO has an NXselector.)
        • A PHIO remains visible if one of the PHIOs belonging to the LOIO in
        • question has the minimum priority value. For every property, thepriority value is the minimum priority value of the context selectorsthat fulfil this property.
          After the selector-based filtering has taken place, the class-dependentexit functions for application-specific per-LOIO filtering may becalled. To deactivate this option, do not set the flagX_CALL_FILTER_EXITS. The exit interface is documented in the functionsource text.
          If the flag X_REDUCE_TO_ONE is set, this means that the final filteringstep consists of selecting the PHIO with the most recent modificationdate from the LOIOs that still contain more than one PHIO.

          Additional Parameters
          A list of additional attributes can be specified in PROPERTIES_REQUEST.These additional attributes are determined for the visible PHIOs (inaddition to the context attributes) and are output inPROPERTIES_RESULT. (If X_REQ_ALL_PROPERTIES is set, all attributes aredetermined.)
          If the flag X_ONLY_RELEVANT is set, step (2) filtering is restricted toevery PHIO of the context attributes that are modeled as"context-relevant" for each PHIO's class. (This restriction does notapply to any step (3) filtering that may be taking place.) In this way,the behavior of different PHIO classes during context resolution can beclearly differentiated in the model.
          The function takes the parameter CONTEXT into account only if theattributes in the parameter are not already in the existing list ofadditional attributes. The parameter CONTEXT can also be used totransfer to the exit filter functions special information in the formof attribute-value pairs. (The attributes do not need to be modeled inthis case.) The term "context" has arisen historically. The actualcontext is specified in the table SELECTORS.

          Example
          Extremal selectors and priorities can be used to express complex rulesfor PHIO selection. Let us assume that the following two rules havebeen set:
          (1) Language must be 'D', 'E' or 'F' (in order of preference).
          (2) The latest version is required.
          If (1) is more important than (2), the following selectors can bechosen (prefix / operator / relational value / priority value):
          Language: (I / EQ / 'D' / 100) , (I / EQ / 'E' / 200) , (I / EQ /'F' / 300). Version: (I / MA / / 10) , (I / EX / / 20).
          The result is the required order: 'D' / new < 'D' / old < 'E' / new< 'E' / old < 'F' / new < 'F' / old.
          (Priority values: 110 < 120 < 210 < 220 < 310 < 320.)
          If (2) is more important than (1), the version selectors must beassigned a higher rank:
          Language: (I / EQ / 'D' / 10) , (I / EQ / 'E' / 20) , (I / EQ /'F' / 30). Version: (I / MA / / 100) , (I / EX / / 200).
          The result is the required order: 'D' / new < 'E' / old < 'F' / new< 'D' / old < 'E' / old < 'F' / old.
          (Priority values: 110 < 120 < 130 < 210 < 220 < 230.)
          The EX selector assigns a lower priority to the MA selector. The EXselector sets the value of "maximality" in relation to"non-maximality". Without the EX selector, PHIOs with a non-maximalvalue would be hidden (which may in some cases be required, but not inthis example). In particular, it can happen that when MA selectors areused for multiple attributes (for example, version maximum and releasemaximum), LOIOs become "empty", if a priority value has not also beenset for non-maximality.
          This type of ranking of context attributes can also be used for morethan two attributes. The priority values should be selected as follows:
          ..... Attribute...........,,.....,,Selector................,,.....,,Priorityvalue.....
          Most important,,,,Worst,,,,Highest
          Most important,,,,..........,,,,..........
          Most important,,,,Best,,,,..........
          ..........,,,,..........,,,,..........
          Most important,,,,Worst,,,,..........
          Most important,,,,..........,,,,..........
          Most important,,,,Best,,,,Lowest,,
          Here are two more examples of combining normal and extremal selectors:

          • Relative extremes can be determined. The newest release below 46C#is
          • specified using, for example, the following selectors: (E / GT / '46C'/ ) , (I / MA / / ).
            • If, however, the newest release is required, but it is not known
            • whether or not at least one PHIO per LOIO has a release attribute, thefollowing can be specified:
              (I / MA / / 10 ) , (I / NX / / 20).
              Based on how MA is interpreted, all PHIOs (with and without release)remain after step (2). The number of PHIOs is not reduced according torelease properties until step (3).

              Notes

              • All attributes can be used for context resolution. However, note that
              • the amount of processing power required at runtime depends on theattribute type (horizontal, vertical, per-LOIO, dynamic). Horizontalattributes produce the best performance.
                • Whether or not a context attribute is assigned to a PHIO class has no
                • effect on context resolution. To include PHIOs that, for example,cannot fulfil an inclusive EQ selector for A because their classes donot have A, extend an inclusive NX selector for A. (For example, asearch for objects that either have language "D" or no language).
                  • The function minimizes the number of SELECTs. This has the effect that,
                  • if the context and the list of additional properties both containvertical attributes, all vertical properties are read into a singleSELECT. This goes for all PHIOs that are remaining after being filteredaccording to horizontal attributes. If the expected data volume and theexpected remaining number of PHIOs after filtering are high, it may bebetter to separately request the vertical additional properties for thePHIO results set.
                    • It is no longer possible to call for a second time the
                    • application-specific exit filter functions if the PHIO set for a LOIOis empty. Instead, all potential PHIO candidates should be selectedfrom the beginning using an appropriately chosen context. An exitfunction should on no account call SDOK_LOIOS_PHIOS_GET again. The sel
                      ector concept allows the "best"PHIO per LOIO to be selected andspecified efficiently. Exit functions should only be used is selectorsdo not suffice, and even then should only reduce the PHIO sets.

                      Testing Context Resolution
                      Context resolution tests are supported by the following special formatfor entries in the table CONTEXT:
                      NAME = #n or NAME = #n|p;VALUE = t
                      t is the name of a LOIO header table (default is IWB1LOIO); n is themaximum number of LOIOs that can be selected from the table; and p is atemplate for LOIO GUIDs. There can be multiple entries of this type. Inthis way, OBJECT_LIST can be filled with a more or less randomselection of LOIOs.