Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Evaluation Path : How to create and use

$
0
0

The objective of this document to give practical scenarios on how Evaluation Paths can be created and used in our applications. It also helps in understanding how the Evaluation Path fetches data from the backend so that we can use Evaluation paths effectively in our applications.

 

Evaluation path is an instruction to the system to fetch the data recursively, according to the relationship between the objects.

One or more relationships may be used in an evaluation path.


Creating Custom EVALUATION PATH:

We can create evaluation paths with alphanumeric names with a maximum of 8 characters starting with Z.

We will create an Evaluation Path below which will be used to find Org. Unit of a person based on USER ID which is given as an input.(US -> P -> S -> O)

 

STEP 1: Go to T. Code SM30/SM31.

STEP 2: Enter Table name as T778a and Click on Maintain.

Image 1.png

STEP 3: Click on New Entries.

Image2.png

STEP 4: Enter the name of EvalPath and the Evaluation Path Text.
               Then Click on Save.

Image3.png

STEP 5: Now enter appropriate Relationships based on which you want to fetch the Data.

Image4.png

STEP 6: There is a Field Skip which has a Checkbox which should not be ticked if you want the Output of that Relationship to be Included in the Final Result.

Image5.png

e.g: in the above scenario Output from all the Relationships will be Included in the Final Result.

However, in the Scenario below, only the Output from Relationship “Belongs to” will be included in the Final Result.

Image6.png

STEP 7: Finally Save the Evaluation Path.

 

 

Display Evaluation Path:

 

STEP1: Go to T. Code SM30/SM31.

STEP 2: Enter Table name as T778a and Click on Display.

STEP 3: Click on the Position Button at the Bottom of the Screen and enter the name of Evaluation Path which you want to Display. Then Press OK.

image7.png

STEP 4: Select the Evaluation Path you want to Display and Click on the Evaluation Path

Image8.png

STEP 5: Details of the Evaluation Path will be displayed.

Image9.png

Note: We can also Create/Display Evaluation Path using Transaction Code OOAW.

            It will take directly to Step 3.

 

How to execute Evaluation Path:

We will execute the Evaluation path created above using the Function Module "RH_STRUC_GET":

 

DETAILS OF THE EMPLOYEE WHICH IS TAKEN AS EXAMPLE

Personnel No. 20001848

US(User ID)    RAIN

Position         40004241

Org. Unit        30001028

 

Example 1: When few Relationships/Lines have the "SKIP" column checked:

  Image10.png

STEP 1: Go to T. Code SE37. Give the Function Module as RH_STRUC_GET and Execute.

STEP 2: Fill in the Required Entry Fields and press Execute

Image11.png

 

STEP 3: Results will be displayed.

   We get the Result in 3 tables as follows:

Image12.png

RESULT_TAB
Result_tab1.png

RESULT_OBJEC

Result_objec1.png

RESULT_STRUC

Result_struc1.png

 

Steps to dry run Evaluation path yourself:

1). We provide the US as RAIN.

2). US is used to Calculate Pernr 20001848.

3). US (RAIN) goes into the Stack.

            Pernr 20001848 becomes current Object.

Pernr 20001848 is used to calculate Position 40004241

4). Pernr 20001848 goes into the Stack.

Position 40004241 becomes current Object.

Position 40004241 is used to search Org. Unit 30001028.

5). Position 40004241 goes into the Stack.

            Org. Unit 30001028 becomes current Object.

No more lines left for Org. Unit 30001028 to execute.

6). Control goes back to the Position 40004241.

No more lines left for Position 40004241to execute.

7). Control goes back to the Pernr 20001848.

            No more lines left for Pernr 20001848 execute.

8). Control goes back to the US (RAIN).

            No more lines left for US (RAIN) execute.

9). Execution of Evaluation path ends.

 

 

Current Object

Relationship Used

Resulting Object

Result

Current Stack

US -> RAIN

(LEVEL 1)

10:   US  A208  P

P ->  20001848

(LEVEL 2)

    --------------

 

  1. US -> RAIN

P -> 20001848

(LEVEL 2)

10:   US  A208  P

 

20:   P     B008  S

        NA

 

S ->  40004241

(LEVEL 3)

 

     --------------

 

 

  1. P -> 20001848
  2. US -> RAIN

 

 

S -> 40004241

(LEVEL 3)

10:   US  A208  P

 

20:   P     B008  S

 

30:   S     A003  O

        NA

 

        NA

 

O -> 30001028

(LEVEL 4)

 

 

     --------------

 

 

 

  1. S ->  40004241
  2. P -> 20001848
  3. US -> RAIN

 

 

O -> 30001028

(LEVEL 4)

10:   US  A208  P

 

20:   P     B008  S

 

30:   S     A003  O

        NA

 

        NA

 

        NA

 

 

O -> 30001028

 

 

  1. S ->  40004241
  2. P -> 20001848
  3. US -> RAIN

 

S ->  40004241

(LEVEL 3)

 

Nothing Left

 

        NA

 

O  ->  30001028

 

  1. P -> 20001848
  2. US -> RAIN
  3. P -> 20001848

P -> 20001848

(LEVEL 2)

