Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Inserting infotype 2001 using HR_INFOTYPE_OPERATION

Hi,

Has anybody experienced the problem that the call to HR_INFOTYPE_OPERATION returns a key and no error messages but the actual records are not updated in the pa table ?

I'm experiencing this problem right now with trying to insert infotype 2001 records.

Even when I use dialogmode 2 and process the records on the foreground they all look ok and SAP gives no error when saving the records but also on the foreground, table pa2001 is not updated.

Hereby a piece of the code I use:

Form YGRM_create_it2001.

DATA: L_P2001 TYPE P2001.

*DATA: L_P2001 like PA2001.

*DATA: L_P2001 type pa2001.

DATA: L_CAPFODEKEY TYPE BAPIPAKEY, Return type BAPIRETURN1.

*

L_P2001-PERNR = VA_pernr.

L_P2001-INFTY = '2001'.

L_P2001-SUBTY = '100'.

L_P2001-ENDDA = VD_currentdate.

L_P2001-BEGDA = VD_currentdate.

L_P2001-SEQNR = VN_SEQ.

L_P2001-AEDTM = sy-datum.

L_P2001-UNAME = sy-uname.

L_P2001-BEGUZ = VD_beginhour.

  • 800 secs = half an hour

L_P2001-ENDUZ = VD_beginhour + 1800.

L_P2001-AWART = '100'.

L_P2001-ABWTG = 0.

L_P2001-STDAZ = '0.5'.

L_P2001-ABRST = '0.5'.

  • To enqueue the selected employee

CALL FUNCTION 'ENQUEUE_EPPRELE'

EXPORTING

pernr = VA_pernr

EXCEPTIONS

foreign_lock = 1

system_failure = 2

OTHERS = 3.

IF sy-subrc = 0.

*INSERT pa2001 FROM L_P2001.

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '2001'

number = VA_pernr

subtype = '100 '

objectid = ' '

lockindicator = ' '

validityend = VD_currentdate

validitybegin = VD_currentdate

record = L_P2001

operation = 'INS'

nocommit = ' '

dialog_mode = '2'

importing

return = return

key = L_CAPFODEKEY.

*use dialog_mode '2' for foreground processing

endif.

  • To dequeue the selected employee

CALL FUNCTION 'DEQUEUE_EPPRELE'

EXPORTING

pernr = VA_pernr.

Any help would be highly appriciated.

Greetings,

Ivo Aelberts.

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question