Uday's website
Published on Uday's website (https://www.uday.net)

Home > SAP HCM > Technical information > How to read data from subtype

How to read data from subtype

There are 2 ways you can read data from an infotype having subtype.

I am showing example of reading data from infotype IT0105 subtype 0001.

1) Use macro

* IT0105 "Get user name
  rp_provide_from_last p0105 '0001' pn-begda pn-endda.
  IF pnp-sw-found = 1.
    gs_output-username          = p0105-usrid.
  ELSE.
    CLEAR p0105.
  ENDIF.

2) Use function module

  "Read IT0105 for the employee.
  CALL FUNCTION 'HR_READ_SUBTYPE'
         EXPORTING
*          TCLAS                = 'A'
           pernr                = iv_pernr
           infty                = '0105'
           subty                = '0001'
           begda                = iv_keydate
           endda                = iv_keydate
*          BYPASS_BUFFER        = ' '
*          LEGACY_MODE          = ' '
*        IMPORTING
*          SUBRC                =
         TABLES
           infty_tab            =  it_p0105
        EXCEPTIONS
          infty_not_found       = 1
          OTHERS                = 2.

  • Log in [1] to post comments

 Valid XHTML 1.0 StrictCreative Commons LicenseVerbatim copying and redistribution of this entire page are permitted provided this notice is preserved. All content on this website including archives (including text, photographs, audio files and any other original work), unless otherwise noted, is licensed under a Creative Commons License or later.


Source URL:https://www.uday.net/How-to-read-data-from-subtype

Links
[1] https://www.uday.net/user/login?destination=node/488%23comment-form