cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new PCR Rule depending on infotype

former_member627003
Participant
0 Kudos

Hello all,

I have the following mission:

Create a PCR that reads the P0377-BPLAN equals to  'PLAN1' or 'PLAN2' or 'PLAN3'.

If the employee has this infotype, then should check the infotype P0021 where the subtype is equals to '2' and P0021-FGBDT compared to the actual date, should be less than 6 years. If the condition above is true, then should make an ADDWT 9000.

The purpose of this Rule, is to check if the employee has a maternal plan and if his son has less than 6 years old, and then the Wage type inserted in the infotype 15 should be processed.

Thanks,

Ricardo

Accepted Solutions (1)

Accepted Solutions (1)

JohnWick
Active Participant
0 Kudos

Hi Ricardo, first at all  you have to read the infotype in the schema with the function P0377 then use a rule in which you ask about the plans, so if there are some of the plans you wrote you have to read the infotype 0021 with the operation table, but you hisave to make sure in moment you want to read the infotype it was included, to read the field FGBDT use the operation VARGB

Manuel

former_member627003
Participant
0 Kudos

Hi Manuel,

Thanks for the suggestion.

It's almost what I want, but how can I compare the field FGBDT( date field ) with the date of the moment in PCR?

Thanks,

Ricardo

JohnWick
Active Participant
0 Kudos

Hi Ricardo for  that you can use the operation CPAGE:

CPAGE calculates the age of a person at a certain reference date. The

operation creates the difference from the reference date and the date of

birth. The result is them compared with a specifed number (comparison

age). You can specify the date of birth, reference date, and comparison

age using the operation's syntax.

The operation can only be used in a personnel calculation rule that is

called before function P0021.

utput

Depending on whether the calculated age is greater, less than, or the

same as the comparison age, the operation writes one of three signs <, >

or =, to the variable key.

yntax

OOOOOSVVFX

OOOOO       CPAGE       Name of operation

      S                  Date of birth

             space       Employee's date of birth from

                         Infotype Personal Data (0002)

             F           D.o.B of family member from

                         Infotype Family/Related Person (0021)

       VV                Comparison age

             nn          Age as number nn

             PB          Maximum age for insurance from

                         Infotype VBL/ZVE Data (0051);

                         only relevant for country version

                         Germany

         F               Reference date

             space       Age at end of year

             N           Age on first of month

             M           Age on last of month

             V           Age on last of preceding month

          X              possible correction of reference date

             +           Age in days plus 1

                         (for tax)

             -           Age in days minus 1

                         (for social insurance)

Use operation CPAGE to deal with the following requirements:

1.  CPAGE 65N

    The operation compares the employee's age on the first day of the

    calendar month in which payroll is run, with 65.

2.  CPAGE PBM

    The operation compares the employee's age on the last day of the

    calendar month in which payroll is run, with the VBL/ZVE-liable age

    in infotype VBL/ZVE Data (0051).

3.  CPAGEF50

Hope this helps.

MC

former_member627003
Participant
0 Kudos

Very good Manuel,

I am creating the Rule, but for example we have here:

TABLEP0377

VARGBBPLAN

     - PLA1

          TABLEP0021

          CPAGE07M  (IS THIS CORRECT? The dependant of the employee should have less than 7 years old)

               *  ADDWT *

               =

               >   

                   

     - PLA2

          TABLEP0021

          CPAGE05M  (IS THIS CORRECT? The dependant of the employee should have less than 5 years old)

               *  ADDWT *

               =

               >   

Should I store the value of field FGBDT, or the function CPAGE do this with read automatically?

Cheers,

Ricardo

Answers (2)

Answers (2)

0 Kudos

Hi Ricardo,

I am not sure which country payroll you are using, but it sounds like you might need to create a couple of functions to gather the data you need (get children information from 0021, get plan information from 377 and read the children's data from 0021 for the age calculation referred to earlier in this chain). I feel that all of this enhancement work would be better placed into supporting a process that keeps the entry from happening if the conditions you mention are not met.

I would look at setting up the checks that you are trying to apply in the entry process for the wage type.  In a PAI user exit for IT0014 and/or IT0015 execute the checks for the plan and then evaluate the records for children to determine A) if there are any children and B) does any one of the children meet the age criteria.  If the criteria are not met (a 377 AND a child under the age of 6 for the periods in question) then you generate an error message.  If there are children then determine the latest date of eligibility and do not let the IT be created after that date.

Then - if the wage type exists you can process it as required, it can only be available in payroll if the system allows the creation of the record.

Cheers,

venkateshorusu
Active Contributor
0 Kudos

As far i understand there are ways to accomplish requirement either dynamic action or PCR if you wanted to go with a PCR use below operations to write logic according to your requirement.

else go with dynamic actions concept for your reference go through below links.

While working with system we may have to face different experiences have a look of them if they are feasible go ahead.

Regards

Venkatesh