Skip to Content

Steps to create Z Operation:-

Step1:- Go to Transaction PE04 and create an operation “ZOPRT”, as follows:-

C1.png

C2.png

Here the VkeyT is a variable type of return parameter and VkeyLngth is the length of this variable , it could be 2 or 3 or 4 or any value.

Step2:- Now create the subroutine in customer program of respective payroll driver.

            The include which contains all Operations is PCASFXX0 where XX is a country key for INDIA its IN, for International its TH

Step3:- Once the subroutine is created paste this code into the OPERATIONS.

          DATA : w_p0015 type P0015,   –> mention all the structures you wanted to use

               w_p0014 type P0014,

               w_p0040 type P0040,

               w_it TYPE pc207,

               v_LEIHG type LEIHG.

“Suppose we wanted to query IT40 for Objects on loan and accordingly wanted to returnt values in filed “VARGT” so that a decision can be taken in PCR              

              

<<Write the logic or query an field to get its value and accordingly return>>

<<Suppose if LEIGH = 0001 then VARGT = 1 >>

IF v_LEIGH = ‘COMP’.

VARGT = 1.           –> standard return parameter

PERFORM fillvargt.   –> this is a standard perform to fill the return parameter.

ENDIF.

IF v_LEIGH = ‘MOBI’.

VARGT = 2.           –> standard return parameter

PERFORM fillvargt.   –> this is a standard perform to fill the return parameter.

ENDIF.

<<Similarly other such conditions can be written>>

<<In case you wanted to update any numeric value in IT table then use “OT-betpe” it will update the amount filed of current wage type>>

Step 4:- And finally this operation can be called in any PCR was follows:-

C3.png

Thanks,

Rohit

Do let me know if anyone needs more clarification related to this .

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Gyöngyi Meszlenyi

    Hi Rohit,

    Thanks for this guide, it really is helpful.

    As I am new to HR payroll functions and operations, it is not clear to me, what do you mean by “paste this code into the OPERATIONS” in Step 3.

    But the main question is, could you give a similar step by step guide for creating custom payroll functions? I have the function created, it is inserted by the consultant to the schema, but he cannot see any values returned. What else do I need to configure? The function is basically a copy of the standard DPKW function, just should return some other data.

    I have checked what the problem might be and in PE04 when I save the function, the parameters I specified are not being saved to the T52B* tables. For some reason, the PARAM_VALUES_ALL table is empty.

    Thanks

    Gyöngyi

    (0) 

Leave a Reply