cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get Payroll results when I run the Payroll in Simulation mode

Former Member
0 Kudos

I need to get the Payroll Results in my Report Program after running the payroll in Simulation mode. I want the simuated payroll results and not the actual payroll results. Is there any function module to get the Simulated payroll results directly into my report program?

Accepted Solutions (0)

Answers (12)

Answers (12)

Former Member
0 Kudos

Dear All,

Thanks for the inputs.

But I heard that there is one report for Australia payroll which give the payroll simulation result without updating RT.

The report can give WT after simulating payroll.

Can anyone suggest that report?

Thanks,

Ketul

Former Member
0 Kudos

Dear NSR,

Simulation Payroll run means "Only Test Run".

When you did the report program, that time you build the logic from take the all data RT Tables.  RT table update only after Live Run.

I am suggesting you to don't play with payroll program, in future may be you will get stuck for payroll process, this is SAP standard practices.

You can take run 100 times, so don't worry, take a live run and get the results in your report, if any changes you can do.

Some of the options is available for see the results i.e. Display Log, Payslip, but if bulk employee having the result, then why you check one by one, take live run and check report.

Hope you understand.

All the Best.

Regards,

Santosh Shivane  

Former Member
0 Kudos

Hi,

I'm facing a similar problem so I'm asking for help on how can I solve it.

I'll try to explain, we have different special payrolls that includes overtime, bonus payments, late payments and things like that but in order to approve the payrolls and post it on FI we need to generate some reports and the only way that we have found to do it is by saving the payrolls.

The problem is that in different payrolls we have the same employee, lets say that one employee has a payment for overtime and bonus and we saved the overtime before the bonus but both are saved, with the reports generated we found that we need to update overtime data to that employee and rerun the overtime payroll, when we try to do it the system sends us an error because that employee has another payroll after the one that we are trying to update. We know that we can delete the second payroll but as the time took on the approval process maybe is long, the second payroll is already posted on FI or as our payrolls are calculated for 25000 employees so the time consumed to delete and rerun a payroll is very representative.

If you can give us any help it'll be very usefull.

Thakns in advanced.

Carlos.

Former Member
0 Kudos

This is what we do to get payroll simulation result. This is for Canada but I'm pretty sure that I could work for other country.

   REPORT  zcb_test_simulation.

TYPE-POOLS: hrpay.
TABLES: pcl1"IMPORT/EXPORT
        pcl2"IMPORT/EXPORT

DATA: molga(2)              TYPE c.
DATA: buffer                TYPE hrpay_buffer.
DATA: rgdir_line            LIKE pc261.

DATA: sim_pernr             LIKE pay_sim_pernr OCCURS 0 WITH HEADER LINE.

INCLUDE rpc2cd09.
INCLUDE rpc2rx02.
INCLUDE rpppxd00.
INCLUDE rpppxd10.
INCLUDE rpppxm00.
INCLUDE rpc2rkk0.
INCLUDE rpc2rx29.
INCLUDE rpc2rx39.
INCLUDE rpcxrkk0.

PARAMETERS: p_area    TYPE t549a-abkrs,
            p_period  TYPE t549q-pabrp,
            p_year    TYPE t549q-pabrj,
            p_pernr   TYPE persno,
            p_var     TYPE vari-variant,
            p_prog    TYPE trdir-name DEFAULT 'RPCALCK0' NO-DISPLAY.

START-OF-SELECTION.

  sim_pernr-pernr       = p_pernr.
  APPEND sim_pernr.

  CALL FUNCTION 'HR_PAYROLL'
    EXPORTING
     payroll_area               = p_area
     payroll_period             = p_period
     payroll_year               = p_year
     selection_variant          = p_var
     program_name               = p_prog
*     TST_ON                     = 'X'
    TABLES
      employee_numbers          = sim_pernr
     buffer                     = tbuff
     buffer_directory           = buffer_dir
     delete_pclx                = del_pclx_tab
   EXCEPTIONS
     program_not_exist          = 1
     variant_not_exist          = 2
     missing_parameter          = 3
     wrong_parameter            = 4
     wrong_country_group        = 5
     OTHERS                     = 6
            .
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  buffer-tbuff[]        = tbuff[].
  buffer-buffer_dir[]   = buffer_dir[].
  buffer-del_pclx_tab[] = del_pclx_tab[].

  CALL FUNCTION 'CU_READ_RGDIR'
    EXPORTING
      persnr          = sim_pernr-pernr
      buffer          = buffer
    IMPORTING
      molga           = molga
    TABLES
      in_rgdir        = rgdir
    EXCEPTIONS
      no_record_found = 1
      OTHERS          = 2.

  CALL FUNCTION 'CD_READ_LAST_RESULT_IN_RGDIR'
    IMPORTING
      ptx_rgdir_nv = rgdir_line
    TABLES
      pt_rgdir     = rgdir.

  rx-key-pernr = sim_pernr-pernr.
  rx-key-seqno = rgdir_line-seqnr.
  rp-imp-c2-rk.

  IF rp-imp-rk-subrc = 0.
    READ TABLE rgdir INDEX 1.
    WRITE: / 'fpper:', rgdir-fpper, 'inper:', rgdir-inper, 'srtza:', rgdir-srtza.
    WRITE: /.
    LOOP AT rt.
      WRITE: / rt-lgart, rt-betpe, rt-anzhl, rt-betrg.
    ENDLOOP.
  ENDIF.

