SAP开发笔记HR_INFOTYPE_OPERATION

更新时间:2023-05-10 15:32:04 阅读: 评论:0

validitybegin - validity begin date?
record - infotype record values to be updated, inrted etc (will be structure of infortyoe you are updating)?
recordnumber - quence nunber from infotype record you are updating?
Operation - describes what operation is to be performed?
COP = Copy?
DEL = Delete?
DIS = Display?
EDQ = Lock/unlock?
INS = Create?
LIS9 = Delimit?
MOD = Change?
INSS = Create for Actions is not converted to Change?
nocommit - commit yes('X') / no(' ')?
dialog_mode - dialog mode or not, default is '0'
Example coding for MOD operation
      CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.
      "This code is requred and locks the record ready for modification
      CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
        number = p_pernr.
      "loop at p0071 into p_p0071.  "added to put code in context
      validitybegin = p_record-begda.
      validityend  = p_record-endda.
      p_record-endda = pn-begda - 1.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty        = '0071'
          subtype      = p_record-subty
          objectid      = P_record-objps
          number        = p_record-pernr    "employeenumber
          validityend  = validityend
          validitybegin = validitybegin
          record        = p_record
          recordnumber  = p_record-SEQNR
          operation    = change
          nocommit      = nocommit
          dialog_mode  = '0'
        IMPORTING
          return        = return_struct
          key          = personaldatakey
        EXCEPTIONS
          OTHERS        = 0.
      "endloop.
    "unlock record after modification
    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
      EXPORTING
        number = p_pernr.
Example coding for INS operation
      CONSTANTS: inrt TYPE pspar-actio VALUE 'INS'.
      "This code is requred and locks the record ready for modification
      CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
        number = p_pernr.
      validitybegin = p_record-begda.
      validityend  = p_record-endda.
      p_record-pernr = p_pernr
      p_record-begda =  pn-begda.
      p_record-endda =  validityend.
      p_record-subty = p_SUBTY.  "subtype of new entry
      p_record-SCREF = p_SUBTY.  "subtype of new entry
      "plus populate any other fields you need to update
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty        = '0071'
          subtype      = p_record-subty
          number        = p_record-pernr    "employeenumber
          validityend  = validityend
          validitybegin = validitybegin
          record        = p_record
          operation    = inrt
          nocommit      = nocommit
          dialog_mode  = '0'
        IMPORTING
          return        = return_struct
          key          = personaldatakey
        EXCEPTIONS
          OTHERS        = 0.
    "unlock record after modification
    CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
      EXPORTING
        number = p_pernr.
INS operation example coding for infotype 0105
Also e BAPI_EMPLCOMM_CREATE for updating infotype 0105
      CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = p_pernr.
      p_record-subty    = p_subtype. "subtype of new entry
      p_record-pernr    =  p_pernr.
      p_record-SEQNR    = '000'.
      validitybegin    = sy-datum.
      p_record-begda    = sy-datum.
      p_record-usrid    = 'TESTUSR'.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty        = '0105'
          subtype      = p_record-subty
          objectid      = P_record-objps
          number        = p_record-pernr    "employeenumber
          validityend  = validityend
          validitybegin = validitybegin
          record        = p_record
          operation    = 'INS'
          nocommit      = nocommit
          dialog_mode  = '0'
        IMPORTING
          return        = return_struct
          key          = personaldatakey
        EXCEPTIONS
          OTHERS        = 0.
      if sy-subrc eq 0.
*      success
      endif.
      CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = p_pernr.

本文发布于:2023-05-10 15:32:04,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/879507.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图