‎2007 Jul 16 8:42 PM
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.
‎2007 Jul 17 10:49 AM
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
‎2007 Jul 17 12:35 PM
Y..did this with Dynamic action but I will like to do using BADI, so that we can do mass load in background. Thanks