Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HR_INFOTYPE_OPERATION PG 008 error

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

suresh_datti
Active Contributor
0 Kudos

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

5 REPLIES 5

suresh_datti
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

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)

Former Member
0 Kudos

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

0 Kudos

Pl close the thread if your issue is completely resolved.

~Suresh