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

HR学习01——创建组织单位

时间:2016-10-12 13:25:03      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:

创建组织单位:

RH_OBJECT_CREATE

REPORT ZLYHR01.

DATA:LS_OBJ    TYPE OBJEC,
     LV_STU    TYPE GDSTR-SVECT,
     LV_TIT    TYPE CHAR20,
     LV_SUBTYP TYPE SUBTYP,
     LS_P1000  TYPE P1000,
     LT_P1000  TYPE TABLE OF P1000.

LS_OBJ-OTYPE = O."对象类型
LS_OBJ-PLVAR = 01."计划版本


CALL FUNCTION RH_OBJECT_CREATE
  EXPORTING
*   LANGU               = SY-LANGU
    PLVAR               = LS_OBJ-PLVAR
    OTYPE               = LS_OBJ-OTYPE
*   EXT_NUMBER          = ‘00000000‘
    SHORT               = 测试组织单元
    STEXT               = 测试组织单元
*   BEGDA               = SY-DATUM
*   ENDDA               = ‘99991231‘
*   OSTAT               = ‘1‘
*   VTASK               = ‘D‘
*   GUID                =
*   KEEP_LUPD           = ‘ ‘
  IMPORTING
    OBJID               = LS_OBJ-OBJID
  EXCEPTIONS
    TEXT_REQUIRED       = 1
    INVALID_OTYPE       = 2
    INVALID_DATE        = 3
    ERROR_DURING_INSERT = 4
    ERROR_EXT_NUMBER    = 5
    UNDEFINED           = 6.
IF SY-SUBRC = 0.
  CALL FUNCTION BAPI_TRANSACTION_COMMIT
    EXPORTING
      WAIT = X.

  WRITE LS_OBJ-OBJID.
ELSE.
  CALL FUNCTION BAPI_TRANSACTION_ROLLBACK.
ENDIF.

结果:50000103

 

HR学习01——创建组织单位

标签:

原文地址:http://www.cnblogs.com/sapSB/p/5952188.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!