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

Create IT0017 using BADI

Former Member
0 Likes
495

Hi,

I am trying to create IT0017 on every save of IT0001 using BADI HRPAD00INFTY .

To create IT0017 I am trying to use function module HR_INFOTYPE_OPERATION.

In on_update.

The code for this function module works standalone but when I am trying to use this in BADI, I am getting error. Looks like some lock issue.

Anyone is having any suggestions.

Sample code

data: wa_new_p0001 type p0001.

DATA: l_0017 type p0017,

pernr type p0001-pernr,

op type PSPAR-ACTIO,

inf type PRELP-INFTY,

prelp type prelp,

return type bapireturn1.

l_0017-pernr = '00080340'.

l_0017-begda = sy-datum.

l_0017-endda = '99991231'.

l_0017-infty = '0017'.

l_0017-PTZUO = '1'.

op = 'INS'.

inf = '0017'.

pernr = l_0017-pernr.

prelp = l_0017.

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

EXPORTING

number = pernr

IMPORTING

return = return.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = inf

NUMBER = pernr

RECORD = prelp

OPERATION = op

NOCOMMIT = ' '

TCLAS = 'A'

IMPORTING

RETURN = RETURN.

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

EXPORTING

number = pernr

IMPORTING

return = return.

2 REPLIES 2
Read only

Former Member
0 Likes
457

Hi,

Why don't you use dynamic actions for this requirement?

If you don't know hat they are, I suggest you search the HR forum, the why and how of dynamic actions has been answered many times in that forum.

Kind regards, Rob Dielemans

Read only

0 Likes
457

Y..did this with Dynamic action but I will like to do using BADI, so that we can do mass load in background. Thanks