码迷,mamicode.com
首页 > 其他好文 > 详细

HR开发 操作信息类型数据

时间:2016-07-29 18:47:13      阅读:139      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!