Former Member
0 Kudos

Hi ,

You can create your own function in PE04 & Add this function to Payroll programm (HINCALC0) & your customised schema at end of Final Processing...

Logic of function is - When you executing tcode - pc00_m40_calc with tick of test run at that time you can save your RT Table to your ZRT table. & then fetch the data from ZRT table for your specific report..

I did the same thing for one of my client.

Revert if you require any help...

Regards,

Mahesh

sikindar_a
Active Contributor
0 Kudos

found this information might help you

ALL FUNCTION 'HR_PAYROLL'

EXPORTING

PAYROLL_AREA = 'TF'

PAYROLL_PERIOD = '20'

PAYROLL_YEAR = '2008'

SELECTION_VARIANT = 'STANDARD'

PROGRAM_NAME = 'RPCALCQ0'

log_mem_key = mem_key "1999/09/21

costplanning = 'X' "HB_2001/02/09

TABLES

EMPLOYEE_NUMBERS = pernr_selection

BUFFER = tbuff

BUFFER_DIRECTORY = buffer_dir.

CALL FUNCTION 'HR_PCLX_INIT_BUFFER'.

CALL FUNCTION 'HR_COPY_TBUFF_TO_BUFFER'

EXPORTING

clusterid = 'RQ'

*database_table = 'PCL2'

TABLES

buffer = tbuff

buffer_directory = buffer_dir

EXCEPTIONS

OTHERS = 0.

Not sure but you can convert the output in buffer from hex to char format using function module STPU1_HEX_TO_CHAR or else you can call the standard report RPCALCQ0 using submit and latter read the results from memory .

Former Member
0 Kudos

Click on the option Display log in the payroll driver. Then, explode the log and you can look at simulated results tables.

Regards,

Howard

former_member193210
Active Contributor
0 Kudos

As mentioned by others, a simulation will not "write" any results in the Payroll Results Cluster,

but you can look at the results of your simulation if you select the "Display Log" option (as mentioned by Howard) or if you select the "Display variant Rem. Stateme" and indicate the variant to use (as mentioned by Om). You can even use both options.

With the "Display Log" option, you can "drill down" into the log by selecting each folder you want to open, one at a time, and double-clicking on a sub-schema, function or PCR you want to analyze. This is very valuable for debugging when you are doing configuration or when you want to learn how the system reacts. The last function should be EXPRT, and it should contain all the information that would be written into the Payroll Results Cluster.

With the "Display variant Rem. Stateme" option, you can quickly view what the employee's Remuneration Statement would look like. This is very useful when a change has been done to an employee's master data (salary, benefits, garnishment) and you want to confirm the impact on the next pay.

Former Member
0 Kudos

Hi,

As mentioned by others above you won¿t be able to get the results if you run payroll in simulation run. You can try function module mentioned by Li Zhang, but if that doesn't work remember that there is no problem in running the payroll for the first time to make a first check and then run it again as many times time you need as it will update every tables. That's what is usually done to get the payroll results in the tables to run reports before executing final payroll.

Regards,

Edoardo

Former Member
0 Kudos

Hi,

You can get the result through Payslip during the Simulation run, since it will not update the payroll result tables.

Good Luck.

Om.

Former Member
0 Kudos

Hi,

to view the payslip while running the simulation run, you can give display remuneration statement in simulation.

which should come by saving variant in Remuneration statement as per your required inputs.

Regards,

jagdish

li_zhang
Advisor
Advisor
0 Kudos

There seems to be a sample for Australia: Function Module HRTO_AU_PAY_PROCESS_SIMULATION, e.g. you can get simulation results from RT into IRT to be used in your own report.

NB this is for Australia so you need to create one for your own.

Former Member
0 Kudos

Hi,

For getting the payroll results read, the results should be stored in internal tables - the same tables which you can view in PC_PAYRESULTS.

These tables will be saved only when a regular payroll run happens.

So if you run a simuation(test run) these tables are not saved for that pay period and you cant retrieve data.

You have to go to each node and check the corresponding internal tables, for checking the WT amounts in test run.

former_member139796
Participant
0 Kudos

Dear Friend,

Simulation run is a test run. Its is only to see if it working properly or not.

No Data files will get updated with the simulation run.

If no tables are getting updated then we cannot get any report based on a simulation payroll run.

if you want to get a report then run the payroll completely and then you will get the report that you want.

Regards