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: 

error when use HR_INFOTYPE_OPERATION create data in infortype 0024.

Former Member
0 Kudos

hi: every one

i use function HR_INFOTYPE_OPERATION to create data in inforgype 0024, there is an exception error type E which content is 'A complex application error has occurred' ( g_error = lw_return-message in the coding). i don't know the reason. follow is my coding.

FORM insert_proficiency .

DATA lwa_p0024 TYPE p0024.

data lw_return type bapireturn1.

DATA lv_message1 TYPE string.

  • DATA lv_message2 TYPE string.

DATA lv_message3 TYPE string.

lwa_p0024-pernr = gwa_io_data-pernr. (value is 00000005)

lwa_p0024-INFTY = gc_0024. (value is 100120003)

lwa_p0024-begda = gwa_io_data-begda.(value is 31129999)

lwa_p0024-endda = gwa_io_data-endda.(value is 10000002)

lwa_p0024-quali = gwa_io_data-quali. (value is 10000007)

lwa_p0024-AUSPR = gwa_io_data-AUSPR.(0003)

*- lock pernr

call function 'BAPI_EMPLOYEE_ENQUEUE'

exporting

number = lwa_p0024-pernr

importing

return = lw_return.

*-- collect error message

case lw_return-type.

when 'E' or 'A' or 'X'.

lv_message1 = lw_return-message.

CLEAR lw_return.

endcase.

  • update infortype

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = gc_0024

number = lwa_p0024-pernr

  • SUBTYPE = SUBTYPE

  • OBJECTID = OBJECTID

  • LOCKINDICATOR = LOCKINDICATOR

  • VALIDITYEND = VALIDITYEND

  • VALIDITYBEGIN = VALIDITYBEGIN

  • RECORDNUMBER = RECORDNUMBER

record = lwa_p0024

operation = gc_create

  • TCLAS = 'A'

dialog_mode = gc_dialog_mod

  • NOCOMMIT = NOCOMMIT

  • VIEW_IDENTIFIER = VIEW_IDENTIFIER

  • SECONDARY_RECORD = SECONDARY_RECORD

IMPORTING

RETURN = lw_return.

  • KEY = KEY .

*-- collect error message

case lw_return-type.

when 'E' or 'A' or 'X'.

g_error = lw_return-message.

CLEAR lw_return.

PERFORM collect_error_record.

endcase.

4 REPLIES 4

Former Member
0 Kudos

1: lwa_p0024-INFTY = gc_0024. (value is 100120003)

Infotype value entered is incorrect, it should be '0024'.

l2: wa_p0024-begda = gwa_io_data-begda.(value is 31129999)

You entered end date into begin date.

3: lwa_p0024-endda = gwa_io_data-endda.(value is 10000002)

Value of end date is not correct.

change the entries and test again.

Thanks

Vishal Kapoor

Former Member
0 Kudos

hi

set lock indicator to ' X'

use this way

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0024'

number = lv_pernr

subtype = p_0024-subty

lockindicator = 'X'

validityend = p_0024-endda

validitybegin = p_0024-begda

record = p_0024

operation = 'MOD'

IMPORTING

return = return

EXCEPTIONS

OTHERS = 1.

Former Member
0 Kudos

As qualification data goes to the OM Infotypes, Try using function module: RHPP_Q_PROFILE_WRITE

Former Member
0 Kudos

thanks all of you.

hi: vishal kapoor

the data which i pass into the function is right, just make a mistake here.

hi : SIDH SAP

my team leader told me that fualification infotype 0024 can not use HR_INFOTYPE_OPERATION to insert data, it only could use BDC, is he right or not?

i will use the function which you told me and try again, thank you.