04-12-2010 11:06 AM
Hi,
I am using HR_INFOTYPE_OPERATION in 'IN_UPDATE' of BADI. Even after passing right parameters, it is not creating a record in infotype 2006. The return parameter return no error.
Please let me know.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = wa_2006-pernr
IMPORTING
return = l_bapireturn.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '2006'
number = ipspar-pernr
subtype = i2006-subty
objectid = i2006-objps
* LOCKINDICATOR =
validityend = i2006-endda
validitybegin = i2006-begda
* RECORDNUMBER =
record = i2006
operation = 'INS'
TCLAS = 'A'
* DIALOG_MODE = '0'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
return = wt_return
key = wl_key.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = ipspar-pernr
IMPORTING
return = l_bapireturn.
04-12-2010 11:09 AM
Try setting the DIALOG_MODE to '2' in order to see what is the problem.
My guess would be that the error is in enqueue, as you are in PA30 probably and the employee might be locked for update and HR_INFOTYPE_OPERATION checks locks, but still the best way is running in visible mode to see what is happening.
04-12-2010 11:22 AM
Hi,
Thanks for you reply. I tried setting 2 as dialog mode and saw the problem. The record is created in the foreground but the record is not there in PA2006 table. Strange!
When i re enter PA30 and try to see 2006 record in display mode. No record is there
04-12-2010 12:39 PM
Hi Arun
The error sounds like using the infotype views:
Explaning with the help of an example.
"With the feature IVWID (is stored PA0003-VIEKN) the infotype views (see table T582V+T582W) are read and set in background process within the infotype classes. For infotype 0002 (MOLGA = 19 , Portugal) the infotype view V336 is called and the data are stored in table PA0336 additionally".
Hope this should help.
Harsh
04-12-2010 11:11 AM
Hi,
sometimes I have the feeling that this function works for your own ITs and not for SAP ITs. Try better with function HR_MAINTAIN_MASTERDATA.
04-12-2010 3:21 PM
Hi all,
Thanks for all your reply. The Insert condition is workign after i moved the FM to a report program and submitted the report program in BADI.
Now, even though i do the same for MODIFY, i am getting an error message ' Infotype does not exist'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '2006'
number = wa_2006-pernr
subtype = wa_2006-subty
objectid = wa_2006-objps
LOCKINDICATOR = wa_2006-sprps
validityend = wa_2006-endda
validitybegin = wa_2006-begda
RECORDNUMBER = wa_2006-seqnr
record = i2006
operation = 'MOD'
* TCLAS = 'A'
DIALOG_MODE = '2'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
return = wt_return
key = wl_key.
The work area wa_2006 has the record from Pa2006 which needs to be modified with the values in the work area i2006.
thanks,
Sri
04-12-2010 4:54 PM
My requirement is to change the end date of the record. Is it possible to do it using this FM?
04-23-2010 5:21 PM
Yes it is, but in order to do that, you need to change the value of the parameter VALIDITYEND. I guess you have changed the i2006-endda to the date you pretend to change, but in the validityend the endda should be of the existing record in PA2006 and in the i2006 structure the new endda, so check if this is all like this.
05-25-2010 6:19 PM
Hi Arunsri,
Please check your i2006 struct, fill all fields like (begda, endda, infty, etc.)
Even if you call the FM with infotype = XXXX the record i2006-infty should be XXXX, otherwise it shows that error.
Regards,
AVF
Edited by: orgasmics on May 25, 2010 7:20 PM
05-25-2010 7:12 PM
>
> Hi,
>
> I am using HR_INFOTYPE_OPERATION in 'IN_UPDATE' of BADI. Even after passing right parameters, it is not creating a record in infotype 2006. The return parameter return no error.
>
> Please let me know.
>
>
> CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE' > EXPORTING > number = wa_2006-pernr > IMPORTING > return = l_bapireturn. > > CALL FUNCTION 'HR_INFOTYPE_OPERATION' > EXPORTING > infty = '2006' > number = ipspar-pernr > subtype = i2006-subty > objectid = i2006-objps > * LOCKINDICATOR = > validityend = i2006-endda > validitybegin = i2006-begda > * RECORDNUMBER = > record = i2006 > operation = 'INS' > TCLAS = 'A' > * DIALOG_MODE = '0' > * NOCOMMIT = > * VIEW_IDENTIFIER = > * SECONDARY_RECORD = > IMPORTING > return = wt_return > key = wl_key. > > > CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE' > EXPORTING > number = ipspar-pernr > IMPORTING > return = l_bapireturn. > >