cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Payroll Results in Bulk.

Former Member
0 Kudos

HI

I want to delete Bulk payroll results in Production system say for 1000 employees .

I tried to create BDC/ LSMW but, iam not able to create BDC /LSMW for T-code PU01- Delete Payroll Results.

Nor iam able to use Program RPUDEL20 in Production server.

Experts plz advice any other Alternative solution.

Rgds,

Sekar,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sekar,

Try FMs RH_DELETE_STORED_PAYROLL_RSLTS

HR_DELETE_LEGACY_DATA_PAYROLL.

Regards,

Dilek

Former Member
0 Kudos

Hi Dilek

I have exceuted the FM RH_DELETE_STORED_PAYROLL_RSLTS in tcode SE37, it runs but when i check the payroll the entry is still not deleted. I  also used the same FM by creating a Z program it executes but the payroll entry is not deleted. I am using it in the DEV system. I want the program to run in PRD.

Please advice.

Regards,

Shubharaj

Answers (4)

Answers (4)

Former Member
0 Kudos

in production systems you can use the report RPUDELPP. This is employee by employee. If you want to delete in bulk, you'll have to create new Z-report  or copy of RPUDELPP and make small modification so you're able to work with selection-options.

Myself for DEV and QA I've copied RPUDELPN report and make required modifications.

I do advise to be carefull deleting payroll results, especially when retrocalculations are done for one or more months. Also don't forget to take possible postings to FI into account (PCALAC table).

Succes

Former Member
0 Kudos

Hi Bruno,

I will try this and provide feedback. Thanks

Regards,

Shubharaj.

Vivek_V
Active Contributor
0 Kudos

Hi,

The report RPUDEL20 can not be used in Production Server. Create LSMW for T-code PU01. We have doen this and is working perfectly. You may not have created you LSMW correctly.

VK

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi

You can copy this Z program to delete payroll result.

This program will delete the payroll result by just giving employee number / perner in the input file.

Regards

Mani

*******************************************Program Code **********************************************

**********************************************************************************************************

REPORT zhr_pydel

NO STANDARD PAGE HEADING LINE-SIZE 255.

*include bdcrecx1.

----


  • INTERNAL TABLES *

----


DATA : BEGIN OF itab OCCURS 0,

pernr TYPE rp50g-pernr, " Personal No.

END OF itab.

DATA: l_subrc LIKE sy-subrc.

DATA : messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA : bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

DATA : ctumode LIKE ctu_params-dismode VALUE 'N'.

"A: show all dynpros

"E: show dynpro on error only

"N: do not display dynpro

DATA : cupdate LIKE ctu_params-updmode VALUE 'S'.

----


  • SELECTION SCREENS *

----


PARAMETERS:fname TYPE rlgrap-filename OBLIGATORY.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.

CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

  • EXPORTING

  • PROGRAM_NAME = SYST-REPID

  • DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

  • STATIC = ' '

  • MASK = ' '

CHANGING

file_name = fname

EXCEPTIONS

mask_too_long = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL FUNCTION 'UPLOAD'

EXPORTING

  • CODEPAGE = ' '

filename = fname

filetype = 'DAT'

  • ITEM = ' '

  • FILEMASK_MASK = ' '

  • FILEMASK_TEXT = ' '

  • FILETYPE_NO_CHANGE = ' '

  • FILEMASK_ALL = ' '

  • FILETYPE_NO_SHOW = ' '

  • LINE_EXIT = ' '

  • USER_FORM = ' '

  • USER_PROG = ' '

  • SILENT = 'S'

  • IMPORTING

  • FILESIZE =

  • CANCEL =

  • ACT_FILENAME =

  • ACT_FILETYPE =

TABLES

data_tab = itab

  • EXCEPTIONS

  • CONVERSION_ERROR = 1

  • INVALID_TABLE_WIDTH = 2

  • INVALID_TYPE = 3

  • NO_BATCH = 4

  • UNKNOWN_ERROR = 5

  • GUI_REFUSE_FILETRANSFER = 6

  • OTHERS = 7

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

START-OF-SELECTION.

*perform open_group.

LOOP AT itab.

PERFORM bdc_dynpro USING 'RPCDPU01' '1000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RP50G-PERNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RP50G-PERNR'

itab-pernr. "'2019'.

PERFORM bdc_dynpro USING 'RPCDPU01' '1000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RP50G-PERNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=STAR'.

PERFORM bdc_field USING 'RP50G-PERNR'

itab-pernr. "'2019'.

PERFORM bdc_dynpro USING 'SAPMSSY0' '0120'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=DELE'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=YES'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=YES'.

PERFORM bdc_transaction USING 'PU01'.

CLEAR itab.

ENDLOOP.

*perform close_group.

&----


*& Form bdc_dynpro

&----


  • text

----


  • -->P_0118 text

  • -->P_0119 text

----


FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

APPEND bdcdata.

ENDFORM. " bdc_dynpro

&----


*& Form bdc_field

&----


  • text

----


  • -->P_0128 text

  • -->P_0129 text

----


FORM bdc_field USING fnam fval.

DATA : nodata VALUE ' '. "nodata

IF fval <> nodata.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDIF.

ENDFORM. " bdc_field

&----


*& Form bdc_transaction

&----


  • text

----


  • -->P_0188 text

----


FORM bdc_transaction USING tcode.

REFRESH messtab.

CALL TRANSACTION tcode USING bdcdata

MODE ctumode

UPDATE cupdate

MESSAGES INTO messtab.

l_subrc = sy-subrc.

REFRESH bdcdata.

ENDFORM. " bdc_transaction

Former Member
0 Kudos

HI Manikanth,

Thank you for providing the Coding for the Z program, i will try the same and provide you the feedback.

Regds,

Sekar.

Former Member
0 Kudos

Through RPUDEL20, one can delete bulk Py results. I have done it, this morning. If you were able to do it in Testing(staging) / Development, but you are not able to do it in Production, then it is very likely that its only an authorization issue.

If you have not done this in Staging before, PLEASE do it. Its very sensitive to directly run this program in Production.

Also , what do u also mean that you are not able to use this program in Production? Please explain, what is happening when you use this program.

Former Member
0 Kudos

HI Dhiraj,

When u run the Program RPUDEL20 ,it will throw the error that this Program should not be used in production server, the same has been confirmed by SAP, when we raised as message.But the same prgm will work in DEV & QA Server.

Rgds,

Sekar.