Checking P0655 settings in HRFORMS payslip using badi HRFORM_HRF02
I’d like to share with the HCM community some hints on how to customize the HRFORMS payslip so that the settings in Infotype P0655 are taken into account. In the case of PE51 based forms, this is not necessary as the standard deals with infotype P0655. Users can record at infotype P0655 whether the employee uses ESS remuneration statement, therefore the payslip must not be printed when the remuneration statement program is run at the backend.
However if you run your HRFORMS pasylip program you’ll notice that the settings in P0655 are ignored.
Here you are a hint to make your HRFORMS payslip check P0655:
Check Infotype P0655 in Badi HRFORM_HRF02 at method CHECK_PERNR.
here is the code I implemented in my test system:
data: subrc like sy-subrc,
l_essonly type essonly,
i0655 TYPE STANDARD TABLE OF p0655.
FIELD-SYMBOLS: <iwa> LIKE LINE OF i0655.
* Read the infotype 0655
CALL FUNCTION ‘HR_READ_INFOTYPE’
EXPORTING pernr = im_pernr
infty = ‘0655’ begda = im_begda
endda = im_endda
subrc = subrc
infty_tab = i0655
EXCEPTIONS infty_not_found = 1
OTHERS = 2.
if subrc = 0.
LOOP AT i0655 ASSIGNING <iwa> WHERE begda LE im_endda AND endda GE im_begda.
l_essonly = <iwa>-essonly.
if l_essonly = ‘X’. If sy-dbnam = ‘PNPCE’. “Call directly from R/3 <<<<<<<<<<<<
How to implement the Badi
Go to transaction SE18 -> Choose form HRFORM_HRF02 -> Overview -> Create implementation -> e.g. ZCARLOS.
Filters ->Set the FORM for which you want to implement the Badi, e.g. SAP_PAYSLIP_US.
Then go to the section “Interface” where you can find all the methods available.
Go to method check_pernr by double clicking over it.
Here you can insert your own code.