[SAP ABAP] - HR Funtion Module for Get Education


SE11 -> Structure 


  • ZSAPIST_SOPERNR


Field Data Element Data Type  Length Decimal Label Name
SIGN CHAR1 CHAR 1 0 Single-Character Indicator
OPTION CHAR2 CHAR 2 0 Version Number Component
LOW PERNR_D NUMC 8 0 Personnel Number
HIGH PERNR_D NUMC 8 0 Personnel Number



  • ZSAPIST_EDUC



Field Data Element Data Type  Length Decimal Label Name
PERNR PERNR_D NUMC 8 0 Personnel Number
CNAME CNAME CHAR 25 0 Address Supplement (c/o)
TITEL TITEL CHAR 15 0 Title
TITL2 TITL2 CHAR 15 0 Second Title
NAMZU NAMZU CHAR 15 0 Other Title
GBPAS GBPAS DATS 8 0 Date of Birth According to Passport
GBORT PAD_GBORT CHAR 40 0 Birthplace
NATIO NATIO CHAR 15 0 Nationality
GBLND GBLND CHAR 3 0 Country of Birth
FAMST FAMST CHAR 1 0 Marital Status Key
FTEXT FATXT CHAR 6 0 Marital Status
FAMDT FAMDT DATS 8 0 Valid From Date of Current Marital Status
KONFE KONFE CHAR 2 0 Religious Denomination Key
KTEXT KTEXT CHAR 20 0 General Name


FUNCTION zsapifm_educ.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(E_HISTORY) TYPE  CHAR1 OPTIONAL
*"  TABLES
*"      FT_PERNR STRUCTURE  ZSAPIST_SOPERNR OPTIONAL
*"      FT_EDUC STRUCTURE  ZSAPIST_EDUC OPTIONAL
*"  EXCEPTIONS
*"      NO_FOUND
*"----------------------------------------------------------------------

  DATA: t_t516t LIKE STANDARD TABLE OF t516t WITH HEADER LINE,
        t_t502t LIKE STANDARD TABLE OF t502t WITH HEADER LINE.

  DATA : ld_begda LIKE pa0001-begda,
         ld_endda LIKE pa0001-endda.

  ld_begda = '18000101'.
  ld_endda = '99991231'.

  SELECT * FROM t516t INTO TABLE t_t516t
           WHERE sprsl = sy-langu.

  SELECT * FROM t502t INTO TABLE t_t502t
           WHERE sprsl = sy-langu.

  IF e_history EQ 'X'.
    SELECT * FROM pa0002
    INTO CORRESPONDING FIELDS OF TABLE ft_educ
      WHERE pernr IN ft_pernr AND
            begda GE ld_begda AND
            endda LE ld_endda.
  ELSE.
    SELECT * FROM pa0002
    INTO CORRESPONDING FIELDS OF TABLE ft_educ
      WHERE pernr IN ft_pernr AND
            endda EQ ld_endda.
  ENDIF.

  IF ft_educ[] IS NOT INITIAL.

    LOOP AT ft_educ.

      READ TABLE t_t516t WITH KEY konfe = ft_educ-konfe.
      IF sy-subrc = 0.
        ft_educ-ktext = t_t516t-ktext.
      ENDIF.

      READ TABLE t_t502t WITH KEY famst = ft_educ-famst.
      IF sy-subrc = 0.
        ft_educ-ftext = t_t502t-ftext.
      ENDIF.

      MODIFY ft_educ.CLEAR ft_educ.

    ENDLOOP.

  ENDIF.


ENDFUNCTION.

Comments