[HR] Infotype – add PBO or PAI logic

There are many ways to add custom logic when processing an Infotype. Here are just a few: SMODPBAS0001PBAS0002 ZXPADU01 – when an infotype is calledZXPADU02 – when an action is performed on an infotype https://regotz.jimdofree.com/abap/dynpro/infotypen-pai-pbo/ BAdI’s HRPAD00INFTY (method IN_UPDATE) is called by the old infotype framework (PA30, SAP50UPR) HRPAD00INFTYDB (method …

[ABAP] Read Infotype

DATA: ls_p0001           TYPE p0001,
      lt_p0001           TYPE TABLE OF p0001,  
      lr_infotype_reader TYPE REF TO if_hrpa_read_infotype, 
      lt_infotype        TYPE hrpad_prelp_tab, 
      ls_infotype        TYPE prelp, 
      lv_missing_auth    TYPE boole_d 
      lv_data_exists     TYPE boole_d. 

* Infotyp reader initialisieren
   CALL METHOD cl_hrpa_read_infotype=>get_instance
       infotype_reader = lr_infotype_reader.

 * Infotyp 1 lesen
   CLEAR lt_infotype.
   CALL METHOD lr_infotype_reader->read
       tclas         = 'A'
       pernr         = lv_pernr
       infty         =  '0001' 
       begda         = iv_begda
       endda         = iv_endda
       no_auth_check = abap_true
       infotype_tab  = lt_infotype
       data_exists   = lv_data_exists
       missing_auth  = lv_missing_auth.

   LOOP AT lt_infotype INTO ls_infotype.
     CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
         prelp = ls_infotype
         pnnnn = ls_p0001.
        APPEND ls_p0001 TO lt_p0001.