I have been trying to get this to work and have been unsuccessful. I have "Googled" and "Searched the Community" I am not seeing what I am doing wrong or giving any error to why there is no update occuring. I pulled all of the code and made it as simple as possible so that someone could drop it in any system.
I am trying to create a infotype 21 record in HCM. I have shared my code below, I get no errors - everything checks out but there is not record create in the database.
Have any of you see this type of activity or am I missing something so simple that I have been staring at this for way to long. Any help is appreciated. Thanks in advance
TABLES: P0021.
DATA: lv_infty TYPE INFOTYP,
lv_subty TYPE SUBTY,
lv_OBJPS TYPE OBJPS,
lv_pernr type PERNR.
DATA: lv_return TYPE BAPIRETURN1.
CLEAR: lv_infty, lv_subty, lv_OBJPS.
lv_infty = '0021'.
lv_subty = '1'.
lv_OBJPS = '01'.
P0021-INFTY = '01'.
P0021-SUBTY = '1'.
P0021-OBJPS = '01'.
P0021-FAMSA = '2'.
P0021-FAVOR = 'Firstname'.
P0021-FANAM = 'Lastname'.
P0021-FASEX = '2'.
P0021-FGBDT = '19890101'.
P0021-AEDTM = sy-datum.
P0021-UNAME = sy-uname.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = lv_pernr
IMPORTING
RETURN = lv_return.
IF lv_return IS INITIAL.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = lv_infty
NUMBER = lv_pernr
SUBTYPE = lv_subty
OBJECTID = lv_OBJPS
VALIDITYEND = '99991231'
VALIDITYBEGIN = '20151204'
RECORD = P0021
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'.
if sy-subrc = 0.
endif.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = lv_pernr
IMPORTING
RETURN = lv_return.