on 12-24-2014 12:33 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Remi,
Thanks a lot for your precious reply,
I have modified Z777 to be as the following:
Z777
*
2055 Production incentive
AMT=&2055 Set
AMT?0 Comparison
*
GCY Z888 With exact w.types
=
ADDWT * OT Output table
Z888 is as the following:
Z888
*
9501 Gain Work Tax
ADDWT * OT Output table
AMT-& 3046 Subtraction
ADDWT 3047 OT Output table
Still, whenever i run the payroll, 3047 is calculated, although what i need as i mentioned before is to make z777 active only whenever using 2055.
I appreciate your feedback.
When we look at the requirement 2055 is maintained by user in that case you have to write PCR as mentioned earlier.
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
or
Z777
*
2055 Production incentive
AMT=&2055 Set
AMT?0 Comparison
>
GCY Z888 With exact w.types
=
ADDWT * OT Output table
<
ADDWT * OT Output table
Further if user is not maintained 2055 at info type level then PCR itself will not get processed in log since if it is there in input table then only PCR will get processed else 2055 is not maintained at IT0015,14 etc no wage type 2055 in Input table then PCR it self will not get processed no point of rule it self.
Hope you understand it.
Regards
Venkatesh
Dear,
I totally understand your point, and i created Z777 exactly as you mentioned, but still when i run any payroll, the rule is activated as Z888 involves WT 9501 which is generated with any payroll run. The issue still stand as Z777 is still active either 2055 is used or not.
Please find the following images for more more clarification.
z
1)When you are using GCY Operation there is no point placing Z888 PCR in the schema remove Z888 PCR from the schema then it works when condition is met in Z777 which AMT is greater than than 0 then it loops at Z888 so no need to place it in schema.
2)2 nd option do not use GCY Z888 in Z777 instead of GCY Z888 place the logic
Z777
2055
AMT=&2055
AMT?0
<
=
>(GCY Z888) is not required)
9501
ADDWT *
AMT-& 3046
ADDWT 3047
Follow any one of the way then it works.
Regards
Venkatesh
I appreciate your reply. However, when I deactivated Z888 in the schema, then the payroll didn't recognize any processing for calculating 3047.
Also, regarding the syntax of Z777 rule,
2055
AMT=&2055
AMT?0
<
=
>
9501 --------> (There is no valid operation) message shows up.
ADDWT *
AMT-& 3046
ADDWT 3047
I was wondering what is the exact syntax need to be written to handle the message part.
You try to use operation WGTYP then place logic and check whether it is working or not.
9501 -------> (There is no valid operation) message shows up.
ADDWT *
AMT-& 3046
ADDWT 3047
If it does not work you write PCY Z888 under > node but later remove your PIT Z888 from schema or comment it so that in Z777 conditions are met it loops to the Z888 then it works remember when we are using PCY GCY no need to insert it in schema with function PIT.
later PCR Z888 should be available in the system.
Regards
Venkatesh
Where do you create the temporary variable &2055?
Try modifying pcr Z777 so that, for WT 2055, the only operations used are ADDWT * and ADDWT&2055, (and I must assume that you have already created the temporary variable for WT 3046 elsewhere).
Then, modify pcr Z888 so that for WT 9105, the first operations used are ADDWT * AMT=&2055 AMT?0
for return value =, no operation is required since WT 2055 does not exist.
for return value *, use the following operation sequence: ZERO= RNA FILLF RNA AMT-& 3046 ADDWT 3047
Also insert function PRINT with Par2 = VAR into your schema after PCR Z888 so that you could look at the values of the temporary variables when analyzing the Payroll Log.
Dear Remi,
Many thanks for you reply. it was very valuable.
I have done all modifications stated in you reply, and when I checked function PRINT in the payroll log, i found only wage type 3046!
I appreciate your feedback why don't the system reads 2055 in my rules.
I want to add a note which may help and modify a previous mistake in my illustration to the problem
( This is a bonus offcycle run for wage type 2055, which was entered through infotype 0267)
Thanks in advance,
Regards,
Do a Payroll Simulation for one employee with WT 2055 in IT0015 (or IT0014), and drill down into the log until you find pcr Z777 (the one that creates the temporary variable for WT 2055).
Double click on the pcr to confirm that the Input Table to the pcr includes WT 2055 with an Amount, that the pcr does process WT 2055 and that the processing uses operation ADDWT&2055.
If all conditions are met, the temporary variable to WT 2055 should exist in the Temporary Variables Table (which you can see if function PRINT is added in your schema with Par2 = VAR).
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,
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
If your query is answered you can close thread as well.
Regards
Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.