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

Former Member
0 Kudos

I'm using this FM 'HR_INFOTYPE_OPERATION' to modify IT0015 record. However, when I execute, it returns the error 'No data stored for 0015 in the selected period' even the record I passed in is existed in the database and I pass in the correct value for all the parameters.

Can anyone tell me what happen? And how can I solve it?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi Irene,

it seems you are populating LGORT value into SUBTY field also...

check that..

Hope this helps.

Sajan.

11 REPLIES 11

Former Member
0 Kudos

Hi

Can you paste your code and the data from the table?

Can check this sample code...

p0045-pernr = pernr.

p0045-subty = subty.

p0045-begda = begda.

p0045-endda = endda.

p0045-darbt = darbt.

p0045-dkond = dkond.

p0045-tilbt = tilbt.

CLEAR p0045.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0045'

number = pernr

subtype = subty

record = p0045

operation = create

nocommit = nocommit

IMPORTING

return = return

key = bapikey

EXCEPTIONS

OTHERS = 0.

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

0 Kudos

Hi Raj,

Here is my code. li_wa_itab_0015 is a work area:

li_wa_itab_0015-pernr = l_itab_0015-pernr.

li_wa_itab_0015-begda = l_itab_0015-begda.

li_wa_itab_0015-endda = l_itab_0015-endda.

li_wa_itab_0015-subty = l_itab_0015-lgart.

li_wa_itab_0015-lgart = l_itab_0015-lgart.

li_wa_itab_0015-betrg = l_itab_0015-betrg.

li_wa_itab_0015-waers = l_itab_0015-waers.

li_wa_itab_0015-anzhl = l_itab_0015-anzhl.

li_wa_itab_0015-zeinh = l_itab_0015-zeinh.

li_wa_itab_0015-estdt = l_itab_0015-estdt.

li_wa_itab_0015-zuord = l_itab_0015-zuord.

li_wa_itab_0015-seqnr = l_itab_0015-seqnr.

li_wa_itab_0015-sprps = l_itab_0015-sprps.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0015'

number = li_wa_itab_0015-pernr

subtype = li_wa_itab_0015-subty

objectid = li_wa_itab_0015-objps

lockindicator = 'X'

validityend = li_wa_itab_0015-endda

validitybegin = li_wa_itab_0015-begda

recordnumber = li_wa_itab_0015-seqnr

record = li_wa_itab_0015

operation = 'MOD'

IMPORTING

return = l_return.

0 Kudos

PERNR 04900355

SUBTY 5601

OBJPS X

SPRPS

ENDDA 10.10.2006

BEGDA 10.10.2006

SEQNR 000

LGART 5601

BETRG 500.00

WAERS THB

ANZHL 0.00

Here is the record in the database

Former Member
0 Kudos

Hi

Can you check in debug mode, why it is throwing up that error?

Bcauz as i see your code is ok... and the record is existing...

Regards,

Raj

Former Member
0 Kudos

Anyone face this problem before? Anyone got solution?

Appreciate your help.

Former Member
0 Kudos

hi Irene,

it seems you are populating LGORT value into SUBTY field also...

check that..

Hope this helps.

Sajan.

0 Kudos

It's because Subtype and the LGART is actually same value.

0 Kudos

Hi Irene,

Hope u have declared li_wa_itab_0015 as of type P0015. This structure has a field INFTY this also has to be populated with data '0015'. Refer the below code. It works fine.

REPORT ztest.

data : li_wa_itab_0015 like p0015 occurs 0 with header line.

data : return like BAPIRETURN1 occurs 0 with header line.

<b>li_wa_itab_0015-infty = '0015'.</b>

li_wa_itab_0015-pernr = 100011.

li_wa_itab_0015-begda = '20060831'.

li_wa_itab_0015-endda = '20060831'.

li_wa_itab_0015-subty = '9904'.

li_wa_itab_0015-lgart = '9904'.

li_wa_itab_0015-waers = 'USD'.

li_wa_itab_0015-anzhl = 0.

li_wa_itab_0015-seqnr = 000.

li_wa_itab_0015-betrg = 30.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = '100011'

  • IMPORTING

  • RETURN =

.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0015'

number = '100011'

SUBTYPE = '9904'

  • OBJECTID =

  • LOCKINDICATOR =

VALIDITYEND = li_wa_itab_0015-endda

VALIDITYBEGIN = li_wa_itab_0015-begda

  • RECORDNUMBER =

record = li_wa_itab_0015

operation = 'MOD'

TCLAS = 'A'

DIALOG_MODE = '0'

  • NOCOMMIT =

  • VIEW_IDENTIFIER =

  • SECONDARY_RECORD =

IMPORTING

RETURN = return

  • KEY =

.

*loop at return.

write : return.

*endloop.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

number = '100011'

  • IMPORTING

  • RETURN =

.

Also check for the dates that you pass to be in the right format as hard coded above. Reply back if you still face problems.

Thanks,

Prasath N

Message was edited by: prasath natesan

0 Kudos

Hi,

Another way of trying out is to use HR_READ_INFOTYPE to read the record which you want to modify. Store this record in an internal table of structure P0015. Now modify the content in the internal table and pass this as the record HR_INFOTYPE_OPERATION for update --> "MOD" operation. By this way any inconsistencies in format of data can be avoided.

Hope this helps.

Thanks,

Prasath N

Message was edited by: prasath natesan

0 Kudos

Thanks Prasath N.

The problem is solved after I put the line

li_wa_itab_0015-infty = '0015'.

Thanks a lot. It really make me frustrated to figure out what actually happend. Really thanks a lot.

I will reward point to you later as current the system seems got problem and I cannot reward point.

Message was edited by: Irene Sam

Former Member
0 Kudos

Hi All

In this below code am facing one error that subty is not define and its making dump...pls help me for the same

&----


*& Report ZTEST

*&

&----


*&

*&

&----


REPORT Ztest .

DATA: l_bapireturn LIKE bapireturn1.

DATA: bapipakey_tab LIKE bapipakey OCCURS 0 WITH HEADER LINE.

data l_p2003 like p2003.

parameters: p_pernr like p2003-pernr ,

P_sub like pa2003-subty,

p_begda like pa2003-begda,

p_endda like pa2003-endda,

p_schkz like pa2003-schkz. "default '07000003'.

start-of-selection.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = p_pernr

IMPORTING

return = l_bapireturn.

IF l_bapireturn-id NE space.

WRITE: / l_p2003-pernr, 'Enqueue failed'.

exit.

ENDIF.

l_p2003-subty = '02'. “ <-This could be comment also

l_p2003-schkz = p_schkz.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '2003'

subty = '02'

number = p_pernr

record = l_p2003

validitybegin = p_begda

validityend = p_endda

operation = 'INS'

  • dialog_mode = '0' "Use default

  • 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-id,

l_bapireturn-message+0(40).

ELSE.

WRITE: / p_pernr,

20 'Create was successful',

l_bapireturn-id,

l_bapireturn-message+0(40).

ENDIF.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = p_pernr.

  • IMPORTING

  • RETURN =

.

Regards

Meeta