首页 > 其他 > 详细

HR开发 操作信息类型数据

时间:2016-07-29 18:46:53      阅读:239      评论:0      收藏:0      [点我收藏+]

1、通过函数操作。

INFOTYPES: 0001.
DATA: ZRETURN TYPE BAPIRETURN1,
      ZPAKEY  TYPE BAPIPAKEY.

GET PERNR.
LOOP AT P0001 WHERE ...
*锁定人员编号  
  CALL FUNCTION BAPI_EMPLOYEE_ENQUEUE
    EXPORTING
      NUMBER        = PERNR-PERNR
*   IMPORTING
*     RETURN        =
            .
    ...
*新建信息类型
  CALL FUNCTION HR_INFOTYPE_OPERATION
    EXPORTING
      INFTY                  = 0001
      NUMBER                 = P0001-PERNR
*     SUBTYPE                = ‘ ‘
*     OBJECTID               = 
     LOCKINDICATOR          = P0001-SPRPS
     VALIDITYEND            = P0001-ENDDA
     VALIDITYBEGIN          = P0001-BEGDA
     RECORDNUMBER           = P0001-SEQNR
      RECORD                 = P0001
      OPERATION              = INS
*     TCLAS                  = ‘A‘
     DIALOG_MODE            = 1
*     NOCOMMIT               =
*     VIEW_IDENTIFIER        =
*     SECONDARY_RECORD       =
   IMPORTING
     RETURN                 = ZRETURN
     KEY                    = ZPAKEY
            .
 COMMIT WORK.
*解除锁定  CALL FUNCTION BAPI_EMPLOYEE_DEQUEUE  EXPORTING  NUMBER = PERNR-PERNR * IMPORTING * RETURN = . ENDLOOP.

OPERATION: MOD(change)  INS(insert)  COPY(copy)  DEL(delete)  LIS9(delimit)

2、更新数据库。

PARAMETERS: P_NATIO_O LIKE P0002-NATIO DEFAULT DE,
            P_NATIO_N LIKE P0002-NATIO DEFAULT D.

UPDATE PA0002
      SET   NATIO  =  P_NATIO_N
      WHERE PERNR  =  P0002-PERNR
        AND NATIO  =  P_NATIO_O.
IF SY-SUBRC = 0.
  
ENDIF.

 

HR开发 操作信息类型数据

原文:http://www.cnblogs.com/xher/p/5719306.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!