Application Development and Automation 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: 
Read only

Creating Infotype

Former Member
0 Likes
618

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
589

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.

4 REPLIES 4
Read only

Former Member
0 Likes
589

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.

Read only

Former Member
0 Likes
590

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.

Read only

0 Likes
589

If you have any further doubt in this then give me ur mail id , i will guide you.

Read only

Former Member
0 Likes
589

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