组织结构基本信息存储在信息类型1000中,插入和定界数据都是用函数:RH_PNNNN_MAINTAIN
插入,定界(更新)都是 ACT_FCODE = 'INSE'
DATA: LS_RETURN TYPE HRRHAD_MSG,
LT_HRTNNNN TYPE TABLE OF HRTDBTAB,
LS_HRP1001 TYPE STANDARD TABLE OF P1000 WITH HEADER LINE,
LS_OUT TYPE WPLOG,
LS_HRINNNN TYPE WPLOG .
DATA LV_MAG TYPE STRING .
FIELD-SYMBOLS: <FS_P1000> TYPE P1000 ,
<FS_WPLOG> TYPE C .
LS_HRINNNN-PLVAR = '01'.
LS_HRINNNN-OTYPE = 'O'.
LS_HRINNNN-INFTY = '1000'.
LS_HRINNNN-OBJID = P_OBJID . "定界时赋值
LS_HRINNNN-SUBTY = ''.
LS_HRINNNN-ISTAT = '2'.
LS_HRINNNN-BEGDA = GS_CJHZZJG_2100-BEGDA.
LS_HRINNNN-ENDDA = GS_CJHZZJG_2100-ENDDA.
MOVE-CORRESPONDING LS_HRINNNN TO LS_HRP1001 .
LS_HRP1001-SHORT = GS_CJHZZJG_2100-SHORT.
LS_HRP1001-STEXT = GS_CJHZZJG_2100-STEXT.
ASSIGN LS_HRP1001 TO <FS_P1000>.
CHECK SY-SUBRC EQ 0 .
ASSIGN <FS_P1000> TO <FS_WPLOG> CASTING .
CLEAR LS_HRINNNN.
IF SY-SUBRC = 0 AND <FS_WPLOG> IS ASSIGNED.
LS_HRINNNN = <FS_WPLOG>.
ENDIF.
CALL FUNCTION 'RH_PNNNN_MAINTAIN'
EXPORTING
ACT_FCODE = 'INSE'
ACT_PLVAR = LS_HRINNNN-PLVAR
ACT_OTYPE = LS_HRINNNN-OTYPE
ACT_OBJID = LS_HRINNNN-OBJID
ACT_INFTY = LS_HRINNNN-INFTY
ACT_SUBTY = LS_HRINNNN-SUBTY
ACT_ISTAT = LS_HRINNNN-ISTAT
ACT_BEGDA = LS_HRINNNN-BEGDA
ACT_ENDDA = LS_HRINNNN-ENDDA
* ACT_NEW_LANGU = '1'
ACT_PNNNN = LS_HRINNNN
* ACT_INFOTYPEKEY =
* ACT_DPATT =
* ACT_GDATE =
* ACT_NEW_HISTO =
* ACT_ENQUEUE = 'X'
SUPPRESS_DIALOG = '2'
ACT_VTASK = 'S'
* ACT_PPPAR_EXEP = ls_exep
IMPORTING
* ACT_OK_CODE =
ACT_PNNNN_OUT = PS_OUT
ACT_MESS_INFO = LS_RETURN
* TABLES
* ACT_HRTNNNN = lt_hrtnnnn
EXCEPTIONS
INFTY_NOT_VALID = 1
NO_PLVAR = 2
OBJECT_NOT_DEFINED = 3
OTYPE_NOT_VALID = 4
NO_AUTHORITY = 5
ACTION_REJECTED = 6
NO_GDATE = 7
FCODE_NOT_SUPPORTED = 8
OTHERS = 9
.
IF sy-subrc <> 0.
GV_STOP = GC_X .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO LV_MAG.
MESSAGE E000(ZHRMSG) WITH LV_MAG.
* & & &
ENDIF.