[SAP ABAP] - HR Funtion Module for Get Education Formal

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_EDUCFORMAL


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)
BEGDA BEGDA DATS 8 0 Start Date
ENDDA ENDDA DATS 8 0 End Date
SLART SLART CHAR 2 0 Educational establishment
SLTXT SLTXT CHAR 20 0 Education establishment text
AUSBI AUSBI NUMC 8 0 Education/training
ASBTX ASBTX CHAR 40 0 Educ./train. text
SCHCD P22J_SCHCD NUMC 10 0 Institute/school code
INSTI INSTI CHAR 80 0 Institute/location of training
SLAND LAND1 CHAR 3 0 Country Key
LANDX50 LANDX50 CHAR 50 0 Country Name (Max. 50 Characters)
SLTP1 FACH1 NUMC 5 0 Branch of study
FTEXT1 FRTXT CHAR 40 0 Text for branch of study
SLTP2 FACH2 NUMC 5 0 Branch of study
FTEXT2 FRTXT CHAR 40 0 Text for branch of study
FACCD P22J_FACCD NUMC 3 0 Faculty code
DPTMT DPTMT CHAR 40 0 Department
EMARK EMARK CHAR 4 0 Final Grade
SLABS SLABS CHAR 2 0 Certificate
STEXT STEXT CHAR 40 0 Object Name


FUNCTION zsapifm_educformal.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(E_HISTORY) TYPE  CHAR1 OPTIONAL
*"  TABLES
*"      FT_PERNR STRUCTURE  ZSAPIST_SOPERNR OPTIONAL
*"      FT_EDUCFORMAL STRUCTURE  ZSAPIST_EDUCFORMAL OPTIONAL
*"  EXCEPTIONS
*"      NO_FOUND
*"----------------------------------------------------------------------

  DATA: t_t517t LIKE STANDARD TABLE OF t517t WITH HEADER LINE,
        t_t518b LIKE STANDARD TABLE OF t518b WITH HEADER LINE,
        t_t005t LIKE STANDARD TABLE OF t005t WITH HEADER LINE,
        t_t517x LIKE STANDARD TABLE OF t517x WITH HEADER LINE,
        t_t519t LIKE STANDARD TABLE OF t519t WITH HEADER LINE.

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

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

  SELECT * FROM t517t INTO TABLE t_t517t
           WHERE sprsl = sy-langu.

  SELECT * FROM t518b INTO TABLE t_t518b
           WHERE langu = sy-langu.

  SELECT * FROM t005t INTO TABLE t_t005t
           WHERE spras = sy-langu.

  SELECT * FROM t517x INTO TABLE t_t517x
           WHERE langu = sy-langu.

  SELECT * FROM t519t INTO TABLE t_t519t
           WHERE sprsl = sy-langu.

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

  IF ft_educformal[] IS NOT INITIAL.

    LOOP AT ft_educformal.

*establishment
      READ TABLE t_t517t WITH KEY slart = ft_educformal-slart.
      IF sy-subrc = 0.
        ft_educformal-sltxt = t_t517t-stext.
      ENDIF.
*Education/training
      READ TABLE t_t518b WITH KEY ausbi = ft_educformal-ausbi.
      IF sy-subrc = 0.
        ft_educformal-asbtx = t_t518b-atext.
      ENDIF.
*Country
      READ TABLE t_t005t WITH KEY land1 = ft_educformal-sland.
      IF sy-subrc = 0.
        ft_educformal-landx50 = t_t005t-landx50.
      ENDIF.
*Branch Study 1
      READ TABLE t_t517x WITH KEY faart = ft_educformal-sltp1.
      IF sy-subrc = 0.
        ft_educformal-ftext1 = t_t517x-ftext.CLEAR t_t517x.
      ENDIF.
*Branch Study 2
      READ TABLE t_t517x WITH KEY faart = ft_educformal-sltp2.
      IF sy-subrc = 0.
        ft_educformal-ftext1 = t_t517x-ftext.
      ENDIF.
*Certificates
      READ TABLE t_t519t WITH KEY slabs = ft_educformal-slabs.
      IF sy-subrc = 0.
        ft_educformal-stext = t_t519t-stext.
      ENDIF.

      MODIFY ft_educformal.
      CLEAR : ft_educformal,t_t517t,t_t518b,t_t005t,t_t517x,t_t519t.

    ENDLOOP.

  ENDIF.


ENDFUNCTION.



Comments