11-13-2006 2:00 AM
I am trying to delimit IT 0167. I want to send the end date to 11/17/2006. I am getting PG 008 Infotype does not exist. I am not sure what I am doing wrong. I have read the post and nothing seems to have solved my problem here is the code: I have set the dialog_mode to '2' and all the correct fields are being populated with the correct information, however I still get the same error.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr
IMPORTING
return = l_bapireturn.
IF l_bapireturn-id NE space.
WRITE: / l_p0167-pernr, 'Enqueue failed'.
exit.
ENDIF.
*-- Suported operations:
*-- change (operation = 'MOD')
*-- Create (operation = 'INS')
*-- DELETE (operation = 'DEL')
*-- CREATESUCCESSOR (operation = 'COP')
.
l_p0167-barea = 'BD'.
l_p0167-pltyp = 'HPW'.
l_p0167-bplan = 'HPW'.
l_p0167-BOPTI = 'HPW'.
l_p0167-DEPCV = 'HPW'.
l_p0167-pernr = p_pernr.
l_p0167-begda = '20031122'.
l_p0167-endda = '20061117'.
call function 'HR_INITIALIZE_BUFFER'
exporting
pernr = p_pernr.
call function 'HR_PSBUFFER_INITIALIZE'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0167'
subtype = 'HPW'
number = p_pernr
record = l_p0167
validitybegin = '20031122'
validityend = '99991231'
operation = 'MOD'
dialog_mode = '0' "Use default
view_identifier = '10'
nocommit = '1' "Use default
IMPORTING
return = l_bapireturn
key = bapipakey_tab.
IF l_bapireturn-id NE space.
WRITE: / p_pernr,
20 'Create was unsuccessful',
l_bapireturn-type,
l_bapireturn-number,
l_bapireturn-id,
l_bapireturn-message+0(200),
l_bapireturn-message_v1.
ELSE.
WRITE: / p_pernr,
20 'Create was successful',
l_bapireturn-id,
l_bapireturn-message+0(40).
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = ' '.
ENDIF.
Use 'BAPI_EMPLOYEE_DEQUEUE' to un-lock the employee before updating
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = l_p0167-pernr
IMPORTING
return = l_bapireturn.
11-13-2006 2:54 AM
Instead of hardcoding the values for p0167, try using the HR_READ_INFOTYPE function module.. this will return the p0167 record.. simply change the endda & pass the po167 to HR_INFOTYPE_OPERATION.
~Suresh
11-13-2006 2:54 AM
Instead of hardcoding the values for p0167, try using the HR_READ_INFOTYPE function module.. this will return the p0167 record.. simply change the endda & pass the po167 to HR_INFOTYPE_OPERATION.
~Suresh
11-13-2006 4:20 AM
as far as i know...enque n deque is not required as its done ny HR_READ_INFOTYPE itself..trying removing that....use this fm for retrieving record from IT0016....then modify that pass it to FM again with diff mode...
Regards
Gunjan
11-13-2006 4:48 AM
Hi,
Look like you have not populated the SUBTY field in the structure P0167. Look in the below thread for a similiar problem (with IT0015).
https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=2656019
Thanks,
Prasath N
Message was edited by:
Prasath Natesan
(Modified the link)
11-14-2006 12:12 AM
Thank you to all using HR_READ_INFOTYPE, then modifying the end date to 20061117 and then passing the structure to HR_INFOTYPE_OPERATION worked. I can't thank you both enough. I have been working on this for days.
Jennifer
11-14-2006 3:31 AM