30:   S     A003  O

        NA

O -> 30001028

 

  1. US -> RAIN

 

US -> RAIN

(LEVEL 1)

20:   P     B008  S

 

30:   S     A003  O

        NA

 

        NA

 

O -> 30001028

 

-----------------------

*Levels mentioned above are the values which we will get in the column "Level" in the result table "RESULT_STRUC"

 

Example 2:When none of the Relationships/Lines have "SKIP" column checked:

Image13.png

 

RESULTS will be as below:

result2.png

RESULT_TAB:

Result_tab2.png

RESULT_OBJEC:

Result_objec2.png

RESULT_STRUC

Result_struc2.png

Steps to dry run Evaluation path yourself:

1). We provide the US as RAIN.

2). US is used to Calculate Pernr 20001848.

            Pernr 20001848 is appended to Results.

3). US (RAIN) goes into the Stack.

            Pernr 20001848 becomes current Object.

Pernr 20001848 is used to calculate Position 40004241

Position 40004241 is appended to Results.

4). Pernr 20001848 goes into the Stack.

Position 40004241 becomes current Object.

Position 40004241 is used to search Org. Unit 30001028.

            Org. Unit 30001028 is appended to Results.

5). Position 40004241 goes into the Stack.

            Org. Unit 30001028 becomes current Object.

No more lines left for Org. Unit 30001028 to execute.

6). Control goes back to the Position 40004241.

No more lines left for Position 40004241to execute.

7). Control goes back to the Pernr 20001848.

            No more lines left for Pernr 20001848 execute.

8). Control goes back to the US (RAIN).

            No more lines left for US (RAIN) execute.

9). Execution of Evaluation path ends.

 

 

Current Object

Relationship Used

Resulting Object

Result

Current Stack

US  RAIN

(LEVEL 1)

10:   US  A208  P

  1. P ->  20001848

(LEVEL 2)

P -> 20001848

 

  1. US -> RAIN

 

P -> 20001848

(LEVEL 2)

10:   US  A208  P

 

20:   P     B008  S

        NA

 

S ->  40004241

(LEVEL 3)

 

S ->  40004241 

P ->  20001848

 

 

  1. P -> 20001848
  2. US -> RAIN

 

 

S  -> 40004241

(LEVEL 3)

10:   US  A208  P

 

20:   P     B008  S

 

30:   S     A003  O

        NA

 

        NA

 

O -> 30001028

(LEVEL 4)

 

 

O -> 30001028 

S ->  40004241 

P ->  20001848

 

 

 

  1. S ->  40004241
  2. P -> 20001848
  3. US -> RAIN

 

 

O -> 30001028

(LEVEL 4)

10:   US  A208  P

 

20:   P     B008  S

 

30:   S     A003  O

        NA

 

        NA

 

        NA

 

 

  1. O -> 30001028 
  2. S   40004241 
  3. P ->  20001848

 

 

  1. S ->  40004241
  2. P -> 20001848
  3. US -> RAIN

 

S ->  40004241

(LEVEL 3)

 

Nothing Left

 

        NA

 

O -> 30001028 

S ->  40004241 

P ->  20001848

 

  1. P -> 20001848
  2. US -> RAIN
  3. P -> 20001848

P  -> 20001848

(LEVEL 2)

30:   S     A003  O

        NA

O -> 30001028 

S ->  40004241 

P ->  20001848

 

  1. US -> RAIN

 

US -> RAIN

(LEVEL 1)

20:   P     B008  S

 

30:   S     A003  O

        NA

 

        NA

 

O -> 30001028 

S ->  40004241 

P ->  20001848

 

-----------------------

 

NOTE:-  We can give any Object as Input which is specified in Obj. Type in the Evaluation Path.

In that scenario the Relationships which are Relevant to that Object will be Executed first.

 

 

EXECUTE EVALUATION PATH USING T-CODE PPST:

 

We have a sample Evaluation Path: CACS_GP.

We have a sample Org. Structure:

img1.png

 

We will try fetching the records using evaluation path "CACS_GP":

eval1.png

This Evaluation path will return only Org. Units and Position as the above Org. Structure doesnot contains object "S" and "BP".

 

To execute go to T-Code PPST:

Tcode1.png

 

We can execute and get the Results as below:

tcode2.png

 

We can also alter Display Depth (Default is Zero) and execute the Evaluation Path recursively upto the desired level.

  1. When we specify the Display Depth as ‘1’ then we get the below output:

            depth1.png

B.   When we specify the Display Depth as ‘2’ then we get the below output:

            depth2.png

C.   When we specify the Display Depth as ‘3’ then we get the below output:

           depth3.png

Note:Evaluation paths can be tested and analyzed using the report RHSTRU00.

 

Note: For evaluating Evaluation Path there are few Function Modules in the Function Group: "RH_STRUCTURE_GET".

          Functions modules in this Function Group:

          a) HR_STRUCTURE_GET

          b) RH_STRUC_GET

          c)  RH_STRUC_GET_MULTIPLE_ROOTS

          d) RH_STRUC_SEARCH

     Another important function group is "HRWPC_TO_DATA_SUPPLIER".


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>