Yk HCM Personnel Profile
Yk HCM Personnel Profile
Yk HCM Personnel Profile
"Subtype
"Relation
"Last Name
"First Name
"Name
"Date of Birth
"Age
"Nationality
"Nationality
"job
"employer
"begin date
"end date
"job
GS_PINFO
GT_FAMILY
GS_FAMILY
GT_CV
GS_CV
TYPE
TYPE
LIKE
TYPE
LIKE
"job text
TS_PINFO.
TABLE OF TS_FAMILY.
LINE OF GT_FAMILY.
TABLE OF TS_CV.
LINE OF GT_CV.
"personnel no.
"Last Name
"First Name
"Birthplace
"Date of Birth
"Gender Key
FROM
WHERE
AND
AND
L_VORNA,
GS_PINFO-GBORT,
GS_PINFO-GBDAT,
GS_PINFO-GESCH)
PA0002
PERNR = P_PERNR
BEGDA <= SY-DATUM
ENDDA >= SY-DATUM.
SINGLE PCODE
L_PCODE
PA0534
PERNR = P_PERNR
BEGDA <= SY-DATUM
ENDDA >= SY-DATUM.
SELECT
INTO
FROM
WHERE
AND
SINGLE PTEXT
GS_PINFO-PTEXT
T7CN5R
PCODE = L_PCODE
LANGU = SY-LANGU.
"Political status
ENDFORM.
" GET_PA0534
*&---------------------------------------------------------------------*
*&
Form GET_PA0529
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_PA0529 .
DATA: L_RACKY TYPE PA0529-RACKY.
SELECT
INTO
FROM
WHERE
AND
AND
SINGLE RACKY
L_RACKY
PA0529
PERNR = P_PERNR
BEGDA <= SY-DATUM
ENDDA >= SY-DATUM.
SELECT
INTO
FROM
WHERE
AND
AND
SINGLE LTEXT
GS_PINFO-LTEXT
T505S
RACKY = L_RACKY
MOLGA = '28'
SPRSL = SY-LANGU.
"Ethnic group
ENDFORM.
" GET_PA0529
*&---------------------------------------------------------------------*
*&
Form GET_PA0041
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_PA0041 .
DATA:
DATA:
DATA:
DATA:
DATA:
SELECT
INTO
FROM
WHERE
IF LS_PA0041-DAR01 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT01.
ELSEIF LS_PA0041-DAR01 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT01.
ENDIF.
IF LS_PA0041-DAR02 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT02.
ELSEIF LS_PA0041-DAR02 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT02.
ENDIF.
IF LS_PA0041-DAR03 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT03.
ELSEIF LS_PA0041-DAR03 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT03.
ENDIF.
IF LS_PA0041-DAR04 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT04.
ELSEIF LS_PA0041-DAR04 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT04.
ENDIF.
IF LS_PA0041-DAR05 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT05.
ELSEIF LS_PA0041-DAR05 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT05.
ENDIF.
IF LS_PA0041-DAR06 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT06.
ELSEIF LS_PA0041-DAR06 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT06.
ENDIF.
IF LS_PA0041-DAR07 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT07.
ELSEIF LS_PA0041-DAR07 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT07.
ENDIF.
IF LS_PA0041-DAR08 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT08.
ELSEIF LS_PA0041-DAR08 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT08.
ENDIF.
IF LS_PA0041-DAR09 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT09.
ELSEIF LS_PA0041-DAR09 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT09.
ENDIF.
IF LS_PA0041-DAR10 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT10.
ELSEIF LS_PA0041-DAR10 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT10.
ENDIF.
IF LS_PA0041-DAR11 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT11.
ELSEIF LS_PA0041-DAR11 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT11.
ENDIF.
IF LS_PA0041-DAR12 = 'D2'.
L_TIME_WORK = LS_PA0041-DAT12.
ELSEIF LS_PA0041-DAR12 = 'D4'.
L_TIME_CONGYE = LS_PA0041-DAT12.
ENDIF.
CALL FUNCTION 'SD_CALC_DURATION_FROM_DATETIME'
EXPORTING
I_DATE1
= SY-DATUM
I_TIME1
= G_TIME
I_DATE2
= L_TIME_WORK
I_TIME2
= G_TIME
IMPORTING
E_TDIFF
= L_TIME_1
*
E_DATE2_EARLY
=
EXCEPTIONS
INVALID_DATETIME
= 1
OTHERS
= 2
.
IF SY-SUBRC <> 0.
*Implement suitable error handling here
ENDIF.
GS_PINFO-WORK = L_TIME_1 / ( 24 * 365 * 10000 ).
CALL FUNCTION 'SD_CALC_DURATION_FROM_DATETIME'
EXPORTING
I_DATE1
= SY-DATUM
I_TIME1
= G_TIME
I_DATE2
= L_TIME_CONGYE
I_TIME2
= G_TIME
IMPORTING
E_TDIFF
= L_TIME_2
*
E_DATE2_EARLY
=
EXCEPTIONS
INVALID_DATETIME
= 1
OTHERS
= 2
.
IF SY-SUBRC <> 0.
*Implement suitable error handling here
ENDIF.
GS_PINFO-CONGYE = L_TIME_2 / ( 24 * 365 * 10000 ).
ENDFORM.
" GET_PA0041
*&---------------------------------------------------------------------*
*&
Form GET_PA0022
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_PA0022 .
DATA: L_SLABS
L_AUSBI
L_INSTI
L_ATEXT
TYPE
TYPE
TYPE
TYPE
PA0022-SLABS,
PA0022-AUSBI,
PA0022-INSTI,
T518B-ATEXT.
SINGLE STEXT
GS_PINFO-STEXT
T519T
SLABS = L_SLABS
SPRSL = SY-LANGU.
SELECT
INTO
FROM
WHERE
AND
SINGLE ATEXT
L_ATEXT
T518B
AUSBI = L_AUSBI
LANGU = SY-LANGU.
"Certificate
"major
"school
SINGLE ICNUM
GS_PINFO-IDCARD
PA0185
PERNR = P_PERNR
SUBTY = '01'
BEGDA <= SY-DATUM
ENDDA >= SY-DATUM.
"ID Crad
"passport
FROM
WHERE
AND
AND
AND
PA0185
PERNR =
SUBTY =
BEGDA <=
ENDDA >=
P_PERNR
'02'
SY-DATUM
SY-DATUM.
ENDFORM.
" GET_PA0185
*&---------------------------------------------------------------------*
*&
Form GET_PA0001
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_PA0001 .
DATA: L_STELL TYPE PA0001-STELL,
L_ORGEH TYPE PA0001-ORGEH.
SELECT SINGLE STELL
ORGEH
INTO (L_STELL,
L_ORGEH)
FROM PA0001
WHERE PERNR = P_PERNR
AND BEGDA <= SY-DATUM
AND ENDDA >= SY-DATUM.
SELECT
INTO
FROM
WHERE
AND
SINGLE STLTX
GS_PINFO-STLTX
T513S
STELL = L_STELL
SPRSL = SY-LANGU.
SELECT
INTO
FROM
WHERE
AND
SINGLE ORGTX
GS_PINFO-ORGTX
T527X
ORGEH = L_ORGEH
SPRSL = SY-LANGU.
"Job
"Organizational Unit
ENDFORM.
" GET_PA0001
*&---------------------------------------------------------------------*
*&
Form GET_LEADER
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM GET_LEADER .
DATA: LT_LEADER TYPE TSWHACTOR,
LS_LEADER LIKE LINE OF LT_LEADER,
L_OBJID TYPE HRSOBID-SOBID,
L_NACHN TYPE PA0002-NACHN,
L_VORNA TYPE PA0002-VORNA.
L_OBJID = P_PERNR.
CALL FUNCTION 'HR_ASR_GET_LEADER'
EXPORTING
OTYPE
= 'P'
OBJID
= L_OBJID
*
KEYDATE
= SY-DATUM
LEVEL
= '01'
IMPORTING
LEADER_TAB
EXCEPTIONS
WRONG_INPUT
NOTHING_FOUND
NO_ACTIVE_PLVAR
OTHERS
.
IF SY-SUBRC <> 0.
* Implement suitable error
ENDIF.
= LT_LEADER
=
=
=
=
1
2
3
4
handling here
"Last Name
"First Name
"Name of employer
"Start Date
"End Date
"Job at former employer(s)
OF TABLE GT_CV
FORM GET_PA0021 .
DATA: L_TIME TYPE TVRO-FAHZTD.
SELECT SUBTY
"subtype
FANAM
"Last name
FAVOR
"First name
FGBDT
"Date of Birth
FANAT
"Nationality
FGBOT
"Job
INTO CORRESPONDING FIELDS OF TABLE GT_FAMILY
FROM PA0021
WHERE PERNR = P_PERNR
AND BEGDA <= SY-DATUM
AND ENDDA >= SY-DATUM.
LOOP AT GT_FAMILY INTO GS_FAMILY.
SELECT
INTO
FROM
WHERE
AND
AND
SINGLE STEXT
GS_FAMILY-GUANXI
T591S
INFTY = '0021'
SUBTY = GS_FAMILY-SUBTY
SPRSL = SY-LANGU.
SINGLE NATIO50
GS_FAMILY-NATION
T005T
SPRAS = SY-LANGU
LAND1 = GS_FAMILY-FANAT.
*&
Form PRINT_OUT
*&---------------------------------------------------------------------*
*
Print out
*----------------------------------------------------------------------*
FORM PRINT_OUT.
DATA: LC_FORM_ZH TYPE TDSFNAME VALUE 'YKCN_HR_PERSONNEL_PROFILE_ZH'.
DATA: LC_FORM_EN TYPE TDSFNAME VALUE 'YKCN_HR_PERSONNEL_PROFILE_EN'.
DATA: LV_NAME
TYPE RS38L_FNAM,
"FUNCTION NAME
LV_TITLE TYPE SSFCOMPOP-TDCOVTITLE, "Text for Cover Page
LS_OUTOP TYPE SSFCOMPOP,
"Output Option
LS_CONTROL TYPE SSFCTRLOP.
"Control Parameters
DATA: LC_PRINTER TYPE SSFCTRLOP-DEVICE VALUE 'PRINTER'.
*
*
*
*
IF SY-LANGU = '1'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME
= LC_FORM_ZH
"YKCN_HR_PERSONNEL_PROFILE_ZH
VARIANT
= ' '
DIRECT_CALL
= ' '
IMPORTING
FM_NAME
= LV_NAME
EXCEPTIONS
NO_FORM
= 1
NO_FUNCTION_MODULE = 2
OTHERS
= 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME
= LC_FORM_EN
"YKCN_HR_PERSONNEL_PROFILE_EN
VARIANT
= ' '
DIRECT_CALL
= ' '
IMPORTING
FM_NAME
= LV_NAME
EXCEPTIONS
NO_FORM
= 1
NO_FUNCTION_MODULE = 2
OTHERS
= 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
LS_OUTOP-TDIMMED
LS_OUTOP-TDNEWID
LS_OUTOP-TDCOVTITLE
LS_CONTROL-NO_DIALOG
LS_CONTROL-PREVIEW
LS_CONTROL-DEVICE
=
=
=
=
=
=
'X'.
'X'.
LV_TITLE.
'X'.
'X'.
LC_PRINTER.
"Print Immidiately
"New Print Spool
"Text for Cover Page
"No Preview Dialog
"Print preview
"Printer
=
=
=
=
"Control setting
"Output setting
LS_CONTROL
LS_OUTOP
SPACE
GS_PINFO-PERNR
"personnel no.
IS_PINFO
TABLES
IT_CV
IT_FAMILY
EXCEPTIONS
FORMATTING_ERROR
INTERNAL_ERROR
SEND_ERROR
USER_CANCELED
OTHERS
ENDFORM.
= GS_PINFO
"Personnel info.
= GT_CV
= GT_FAMILY
"CV
"Family
=
=
=
=
=
1
2
3
4
5.