Skip to Content
Former Member

### PCR Action

Dear Experts,

I have designed a calculation rule which is used to calculate a wage type as the following calculation:

WT 3047= WT 9501 - WT 3046

The following syntax was used:

Z777 Personnel Calculation Rule

*

9501 Gain Work Tax

ADDWT *    OT   Output table

AMT-& 3046 Subtraction

ADDWT 3047 OT   Output table

I need to make this calculation rule activated only when the payroll includes a specific wage type which (WT 2055). In other words, whenever the  user adds WT 2055 for the employee, then this calculation rule is active. If not, then the payroll driver doesn't work on this rule.

I appreciate your help in the know how of doing this.

Thanks in advance.

##### Add comment
10|10000 characters needed characters exceeded

### 4 Answers

• Best Answer
Dec 24, 2014 at 04:31 PM

You mention that you want this PCR to be "active" "whenever the  user adds WT 2055 for the employee", so when processing the Infotype that includes WT 2055, you should generate a temporary variable to confirm the existence of the WT (using operation ADDWT&2055).

From your posting, I assume that you have already created the temporary variable for WT 3046 when processing WT 3046  (using operation ADDWT&3056).

In PCR Z777, you should start with operations AMT=& 2055 followed by AMT?0 to query on the existence of WT 2055.  If the return value is =, it means that WT 2055 does not exist for the employee (since the temp.var. was not created previously), but if the return value is * (anything else) then it means that WT 2055 exists and you do the required processing.

. P.S. : Note that if WT 2055 holds a number but no amount, the sequence AMT=& 2055 followed by AMT?0 will need to be replaced by NUM=& 2055 followed by NUM?0

##### Add comment
10|10000 characters needed characters exceeded
• Former Member Rémi Corriveau

To summerize the solution, the following was done:

A. PCR Z777 was created as the following:

Z777

*

2055 Production incentive

ADDWT *    OT   Output table

ADDWT&2055 VAR  Variable table

B. PCR 888 was created as the following:

Z888

*

9501 Gain Work Tax

ADDWT *    OT   Output table

AMT=& 2055 Set

AMT?0      Comparison

*

ZERO= RNA  AmtNumRteTime = 0

FILLF RNA  Fill amt/no/rate

AMT+& 3046 Addition

SUBWT 3047 OT   Output table

=

ADDWT *    OT   Output table

C. Then, Z777 was inserted in the schema (in XAP9 scheema - Import additional payments/deductions).

D. Z888 was inserted in schema (after wage type 9501 is calculated).

E. Function PRINT was added to the schema, after Z888 to read values of the temporary variables when analyzing the payroll log.

Regards,

• Former Member
Dec 24, 2014 at 02:43 PM

Query wage type 2055

WGTYP
2055

AMT?0(you can query NUM it depends on master data)

<

=

>

WGTYP

9501 Gain Work Tax

ADDWT *    OT   Output table

AMT-& 3046 Subtraction

ADDWT 3047 OT   Output table

check it may solve your problem if not let us what exactly the problem you are facing.

Regards

Venkatesh

##### Add comment
10|10000 characters needed characters exceeded
• Former Member
Dec 29, 2014 at 07:14 AM

If your query is answered you can close thread as well.

Regards

Venkatesh

##### Add comment
10|10000 characters needed characters exceeded
• Former Member
Dec 31, 2014 at 01:38 PM

I think the main problem is in the input table of the Z777 rule. The problem is that there is no effect of

2055

AMT=& 2055 Set

as i realized that the system is always deal with

9501

ADDWT *

AMT-& 3046

ADDWT 3047

without depending on the condition of

2055                    Production incentive

AMT=& 2055             Set

AMT?0                Comparison

<

ADDWT *    OT   Output table

=

ADDWT *    OT   Output table

>

PCY Z888   With exact w.types

Talking into account 2 points:

A: wage type 2055 is entered through Infotype 0015.

B: I have put the rule Z777 in the payroll schema, after the rule which calculates wage type 9501.

Regards,

##### Add comment
10|10000 characters needed characters exceeded
• Former Member

Production Incentive 2055 is coming through info type 15 here question give us the details how exactly it is being created in 0015 i.e whether you are maintaining a record in 0015 by using field Number/Unit or Amount if you are passing Number/Unit then we have to Query NUM of 2055.

WGTYP

NUM?0

<

ADDWT *

=

ADDWT *

>

PCY Z888

Where in case record is maintained with amount field then use operation AMT?0 rest logic is same.

Further more if wage type 2055 is not maintained in 0015 i.e no record since Input table will not have 2055 in that case Z777 itself will not execute why we are querying the value with 0 is if by mistake any value is being maintained with negative indicator  then it checks and allows the calculation if it is greater than "0".

before doing all this give us clarity  wage type 2055 is passed to variable &2055 (ADDWT&2055)or not if not no point in using operation AMT=&2055 if you are passing then only you can use AMT=&2055.

Regards

Venkatesh