Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member17522
Active Contributor


Hi Guys,

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:

method IF_EX_HRFORM_HRF02~CHECK_PERNR.

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   

IMPORTING     

subrc           = subrc   

TABLES   

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.     

EXIT. 

ENDLOOP.

    if l_essonly = 'X'.   If sy-dbnam = 'PNPCE'. "Call directly from R/3 <<<<<<<<<<<<     

raise reject.

endif. 

endif.

endif.

endmethod.

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.

!https://weblogs.sdn.sap.com/weblogs/images/251726373/pic8.jpg|height=489|alt=image|width=406|src=htt...!</body>