‎2008 Jun 17 2:52 PM
Hi,
I am creating an infotype using call transaction method for a file of pernrs.
When I keep PA30 open for any pernr it does not create the infotype for that employee.
So do I have lock and unlick each penr while creating and any function modules or BAPIs will be appriciated.
Thanks.
‎2008 Jun 17 3:07 PM
Hi,
Try using the function module 'HR_INFOTYPE_OPERATION' with Operation 'INS'.
For Example: If you want to Populate Infotype 0015 then take data from the file in an Internal Table having the PERNR and try to code in the following manner.
LOOP AT ITAB_0015 into WA
IF SY-SUBRC EQ 0.
ITAB_0015-INFTY = '0015'.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = WA-PERNR
IMPORTING
RETURN = RET.
IF RET-MESSAGE IS INITIAL.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = C_0015
NUMBER = WA-PERNR
RECORD = ITAB_0015
OPERATION = C_INS
TCLAS = C_A
IMPORTING
RETURN = RET.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = ITAB_0015-PERNR
IMPORTING
RETURN = RET.
ENDLOOP.
‎2008 Jun 17 2:56 PM
Try this
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
pernr = wa_hrrecord-pernr
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = wa_hrrecord-infty
number = wa_hrrecord-pernr
subtype = wa_hrrecord-subty
objectid = wa_hrrecord-objid
lockindicator = wa_hrrecord-lockind
validityend = wa_hrrecord-endda
validitybegin = wa_hrrecord-begda
recordnumber = wa_hrrecord-seqnr
record = <fs_any>
operation = wa_hrrecord-operation
tclas = 'A'
dialog_mode = '0'
nocommit = v_simulate
IMPORTING
return = wa_bapiret1.
CALL FUNCTION 'DEQUEUE_EPPRELE'
EXPORTING
pernr = wa_hrrecord-pernr.
ENDIF.
‎2008 Jun 17 3:07 PM
Hi,
Try using the function module 'HR_INFOTYPE_OPERATION' with Operation 'INS'.
For Example: If you want to Populate Infotype 0015 then take data from the file in an Internal Table having the PERNR and try to code in the following manner.
LOOP AT ITAB_0015 into WA
IF SY-SUBRC EQ 0.
ITAB_0015-INFTY = '0015'.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = WA-PERNR
IMPORTING
RETURN = RET.
IF RET-MESSAGE IS INITIAL.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = C_0015
NUMBER = WA-PERNR
RECORD = ITAB_0015
OPERATION = C_INS
TCLAS = C_A
IMPORTING
RETURN = RET.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = ITAB_0015-PERNR
IMPORTING
RETURN = RET.
ENDLOOP.
‎2008 Jun 17 3:09 PM
If you have any further doubt in this then give me ur mail id , i will guide you.
‎2008 Jun 17 4:10 PM
Hi
Go through the link given below :
http://saptechnical.com/Tutorials/HRABAP/PA30/Config1.htm
Hope it will helpful to you.
With Regards
Nikunj shah