Dear Friends,
When i used FM Infotype 0185 FM HR_INFOTYPE_OPERATION to create 0185, A SYSTEM ERROR COME:A complex application error has occurred.when i uesed below codes and let GV_DIALOG_MODE = '2' ,the problem not come.what prolbem?
* COP 复制
*DEL 删除
*DIS 显示
*EDQ 加锁/解锁
*INS 创建
*LIS9 定界
*MOD 更改
*INSS 对活动的创建未转动更改
DATA LV_OPERATION TYPE PSPAR-ACTIO VALUE 'INS'.
DATA LV_NOCOMMIT TYPE BAPI_STAND-NO_COMMIT VALUE ABAP_TRUE.
DATA LV_LOCKINDICATOR TYPE P0001-SPRPS VALUE ABAP_FALSE.
DATA LV_KEY TYPE BAPIPAKEY.
DATA LV_SUBTYPE TYPE P0001-SUBTY.
DATA LW_P0185 TYPE P0185.
***************init
CHECK P_OUT-TYPE <> G_ERROR .
************
IF P_OUT-ICTYP IS NOT INITIAL.
LW_P0185-PERNR = P_OUT-PERNR.
LW_P0185-BEGDA = P_OUT-ONBDATE.
LW_P0185-ENDDA = '99991231'.
LV_SUBTYPE = P_OUT-ICTYP.
* LW_P0185-SUBTY = LV_SUBTYPE.
LW_P0185-ICTYP = P_OUT-ICTYP.
LW_P0185-ICNUM = P_OUT-ICNUM."证件号码
* LW_P0185-ISSPL = P_OUT-ISSPL."证件签发地 "复杂的应用程序错误
LW_P0185-USEFR = P_OUT-USEFR."证件有效开始日期
LW_P0185-USETO = P_OUT-USETO."证件有效截止日期
* LW_P0185-ASTAT = '2'.
BREAK 54478.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0185'
NUMBER = LW_P0185-PERNR
SUBTYPE = LV_SUBTYPE
* OBJECTID =
LOCKINDICATOR = LV_LOCKINDICATOR
* VALIDITYEND =
* VALIDITYBEGIN =
* RECORDNUMBER =
RECORD = LW_P0185
OPERATION = LV_OPERATION
* TCLAS = 'A'
DIALOG_MODE = GV_DIALOG_MODE
NOCOMMIT = LV_NOCOMMIT
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
RETURN = P_RETURN
KEY = LV_KEY.
IF P_RETURN-TYPE = 'E'.
P_OUT-TYPE = P_RETURN-TYPE .
P_OUT-MESSAGE = P_RETURN-MESSAGE .
PERFORM ADD_MESSAGE USING P_OUT.
EXIT.
ENDIF.
ENDIF.
Thanks
Ravi