Skip to Content

TABLES pernr.
NODES  : peras.

DATA: o_infty        TYPE REF TO if_hrsen_read_infotype.
DATA: x_0001         TYPE p0001.
DATA: t_prelp_tab    TYPE STANDARD TABLE OF prelp.
DATA: t_0001         TYPE STANDARD TABLE OF p0001.
DATA: t_0002         TYPE STANDARD TABLE OF p0002.
DATA: t_temp         TYPE STANDARD TABLE OF p0002.
DATA: t_table        TYPE REF TO cl_salv_table.

CONSTANTS : c_0001   TYPE infty VALUE ‘0001’,
             c_0002   TYPE infty VALUE ‘0002’.

START-OF-SELECTION.

GET peras.

   o_infty = cl_hrsen_read_infotype_fmri=>get_instance( ).

   CLEAR : x_0001, t_temp[].

   CALL METHOD o_infty->read_single
     EXPORTING
       tclas         = ‘A’
       pernr         = pernrpernr
       infty         = c_0001
       subty         = space
       objps         = space
       begda         = pnbegda
       endda         = pnendda
       no_auth_check = space
     IMPORTING
       pnnnn         = x_0001
     EXCEPTIONS
       e_assertion   = 1
       OTHERS        = 2.
   IF sysubrc EQ 0.
     APPEND x_0001 TO t_0001[].
   ENDIF.
*&———————————————————————*
*& TO READ THE INFOTYPE TABLE (MULTIPLE RECORDS FROM INFOTYPE)
*&———————————————————————*
   CALL METHOD o_infty->read
     EXPORTING
       tclas         = ‘A’
       pernr         = pernrpernr
       infty         = c_0002
       subty         = ‘*’ “To get display the all subty data
       objps         = space
       begda         = pnbegda
       endda         = pnendda
       no_auth_check = space
     IMPORTING
       infotype_tab  = t_prelp_tab
     EXCEPTIONS
       e_assertion   = 1
       OTHERS        = 2.

* conversion of Prelp to pnnnn structure.

   CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn_tab
     EXPORTING
       prelp_tab = t_prelp_tab
     IMPORTING
       pnnnn_tab = t_temp.

   APPEND LINES OF t_temp[] TO t_0002[].

END-OF-SELECTION.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply