Query In PCR

Dear All,
                 There is rule written for settlment for person who r dead during service.For that calculation we need to get age of the emp.
The rule which is written is taking the age ,the command which was written to take that age
             RTE = FG M
this returns his age in months( for eg if his age is 40 , it will return to rte = 40 * 12)
I want not able understand this command , how it is operating ,whether it is calling any function.
Please help me .
Regards,
prince Elvis
Edited by: PRINCE  ELVIS VINOLTON on Oct 6, 2008 7:03 PM

Dear prince,
Please share with all of us, how were you able to solve the issue. it would be really helpful.

Similar Messages

  • Query Hire date in a PCR

    Hi,
    Could you help me in querrying hire date in a PCR.
    I need to differentiate b/w EEs who joined from 1st-15th of a month to the ones who joined in the later part of the month.
    Any help is highly appreciated.

    Hi,
    what about this quick idea - use VARSTREDAY in PCR rule and make 01, 02, . . . .31 as a result from query. Continue with wtriting the rows and choose some time type. Store the value 1 into the time type. Then put a HRS query with the chosen time type before the VARST - it will prevent the rule to check itself over again. Store the time type into SALDO. If you generate qoutas according to some time types, then the time type can also be stored in the PCR rule with Varst. Then you need to solve roll-over if the qouta needs to be generated the next year.
    ex.
    HRS=BZZZ1
    HRS?1
    = nothing
    VARSTREDAY
    01 HRS=1
    01 ADDDBZZZ1
    01 HRS=1
    01 ADDDBQBAS (time type for qouta base)
    It is not some smooth solution but it should work.
    Cheers
    xDracula

  • How to Query Internal tables in PCR

    Hi Experts,
    When I tried by using operation u201CVAKEYu201D to query the Internal tables, but it was not working
    I would like to write one PCR in the Indian Payroll
    Please can anyone help me on the same?
    The requirement as below;
    u201CIf the DDNTK table filled with amount (Assume that DDNTK table may contains more than one WT)u201D
    u201CAdd this total amount (with same sign) to WT /110 net deductionsu201D
    Thanks in Advance!
    Thanks and Regards
    Cheera

    I have never worked with Indian Payroll and I am not aware of a function or operation that allows to check on table DDNTK,
    but you could check PCR XDPR and function PRDNT.

  • Query Custom Infotype from a PCR

    Hi,
    Can we query a percentage stored in custom infotype from a PCR ? If yes, can you please explain how ?
    Appreciate if anyone could please help.
    Thanks,

    Hi,
    Create a custom function to do that.
    1. Go to t-code PE04, input function name and create
    2. Define country assignment and input/output parameters, if your function need access parameter(e.g function with PCR, p0014 xxxx), also define parameter list and values.
    3. Save and activate your function.
    4. Check the payroll driver again and will tell you form FU_XXXX  is missing, then create a include program with form FU_XXXX and implement your function logic.
    5. In payroll driver, find the proper location(customer function operation include) to include your program logic.
    Good luck,
    Chen Jian

  • How to query an attendance subtype in a PCR

    Hello experts,
    i have this rule where i want to specify an attendance subtype to be added to table ZL. I did the below PCR but when i run the time evaluation all attendance types are added to ZL table. In my scenario i need attendance subtype 9003 only to be counted.
    These are the operations i used:
             D VARPRDAY
              HRS=1,00 ADDZL 2011
    N
    Y      D VARSTP2002
    Y N
    Y Y     OUTTPRTYP   HRS=1,00   ADDZL 2011
    Any help please.

    Try using a decision on the Presence Type (or attendence type) instead, as in:
             D VARPRTYP
    9003   HRS=1,00 ADDZL 2011
    Only Attendance 9003 will populate WT 2011 with number 1

  • Query leaving action to make wage type amount zero

    000010            D OUTWPMASSN
    000020 H6
    000030 N            ADDWT *
    000040 Y            AMT=1085  RTE=0      MULTI ARAADDWT *
    I am querying my action type H6 and H7 leaving action in PCR ZCC.  PIT ZCCC    NOAB.  When i am running payroll it is giving error no rule in PCR ZCCC for ****1085 where 1085 is my wage type for which i am writing this rule so that in leavaing action amount should become zero.   Can u please guide where to correc tule.  Also i want to add one more action type H7 in this rule.

    Hi all
    System is splitting the last period into two wpbp splits.  One split is for period employee was with company and second split is for unemployment period during the leaving month.  So whenever we write a rule or query it, then the rule is applied with ** once and leving action second time.  So two different splits are there and both conditions are taken by system.  so for the part of month in which leaving action has taken place like 15 to 30th then the amount is becoming zero but for the first part the system is taking ** value which is addwt *, so that amount is not beingmade zero.  how can i make the period for first half as zero.

  • Issue :- Payroll PCR related to DOJ

    I have written a PCR in Payroll which is Given below :-
    Now the issue is i want wage type to be calculated exactly after 20 years which is  happening  EX: - Employee DOJ 01.01.1994 so the wage type is being paid on 01.01.2014 But the problem is it is being paid in the month of Feb 2014 also kindly let me know how to write the logic Calling F* operation in the PCR.
    Zulfikarlos

    From your query, I must assume that you are referring to Monthly Payroll Periods.
    Since you are using operation NUM=F01YB, it will be calculating "Time since" based on Date Type 01 of IT0041, in "Complete Years", and as of the start of the WPBP.
    If you were to change the operation NUM=F01Y , it would be calculating as of the end of the end of the current Payroll Period, and should generate the payment in the month of Hire (except perhaps if the employee was hired on the last day of a month).  One problem with this is that the system will probably give the same return value for 12 months in a row.  After testing and confirming this, you may want to use unit C or K (months) instead of Y (years) and compare the return value to 240.
    I also noticed that you use operation ADDWT&YEXP and NUM=& YEXP within the same PCR, with no changes to the value of NUM in between.  If you don't require the temporary variable elsewhere, these 2 operations would not be required.
    Last but not least, I would suggest that you test the scenario where the employee has a WPBP split on WT 1010 in the month where he/she reaches 12 Years (or 240 months).  You'll probably notice that the AMT of WT 2140 contains double the amounts from WTs 1020 to 1100.  If that is the case, you may want to add a query on the existence of the YEXP temporary variable that would be created only for the first instance of WT 1010.

  • Query on OT Calculation

    Our customer wishes the overtime hours to be computed in the following manner:
    1. Accumulate all the approved extra hours worked by the employee during the calendar month.
    2. Accumulate all the LOP hours for the employee for the calendar month.
    3. Compute A = (Extra hours - LOP hours) for the employee at the end of the calendar month.
    4. If A is positive, take A as OT hours for the month; If A is negative, take A as LOP hours for the month; If A is zero, do nothing
    Each time the employee goes on LOP or works extra hours, it is rounded off to the nearest 30 mins (e.g. LOP or extra hours of 75 mins or above but less than 90 mins will be treated as 90 mins ).
    5. Once the OT hrs are determined in the above manner, apply the OT rate to rate and compute the OT amount.
    My query is as below:
    How do we handle this requirement in SAP? Should it be done thru Time Evaluation in TM Schema or through Payroll Run in Payroll schema? I request our experts to help me
    -Shambvi

    Hi
    See a the standared Schema TM00 will not going to handle this. So you need to make it Z and then you need to do the some PCR config to achiev this,
    1. You have to maintain the employee Attendance in IT2011 on daily basis.
    2. Schema TM00 will take care of the abcentees as the record is not maintained in IT2011 for the day.
    3. To get those LOP Hrs you need to create one PCR for that.
    4. For getting the extra hrs for OT you need to config the time WT.
    5. To capture the OT hrs you need to config your OT WT in table V_T510S where M stands for OT.
    Best of Luck.
    Or else
    You can configure the Comp. off quota and through that u can resolve your issue..
    Regards
    Swapnil
    Edited by: Swapnil1983 on Oct 5, 2011 11:43 AM

  • Query Explain Plan Help

    I am running the following query against my database
    SELECT p.ID
      FROM rap_counterparties cou,
           rap_presentation_cou_ratings pcr,
           rap_presentation_states sta,
           rap_app_user_profiles aup,
           rap_presentations p
    WHERE cou.unt_id = aup.unt_id
       AND aup.aur_id = 7529
       AND pcr.cou_id = cou.ID
       AND sta.cur_present_state_instance_flg = 'Y'
       AND sta.state_type_id = pcr.pst_state_type_id
       AND sta.pre_id = pcr.pst_pre_id
       AND sta.state_type_id IN (326, 322, 323, 324, 325)
       AND cou.unt_id = p.unt_id
       AND p.ID = sta.pre_id
       AND (   p.private_flg != 'Y'
            OR (p.private_flg = 'Y' AND p.created_by_user_id = 10000083)
    Explain plan of the query is
    PLAN_TABLE_OUTPUT
    | Id  | Operation                        |  Name                  | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT                 |                        |     8 |   456 |  3936  (16)|
    |*  1 |  TABLE ACCESS BY INDEX ROWID     | RAP_PRESENTATIONS      |     1 |    15 |     2  (50)|
    |   2 |   NESTED LOOPS                   |                        |     8 |   456 |  3936  (16)|
    |*  3 |    HASH JOIN                     |                        |  1745 | 73290 |  2145  (27)|
    |*  4 |     HASH JOIN                    |                        | 14257 |   431K|  1299  (25)|
    |*  5 |      HASH JOIN                   |                        |  5173 | 87941 |   583  (16)|
    |   6 |       TABLE ACCESS BY INDEX ROWID| RAP_APP_USER_PROFILES  |    18 |   144 |     3  (34)|
    |*  7 |        INDEX RANGE SCAN          | RAP_AUP_IX_01          |    18 |       |     2  (50)|
    |   8 |       TABLE ACCESS FULL          | RAP_COUNTERPARTIES     |   118K|  1042K|   560  (13)|
    |*  9 |      INDEX FAST FULL SCAN        | RAP_PCR_PK             |   326K|  4467K|   659  (25)|
    |* 10 |     INDEX FAST FULL SCAN         | RAP_PST_IX_02          |   120K|  1291K|   821  (29)|
    |* 11 |    INDEX RANGE SCAN              | RAP_PRE_PK             |     1 |       |            |
    Predicate Information (identified by operation id):
       1 - filter(("P"."PRIVATE_FLG"<>'Y' OR "P"."CREATED_BY_USER_ID"=10000083 AND
                  "P"."PRIVATE_FLG"='Y') AND "COU"."UNT_ID"="P"."UNT_ID")
       3 - access("STA"."STATE_TYPE_ID"="PCR"."PST_STATE_TYPE_ID" AND
                  "STA"."PRE_ID"="PCR"."PST_PRE_ID")
       4 - access("PCR"."COU_ID"="COU"."ID")
       5 - access("COU"."UNT_ID"="AUP"."UNT_ID")
       7 - access("AUP"."AUR_ID"=7529)
       9 - filter("PCR"."PST_STATE_TYPE_ID"=322 OR "PCR"."PST_STATE_TYPE_ID"=323 OR
                  "PCR"."PST_STATE_TYPE_ID"=324 OR "PCR"."PST_STATE_TYPE_ID"=325 OR "PCR"."PST_STATE_TYPE_ID"=326)
      10 - filter("STA"."CUR_PRESENT_STATE_INSTANCE_FLG"='Y' AND ("STA"."STATE_TYPE_ID"=322 OR
                  "STA"."STATE_TYPE_ID"=323 OR "STA"."STATE_TYPE_ID"=324 OR "STA"."STATE_TYPE_ID"=325 OR
                  "STA"."STATE_TYPE_ID"=326))
      11 - access("P"."ID"="STA"."PRE_ID")
    Table Row count
    rap_app_user_profiles : 30639
    rap_counterparties : 118583
    rap_presentation_cou_ratings -- 652781
    rap_presentation_states -- 982413
    rap_presentations -- 246145
    Questions
    1. Why is the index not being used on the table rap_counterparties. If I force a hint then the index is being used
    2. Is there a way I can have an index range scan as opposed to the index fast full scan.
    3. This query runs in 3s. Is there anything else I can do to tune this query?
    4. In predicate 9 and 10 the two tables have fast full scan. If the filter of unit generates only a few records why can't those few records be joined with these tables. Why the whole tables are first being scanned and then joined
    Appreciate your response

    Thanks for the suggestions.
    So I tried using the FIRST_ROW HINT and i am getting the nested loops join and it runs fast in 250ms.
    SELECT /*+FIRST_ROWS*/
           p.ID ID
      FROM rap_presentations p,
           rap_counterparties cou,
           rap_presentation_states sta,
           rap_presentation_cou_ratings pcr
    WHERE cou.unt_id IN (
               SELECT prof.unt_id
                 FROM rap_application_users u, rap_app_user_profiles prof
                WHERE u.ID = prof.aur_id AND u.ID = 7529
                      AND prof.aro_id NOT IN (8))
       AND cou.unt_id = p.unt_id
       AND p.ID = sta.pre_id
       AND sta.cur_present_state_instance_flg = 'Y'
       AND sta.state_type_id = pcr.pst_state_type_id
       AND sta.pre_id = pcr.pst_pre_id
       AND pcr.cou_id = cou.ID
       AND (   p.private_flg != 'Y'
            OR (p.private_flg = 'Y' AND p.created_by_user_id = 7529)
       AND sta.state_type_id IN (326, 322, 323, 324, 325)
    Explain plan:
    PLAN_TABLE_OUTPUT
    | Id  | Operation                           |  Name                         | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT                    |                               |     7 |   434 | 43334   (2)|
    |*  1 |  TABLE ACCESS BY INDEX ROWID        | RAP_PRESENTATIONS             |     1 |    15 |     2  (50)|
    |   2 |   NESTED LOOPS                      |                               |     7 |   434 | 43334   (2)|
    |   3 |    NESTED LOOPS                     |                               |  1593 | 74871 | 41699   (2)|
    |   4 |     NESTED LOOPS                    |                               | 13016 |   457K| 15196   (2)|
    |   5 |      NESTED LOOPS                   |                               |  4723 |   101K|   798   (2)|
    |   6 |       VIEW                          | VW_NSO_1                      |    16 |   208 |            |
    |   7 |        SORT UNIQUE                  |                               |    16 |   256 |            |
    |   8 |         NESTED LOOPS                |                               |    16 |   256 |     4  (25)|
    |*  9 |          INDEX UNIQUE SCAN          | RAP_AUR_PK                    |     1 |     5 |     2  (50)|
    |* 10 |          TABLE ACCESS BY INDEX ROWID| RAP_APP_USER_PROFILES         |    16 |   176 |     3  (34)|
    |* 11 |           INDEX RANGE SCAN          | RAP_AUP_IX_01                 |    18 |       |     2  (50)|
    |  12 |       TABLE ACCESS BY INDEX ROWID   | RAP_COUNTERPARTIES            |   295 |  2655 |    50   (2)|
    |* 13 |        INDEX RANGE SCAN             | RAP_COU_IX_02                 |    95 |       |     2  (50)|
    |* 14 |      TABLE ACCESS BY INDEX ROWID    | RAP_PRESENTATION_COU_RATINGS  |     3 |    42 |     4  (25)|
    |* 15 |       INDEX RANGE SCAN              | RAP_PCR_IX_03                 |    10 |       |     3  (34)|
    |* 16 |     INDEX RANGE SCAN                | RAP_PST_IX_02                 |     1 |    11 |     3  (34)|
    |* 17 |    INDEX RANGE SCAN                 | RAP_PRE_PK                    |     1 |       |            |
    Predicate Information (identified by operation id):
       1 - filter(("P"."PRIVATE_FLG"<>'Y' OR "P"."PRIVATE_FLG"='Y' AND "P"."CREATED_BY_USER_ID"=7529) AND
                  "COU"."UNT_ID"="P"."UNT_ID")
       9 - access("U"."ID"=7529)
      10 - filter("PROF"."ARO_ID"<>8)
      11 - access("PROF"."AUR_ID"=7529)
      13 - access("COU"."UNT_ID"="VW_NSO_1"."$nso_col_1")
      14 - filter("PCR"."PST_STATE_TYPE_ID"=322 OR "PCR"."PST_STATE_TYPE_ID"=323 OR
                  "PCR"."PST_STATE_TYPE_ID"=324 OR "PCR"."PST_STATE_TYPE_ID"=325 OR "PCR"."PST_STATE_TYPE_ID"=326)
      15 - access("PCR"."COU_ID"="COU"."ID")
      16 - access("STA"."PRE_ID"="PCR"."PST_PRE_ID" AND "STA"."STATE_TYPE_ID"="PCR"."PST_STATE_TYPE_ID" AND
                  "STA"."CUR_PRESENT_STATE_INSTANCE_FLG"='Y')
           filter("STA"."STATE_TYPE_ID"=322 OR "STA"."STATE_TYPE_ID"=323 OR "STA"."STATE_TYPE_ID"=324 OR
                  "STA"."STATE_TYPE_ID"=325 OR "STA"."STATE_TYPE_ID"=326)
      17 - access("P"."ID"="STA"."PRE_ID")
    But my query that runs to get the data has a union with another query and with the change it looks like below
    SELECT /*+FIRST_ROWS*/
           p.ID ID
      FROM rap_presentations p,
           rap_counterparties cou,
           rap_presentation_states sta,
           rap_presentation_cou_ratings pcr
    WHERE cou.unt_id IN (
               SELECT prof.unt_id
                 FROM rap_application_users u, rap_app_user_profiles prof
                WHERE u.ID = prof.aur_id AND u.ID = 7529
                      AND prof.aro_id NOT IN (8))
       AND cou.unt_id = p.unt_id
       AND p.ID = sta.pre_id
       AND sta.cur_present_state_instance_flg = 'Y'
       AND sta.state_type_id = pcr.pst_state_type_id
       AND sta.pre_id = pcr.pst_pre_id
       AND pcr.cou_id = cou.ID
       AND (   p.private_flg != 'Y'
            OR (p.private_flg = 'Y' AND p.created_by_user_id = 7529)
       AND sta.state_type_id IN (326, 322, 323, 324, 325)
    UNION
    SELECT /*+index(pfs)*/
           p.ID ID
      FROM rap_presentations p,
           rap_presentation_states sta,
           rap_facilities f,
           rap_presentation_fac_states pfs
    WHERE f.unt_id IN (
               SELECT prof.unt_id
                 FROM rap_application_users u, rap_app_user_profiles prof
                WHERE u.ID = prof.aur_id AND u.ID = 7529
                      AND prof.aro_id NOT IN (8))
       AND f.unt_id = p.unt_id
       AND p.ID = sta.pre_id
       AND sta.cur_present_state_instance_flg = 'Y'
       AND sta.state_type_id = pfs.pst_state_type_id
       AND sta.pre_id = pfs.pst_pre_id
       AND pfs.fac_id = f.ID
       AND pfs.fac_num = f.num
       AND f.current_facility_instance_flg = 'Y'
       AND (   p.private_flg != 'Y'
            OR (p.private_flg = 'Y' AND p.created_by_user_id = 7529)
       AND sta.state_type_id IN (326, 322, 323, 324, 325)
    Explain plan :
    PLAN_TABLE_OUTPUT
    | Id  | Operation                          |  Name                  | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT                   |                        |     8 |   534 | 14931  (80)|
    |   1 |  SORT UNIQUE                       |                        |     8 |   534 | 14931  (80)|
    |   2 |   UNION-ALL                        |                        |       |       |            |
    |*  3 |    TABLE ACCESS BY INDEX ROWID     | RAP_PRESENTATIONS      |     1 |    15 |     2  (50)|
    |   4 |     NESTED LOOPS                   |                        |     7 |   455 |  3728  (17)|
    |*  5 |      HASH JOIN                     |                        |  1542 | 77100 |  2145  (27)|
    |*  6 |       HASH JOIN                    |                        | 12598 |   479K|  1300  (24)|
    |*  7 |        HASH JOIN                   |                        |  4571 |   111K|   584  (16)|
    |*  8 |         TABLE ACCESS BY INDEX ROWID| RAP_APP_USER_PROFILES  |    16 |   176 |     3  (34)|
    |*  9 |          INDEX RANGE SCAN          | RAP_AUP_IX_01          |    18 |       |     2  (50)|
    |  10 |         NESTED LOOPS               |                        |   118K|  1621K|   561  (13)|
    |* 11 |          INDEX UNIQUE SCAN         | RAP_AUR_PK             |     1 |     5 |     2  (50)|
    |  12 |          TABLE ACCESS FULL         | RAP_COUNTERPARTIES     |   118K|  1042K|   560  (13)|
    |* 13 |        INDEX FAST FULL SCAN        | RAP_PCR_PK             |   326K|  4467K|   659  (25)|
    |* 14 |       INDEX FAST FULL SCAN         | RAP_PST_IX_02          |   120K|  1291K|   821  (29)|
    |* 15 |      INDEX RANGE SCAN              | RAP_PRE_PK             |     1 |       |            |
    |  16 |    NESTED LOOPS                    |                        |     1 |    79 | 11201   (2)|
    |  17 |     NESTED LOOPS                   |                        |    75 |  4800 | 11124   (2)|
    |  18 |      NESTED LOOPS                  |                        |   617 | 32701 |  9867   (2)|
    |  19 |       NESTED LOOPS                 |                        |  2104 | 69432 |  5606   (2)|
    |  20 |        NESTED LOOPS                |                        |    16 |   256 |     4  (25)|
    |* 21 |         INDEX UNIQUE SCAN          | RAP_AUR_PK             |     1 |     5 |     2  (50)|
    |* 22 |         TABLE ACCESS BY INDEX ROWID| RAP_APP_USER_PROFILES  |    16 |   176 |     3  (34)|
    |* 23 |          INDEX RANGE SCAN          | RAP_AUP_IX_01          |    18 |       |     2  (50)|
    |* 24 |        TABLE ACCESS BY INDEX ROWID | RAP_FACILITIES         |   135 |  2295 |   351   (2)|
    |* 25 |         INDEX RANGE SCAN           | RAP_FAC_IX_02          |  1608 |       |     5  (20)|
    |* 26 |       INDEX RANGE SCAN             | RAP_PFR_PK             |     1 |    20 |     3  (34)|
    |* 27 |      INDEX RANGE SCAN              | RAP_PST_IX_02          |     1 |    11 |     3  (34)|
    |* 28 |     TABLE ACCESS BY INDEX ROWID    | RAP_PRESENTATIONS      |     1 |    15 |     2  (50)|
    |* 29 |      INDEX UNIQUE SCAN             | RAP_PRE_PK             |     1 |       |            |
    Predicate Information (identified by operation id):
       3 - filter(("P"."PRIVATE_FLG"<>'Y' OR "P"."PRIVATE_FLG"='Y' AND "P"."CREATED_BY_USER_ID"=7529)
                  AND "COU"."UNT_ID"="P"."UNT_ID")
       5 - access("STA"."STATE_TYPE_ID"="PCR"."PST_STATE_TYPE_ID" AND
                  "STA"."PRE_ID"="PCR"."PST_PRE_ID")
       6 - access("PCR"."COU_ID"="COU"."ID")
       7 - access("COU"."UNT_ID"="PROF"."UNT_ID")
       8 - filter("PROF"."ARO_ID"<>8)
       9 - access("PROF"."AUR_ID"=7529)
      11 - access("U"."ID"=7529)
      13 - filter("PCR"."PST_STATE_TYPE_ID"=322 OR "PCR"."PST_STATE_TYPE_ID"=323 OR
                  "PCR"."PST_STATE_TYPE_ID"=324 OR "PCR"."PST_STATE_TYPE_ID"=325 OR "PCR"."PST_STATE_TYPE_ID"=326)
      14 - filter("STA"."CUR_PRESENT_STATE_INSTANCE_FLG"='Y' AND ("STA"."STATE_TYPE_ID"=322 OR
                  "STA"."STATE_TYPE_ID"=323 OR "STA"."STATE_TYPE_ID"=324 OR "STA"."STATE_TYPE_ID"=325 OR
                  "STA"."STATE_TYPE_ID"=326))
      15 - access("P"."ID"="STA"."PRE_ID")
      21 - access("U"."ID"=7529)
      22 - filter("PROF"."ARO_ID"<>8)
      23 - access("PROF"."AUR_ID"=7529)
      24 - filter("F"."CURRENT_FACILITY_INSTANCE_FLG"='Y')
      25 - access("F"."UNT_ID"="PROF"."UNT_ID")
      26 - access("PFS"."FAC_ID"="F"."ID" AND "PFS"."FAC_NUM"="F"."NUM")
           filter("PFS"."PST_STATE_TYPE_ID"=322 OR "PFS"."PST_STATE_TYPE_ID"=323 OR
                  "PFS"."PST_STATE_TYPE_ID"=324 OR "PFS"."PST_STATE_TYPE_ID"=325 OR "PFS"."PST_STATE_TYPE_ID"=326)
      27 - access("STA"."PRE_ID"="PFS"."PST_PRE_ID" AND
                  "STA"."STATE_TYPE_ID"="PFS"."PST_STATE_TYPE_ID" AND "STA"."CUR_PRESENT_STATE_INSTANCE_FLG"='Y')
           filter("STA"."STATE_TYPE_ID"=322 OR "STA"."STATE_TYPE_ID"=323 OR "STA"."STATE_TYPE_ID"=324
                  OR "STA"."STATE_TYPE_ID"=325 OR "STA"."STATE_TYPE_ID"=326)
      28 - filter(("P"."PRIVATE_FLG"<>'Y' OR "P"."PRIVATE_FLG"='Y' AND "P"."CREATED_BY_USER_ID"=7529)
                  AND "F"."UNT_ID"="P"."UNT_ID")
      29 - access("P"."ID"="STA"."PRE_ID")
    Question:
    1. When I put the query with the FIRST_ROWS hint in a union with another query, the explain plan reverts back to the older explain plan. how can I avoid it when running by iteslf it runs really quick?
    2. Why is the cost with nested loops more higher? Is it because of statistics?
    2. Does the database parameter db_multiblock_read_count have any affect  on the fast full scan?
    3. I gather statistics using the followin method
    begin
       dbms_stats.gather_schema_stats(
          ownname          => 'RAP_OWNER',
          estimate_percent => dbms_stats.auto_sample_size,
          method_opt       => 'for all columns size auto',
          degree           => 7
    end;
    Sometimes I also use the following method
    BEGIN
    dbms_stats.gather_schema_stats( ownname=>'RAP_OWNER',
    METHOD_OPT=>'FOR ALL INDEXED COLUMNS SIZE SKEWONLY',
    CASCADE=>TRUE, ESTIMATE_PERCENT=>100);
    END;
    Which one is good or should I use both?
    Appreciate your input.

  • SQL Query for Project Permission in Project Server 2010

    HI
    I have assign multiple users on multiple projects with different level permission, 
    The permission level is assign from Project Permission (icon ribbon in PWA 2010.)
    (1.Open the project within Project Professional or Project Web App,
    2.Edit and Save
    the project within Project Professional or Project Web App
    3.Edit Project
    Summary Fields within Project Professional or Project Web App
    4.Publish the
    project within Project Professional or Project Web App
    5.View the Project
    Summary in the Project Center
    6.View the Project
    Schedule Details in Project Web App.
    7.View the Project
    Site)
    Is there any SQL Query to find which user/resource is assign to which projects and what above permission is assign.
    Thanks 
    Farhan
    farhan

    Hi Farhan,
    Please find the SQL below below which will give project permission users:
    select RES_SECURITY_GUID from ProjectServer_Published.dbo.MSP_RESOURCES where RES_UID = '37A56C30-34DE-417B-95A8-42FBA6F47565'
    select PROJ_NAME  from ProjectServer_Published.dbo.MSP_PROJECTS where PROJ_UID in (
    select distinct c.PROJ_UID from ProjectServer_Published.dbo.MSP_WEB_SECURITY_PROJECT_CATEGORIES c
              INNER JOIN ProjectServer_Published.dbo.MSP_WEB_SECURITY_SP_CAT_RELATIONS pcr on pcr.WSEC_CAT_UID = c.WSEC_CAT_UID
              INNER JOIN ProjectServer_Published.dbo.MSP_WEB_SECURITY_SP_CAT_PERMISSIONS pcp on pcp.WSEC_REL_UID = pcr.WSEC_REL_UID
              INNER JOIN ProjectServer_Published.dbo.MSP_WEB_SECURITY_GROUP_MEMBERS gm on gm.WSEC_GRP_GUID = pcr.WSEC_SP_GUID
              INNER JOIN ProjectServer_Published.dbo.MSP_WEB_SECURITY_FEATURES_ACTIONS AS SFA ON SFA.WSEC_FEA_ACT_UID = pcp.WSEC_FEA_ACT_UID
              INNER JOIN ProjectServer_Published.dbo.MSP_WEB_CONVERSIONS AS CONV ON CONV.CONV_VALUE = SFA.WSEC_FEA_ACT_NAME_ID where (1=1)
    And (CONV.LANG_ID = 1033) and gm.WRES_GUID = '2F5512D4-F561-43AF-AB7B-A189B0B9B6E8') -- Replace with above returned RES_SECURITY_GUID
    Vivek

  • PCR Social security: want to use wage type amount in decision operation

    PCR Social Security: Want to use wage type amount for comparison  
    Posted: Oct 21, 2010 11:00 AM                                  Reply
    Dear Guru's,
    hope u'll b fine and enjoying good health. Below is PCR for social security that I hav currently configured. Its working fine. However I have another scenario to add in this PCR.
    Existing PCR works on the following logic
    6% of Gross pay if employee's pay less than or equal to 10,000/-.
    KZPESI=10000 from T511K
    KZMESI=6 from T511K
    IZPESI=600 from T511P
    Now i want to add another comparison. also calculate Social security for employee those hire on pay less than or equal to 10,000 but currently have salary greater than 10K. for this I'll enter Social security amount in IT0014 subtype 6004. I
    ZSSM Personnal Calculation Rule ZSSM
    3
    6004 Social security Contrib
    AMT= 0001 Set
    AMT+ 0002 Addition
    AMT+ 0003 Addition
    AMT+ 0004 Addition
    AMT+ 1001 Addition
    ROUNDGK100 Round AMT to next
    AMT?KZPESI Comparison
    <
    AMT*KZMESI Multiplication
    AMT/100 Division
    RTE=TKSOLL Set
    RTE-TKAU** Subtraction
    ROUNDGK100 Round AMT to next
    ADDWT * OT Output table
    =
    AMT/TKDIVI Division
    RTE=TKSOLL Set
    RTE=TKAU** Set
    MULTI ARA Multipl.amt/no/rate
    AMT=IZPESI Set
    ROUNDGK100 Round AMT to next
    ADDWT * OT Output table
    >
    if there is a value in 0014 subtype 6004 then
    AMT/TKDIVI Division
    RTE=TKSOLL Set
    RTE=TKAU** Set
    MULTI ARA Multipl.amt/no/rate
    AMT=IZPESI Set
    ROUNDGK100 Round AMT to next
    ADDWT * OT Output table
    Want to know how I can use wage type amount in comparison. look at the above lines in bold where i want to apply
    kindly help
    Edited by: Imran on Oct 21, 2010 11:40 AM

    You say "if there is a value in 0014 subtype 6004 then...", so I will assume that you are talking of WT 6004 in Infotype 0014.
    So, in a PCR immediately after IT0014 is processed (with function P0014 in your schema), look for WT 6004.  If it exists with a number (or an amount), create a temporary variable to act as a "flag"  (as in ADDWT&6004 or ADDWT&HIRE).
    Then, in PCR ZSSM, you can query that temporary variable with the sequence of operations NUM=& HIRE NUM?0 (or NUM=& 6004 NUM?0 ). If the return value is =, it means that there was no IT0014 with WT 6004, and if the return value is * it means that there was.

  • Schemas and PCRs

    hi, experts.
    i need help in learning schemas and writing PCRs. please suggest me any book or send me any document that will help.
    regards,
    madhu

    hai..
    How to read rules and Schemas
    1.Structure of relationship in Rules and Schemas:
    a)Schemas consist of Functions and Sub-schemas
    b)Some functions have the rules attached to it as one of its parameter
    c)Rules consist of a set of operations to perform some actions
    d)Operations and Functions are the executable components
    As per the diagram Set of Operations make a Rule which in turn attached to some functions and those functions embedded in Schemas or Sub-schemas (Inside the main schemas) to decide the flow of the payroll program.
    Structure of a Schema:
    Func:
    This column is used to give a function name.
    Par1, Par2, Par3, Par4:
    1. Function has maximum four parameters.
    2. The function can have zero to four parameters as per the definition of the function.
    3. Pressing F4 we can get the list of all the values which can be used as parameters.
    4. For some functions in the first parameter is the name of the rule created.
    5. These parameter values are predefined the function is being created.
    D:
    1. This column is used to comment and uncomment a function.
    2. If (*) is being put then the line is commented and will not be executed in Payroll processing.
    3. If nothing is given then the line would be executable.
    Desc
    1. In this column description for the function is being used.
    Functions:
    Functions are used for;
    • Performing some payroll computations (E.g. INEPF function calculates the PF amount of an employee during payroll run)
    • Calling rules (E.g. P0045 function calls a rule INLN to compute the loan details of a personnel number).
    • Getting data from Infotypes (E.g. P0581 will get the data from Infotype-581 for payroll processing).
    • For some decisions. (E.g. IF & ENDIF function is used to execute as per the true and false decisions) etc.
    Rules:
    Rules are used for holding a set of operations for a particular requirement to be accomplished.
    Attributes:
    1. Program Class.
    a. There are two program classes to be assigned to the rule while creating.
    i. Payroll (C).
    ii. Time (T).
    2. Country Grouping.
    a. For Payroll program class the country grouping should be mentioned. (E.g. 40 for India).
    b. For Time management rule the country grouping should be (*).
    3. Employee Sub-grouping.
    a. All the wagetypes have an attribute of employee sub-grouping.
    b. It varies client to client.
    c. Value 3 means EE sub-grouping is 3.
    d. Value * means all EE Sun-groupings.
    4. Wagetypes.
    a. The wagetype in the internal table which is meant to be processed by the rule.
    b. If a value for Wagetype is being given then the particular wagetype is being queried for processing.
    c. If **** has been given then all the wagetypes present in the particular internal table will be processed.
    Structure of the Rule.
    Frequently Used Internal Tables in PY Processing:
    The Payroll driver uses lots of internal tables used for storing data temporarily in the program for processing. Some of the important internal tables are:
    The structure of internal tables:
    EE Sub-grouping:
    1. The Wagetype is assigned to a particular Employee sub-group.
    2. 3 is a particular employee subgroup for basic pay wagetype.
    3. * value means for all EE sub-grouping.
    Wagetype Code:
    1. The Wagetype code number is the number assigned to a particular pay component.
    Wagetype Description:
    1. The description for the wagetype code.
    NUM:
    1. If there is a split for the wagetypes then this NUM field will make them different.
    2. If A person’s basic salary is changed in the mid of the month then the wagetype will be split in two amounts with NUM = 01 and NUM = 02.
    RTE:
    1. The RTE column stores a value for;
    a. Rate of interest.
    b. Number of leave days.
    c. Projection factor. Etc.
    2. E.g. In the above diagram /401 wagetype has RTE value 10 which is the projection factor used for different calculations.
    AMT:
    1. This column possesses the amount of the particular wagetype.
    Use of the internal tables:
    1. The internal tables are being used for calculations on the NUM, RTE & AMT fields.
    2. These internal tables are being read by the rules row by row.
    3. The Calculation rule would be only processed for those wagetypes which are specified in the rule’s source code.
    4. The row in the internal table containing the wagetype which has been defined in rule attributes will be placed in the header of the internal table for processing.
    5. The processing would be as per the operations used in the rule.
    Some important Operations & Functions:
    • The editor for Operations and Functions is PE04.
    • While the payroll driver encounters a function and operation it would call a subroutine written in the payroll driver.
    • The subroutine name for the operation will be OP****, Where **** will be the name of the operation.
    • For E.g. for Operation AMT the subroutine name would be OPAMT.
    • The code written for the function will be found as a subroutine in payroll driver as FU****, where **** will be the name of the function.
    • For E.g. for function INEPF the subroutine name would be FUINEPF.
    Operations:
    AMT:
    1. This Operation would fetch the Amount of the wagetype queried in the rule, in the Variable AMT for processing.
    2. The Syntax of the Operation is ZZZOVVVV.
    3. ZZZ -> AMT.
    4. O -> Operand.
    5. VVV -> Value or Variable.
    6. For E.g. (AMT= 1000) will fetch the Amount of Wagetype 1000 into AMT.
    7. Pressing F1 on the AMT Operation will provide the documentation.
    RTE:
    1. This Operation would fetch the Rate of the wagetype queried in the rule, in the Variable RTE for processing.
    2. The Syntax of the Operation is ZZZOVVVV.
    3. ZZZ -> RTE.
    4. O -> Operand.
    5. VVV -> Value or Variable.
    6. For E.g. (RTE= /401) will fetch the Rate of Wagetype /401 into RTE.
    7. Pressing F1 on the RTE Operation will provide the documentation.
    NUM:
    1. This Operation would fetch the Split indicator of the wagetype queried in the rule, in the Variable NUM for processing.
    2. The Syntax of the Operation is ZZZOVVVV.
    3. ZZZ -> NUM.
    4. O -> Operand.
    5. VVV -> Value or Variable.
    6. For E.g. (NUM= 1000) will fetch the Split indicator of Wagetype 1000 into NUM.
    7. Pressing F1 on the NUM Operation will provide the documentation.
    ADDWT:
    1. This Operation will append one more row in the internal table (Processed by the rule).
    2. After calculating an amount from a particular wagetype the amount can be assigned to another wagetype and append to the internal table.
    3. For E.g. ADDWT 2050 will add the NUM, RTE, AMT calculated to the NUM, RTE & AMT of the wagetype 2050.
    4. If the Wagetype 2050 is not there before in the internal table then NUM, RTE & AMT would be 0.
    5. If any value of these three variables are present before then they will be added to the calculated ones.
    Functions:
    PIT:
    1. This function will read the internal table IT (Input table).
    2. The function will hold a rule as first parameter.
    PRT:
    1. This function will read the internal table RT (Results table).
    2. The function will hold a rule as first parameter.
    PDT:
    1. This function will read the internal table IT (Input table).
    2. The function will hold a rule as first parameter.
    PORT:
    1. This function will read the internal table ORT (Old results table).
    2. The function will hold a rule as first parameter.
    P0014:
    1. This function will read the Infotype 0014 for processing.
    2. The function will hold a rule as first parameter.

  • PCR to process only  the first occurrence of wage

    Hello Experts,
    I have a requirement to process only the first occurrence of the wage.
    The IT might have the same wage more than once and I have to allow one the first wage to get processed and other similar wages should be dropped.
    Note: The amount for the wages are determined later in the schema so the initial amount for all the wages will be '0'.
    Can someone please explain me the PCR steps to accomplish this scenario.
    Regards,
    Raj Thilak

    How is your PCR Z011 built?
    Our's makes a first decision on Processing Class 76, and sometimes a second decision on the Pay Type, and depending on the return values, it does nothing or calls PCR ZAP0.
    In our copy of PCR ZAP0, a decision is made on Processing Class 47.
    In your system and for your Country Code, does it work in the same fashion?
    For the WT you need to check on doubles, does it have it's own value for PrCl 47?  Could you give those WTs their own values for PrCl 47 ?
    In a PCR called by function P0014, can you query temporary variables?  Try it out.
    If you do a Payroll Simulation (with the "Display log" box checked) and drill down to function P0014, what processing does your special WT goes through?
    In this example, if the WT on IT0014 would have a distinct value for PrCl 47, processing could be different (and possibly include a decision on the existence of a temporary variable) so that a second occurrence of the same WT would not include operation ADDWT * .

  • Function or PCR

    Hi Experts,
    I have a scenario ,  employee needs to be paid one allowance based on grade ( IT0008)  & Nationality ( IT0002 ).
    This amount will be varing time to time and hence the need arise to maintain in some custom view or T511K .
    Please suggest the best option among Function or PCR.
    My gut feeling is that to go function and query the view and populate the results.
    Rather than going for PCR which require table query PA0002 and Grade  and frequent maintainance of T511K for each value for the combination of nationality and grade. Multiple level of nationality in the PCR.
    Please advise.
    Regards,
    IFF

    Hi,
    I am getting error
    TABLEP0002 Read table fields
    VARGBNATIO Tab.field VVVVV v.ky
    IN
    OUTALTRFGR
    I am getting error OUTALTRFGR is not a valid operation.
    Even I am trying
    TABLEP0002 Read table fields
    VARGBNATIO Tab.field VVVVV v.ky
    IN
    TABLEP0008
    VARGBTRFGR
    I am also getting error : Variable argument may be only 8 characters long.
    Please advise.
    Regards,
    IFF

  • I want to learn writing PCRs & Schemas

    I am new to SAP HCM and learning the configuration steps on IDES 6.0. I am at present learning Time Management sub module. I want to learn how to write new PCRs and also modify PCRs and schemas. I have, sort of, understood the definitions of schemas, PCRs, functions, operations etc. But it stops here. I am unable to proceed further.
    Can any of you suggest how to go further. Any good link/book on this topic?
    Please help me.
    Regards
    Gopal

    Hi,
    Goto to T-code pe02 .
    In that you have documentation.
    T-code pe04 also has the same where u will get the functions and operations with clear explanation and Examples.
    the following link might helpful to you
    http://www.sdn.sap.com/irj/scn/advancedsearch?query=pcr#sdn_content_category_value_wiki
    All the BEST.
    KRC

Maybe you are looking for

  • [SOLVED] pacman -Sy failing with Invalid URL Scheme

    I'm getting a comparable pair of lines for each combination of database (core, extra, etc.) and mirror (rankmirrors-generated mirrorlist): error: url 'http://mirror.rit.edu/archlinux/core/os - .db.tar.gz' is invalid debug: returning error 43 from dow

  • How to load AICC Files to OLM

    Hi Guys . I am having few AICC files . Each file is having extension files of (.au,.crs,.cst,.des,.ort) . i made a zip file for all this files and tried to import to LO . But at the time of importing application is not prompting me select the direcor

  • Including multiple resources into response

    In a servlet, I am including a text file and an image seperately using RequestDispatcher.include() method. But when I view the output in the browser, i see the content of the text file along with the content of the image, instead of the image itself.

  • Nokia 808 pureview

    when the belle will receive next update after belle fp 2

  • Have Elements 10 with 3 CDs,when put on computer says serial

    I don't want to discuss this; I need an immediate answer from Adobe. Why isn't there anyone to talk to other than a "forum?" I need IMMEDIATE answers. I'd like to actually use my Photoshop today, not after everyone has discussed it.