cancel
Showing results for 
Search instead for 
Did you mean: 

Access payroll variables from custom payroll function

Former Member
0 Kudos

Hi All,

I have a requirement to create a custom payroll function that returns some data from IT0006 and IT0032.

I have written the code in PCBURZDE0, as the payroll is for Germany, it does read the data needed.

My question is, how I can access the variables specified for the function in the payroll schema.

Schema definition in PE01

Zeile     Fkt        Par1  Par2 Par3 Par4 D Text

000010 BLOCK BEG                              Fahrradleasing

000020 _DFRD &PRO GEN

000030 BLOCK END

If I double-click Par1 for function _DFRD (&PRO), then I see he two variables I should write the data to:

Zeile  VarArg. FZ T Operation        Operation Operation Operation Operation Operation *

       -------------+---------+------------------+---------+---------+---------+---------+

000010                  AMT= PKWWRPRINT     *

000020           1     AMT= ENTKM  PRINT

So, as I understand I should write the two variables PKWWR and ENTKM, I have the values in the function code, but I don't know how to access these variables.

Thanks for your help!

Gyöngyi

Accepted Solutions (1)

Accepted Solutions (1)

former_member193210
Active Contributor
0 Kudos

If your Custom Function reads IT0006 and IT0032, perhaps you should transfer that information to the Input Table through Information WTs. Then, through function PIT and a PCR, you would process the Input Table and use the information in those Information WTs to process the WT you want.

Alternatively, you create 2 Custom Operations, one to read the data from IT0006 and one to read the data from IT0032, and use these 2 Custom Operations in a Payroll PCR (probably processed through function PIT).

Note that your PCR &PRO has a big flaw : you use operation AMT= twice in a row, thereby rendering it's first instance useless (the amount will be equal to the last statement). 

The use of operation PRINT will only be useful if you do a Payroll Simulation or a Payroll Calculation with the "Display log" box checked, and we can't see your PCR's ESG or WT (nor is operation ADDWT used).

Former Member
0 Kudos

Thanks for you r reply Rémi.

I guess WT stands for wage type, and there is the problem. I already have tried to add it to the Input Table, as wage type, but the consultant encountered an error, so he had to remove the whole function from the schema, and informed me that I must not add this to the  input table.

It should work as it does for DPKW for cars, but I could not find where that sets its two payroll variables.

As we have copied it, and I changed only the variables read from the ITs, and then set all their occurences in the function to the new variables, so I do not really see why it does not work now.

Any help would be appreciated!

former_member193210
Active Contributor
0 Kudos

The 2 WageTypes that you could generate for the Input Table would require to be configured as Information WTs, meaning WTs that do not have any impact on Gross or Net Earnings.

These WTs could "disappear" during Payroll Calculation, after being used for the decisions or calculations you require, or could be transfed to the Results Table as confirmation of what was read in the Infotypes.

I'm not familiar with DPKW, but you could ask the consultant to set-up Payroll Simulation for one employee who has the DPKW for cars and try debugging to find out how and where it gets it's values from.

Former Member
0 Kudos

Hi Rémi,

As the consultant informed me, your reply has solved a problem, but not ours

Could you be a bit more specific about this PIT function and PCR_ Is there a specific PCR we should use, how we can access it. Or just saving it in the Input Table could it be read directly by the payroll schema?

The consultant wants to get 4 values, but as you mentioned, only one can be read with this AMT command. So how this can be achieved?

former_member193210
Active Contributor
0 Kudos

1 - PIT is a Function that is used in the Payroll Schema to "Process the Internal Table".

2 - You mentioned that you had created a Custom Function to read IT0006 and IT0032, and I only suggested to you that you could have that Custom Function generate Information WageTypes and save them in the Input Table where they could then be used in PCRs.

3 - I did not mention that you can read only one value through operation AMT, but I mentioned that using AMT=xxxxxx followed by AMT=yyyyyy means that the first statement is useless.  On the other hand, using AMT=xxxxxx followed by AMT+yyyyyy and AMT+zzzzzz will result in the amount being the total of the 3 values.

4 - Please read some documents on Schemas, Functions and PCRs, such as in the Wikis on this site, and study your current Payroll Schema, it's sub-schemas, it's functions and the operations in it's PCRs.  Note that t-code pe01, pe02 and pe04 can be used to find some documentation on functions and operations.

Answers (1)

Answers (1)

Former Member
0 Kudos

As the problem seems to be solved now, I share our way of implementing it, just in case someone might need it later..

To return a value from the payroll function to the schema, there are several ways.

1. Without changing the standard code: store it in table IT, and then the schema can read it with function PIT, Your consultant should be able to use it.

it-lgart = <an lgart not used elsewhere>

it-betrg = <value to return>

append it.

2. Changing the standard code. In form VFELD-NATIO, add a WHEN branch for the fieldname the schema will call it by. You can call a form there, or if the form is called earlier, just return the value needed.

pfeld = <value>

Then, in the schema it can be accessed with the call AMT= <fieldname>. Thus the consultant may use it just the same way it would work for a standard payroll field.