12-19-2008 9:01 PM
Hi,
I want to update 'Run payroll up to' field of infotype 0003 based on some conditions .
Is there any function module to update Infotype 0003 fields ?
Thanks
12-23-2008 6:50 AM
Hi Rohan,
Standard program RPUTRBK0 can be used to update infotype 0003.Check if that solves your purpose.
Regards,
Darshan Mulmule
12-19-2008 9:07 PM
Do with FM HR_INFOTYPE_OPERATION.
For more help please read FM documentation.
Or search in SCN with term fm to update hr infotype
12-19-2008 9:15 PM
Thanks .. But is it posssible without using FM HR_Maintain_Masterdata / HR_Infotype operation ?
Also What is SCN ?
Thanks ,
12-19-2008 9:18 PM
12-19-2008 9:19 PM
Is there any function module to update Infotype 0003 fields ?
Thst's why i gave FM.
But is it posssible without using
FM HR_Maintain_Masterdata / HR_Infotype operation ?
Yes.
By writing a BDC for PA30.
Also What is SCN ?
SAP Community Network. Earlier it was known as SDN
12-19-2008 9:54 PM
12-22-2008 5:21 PM
I have to update IT 003 in an user exit .
If I use the FM 'HR_INFOTYPE_OPERATION' ,
It can not update the pernr as its already locked .
Please let me know if there is any other function module .
12-22-2008 5:51 PM
use FM before/after Calling the FM 'HR_INFOTYPE_OPERATION' for Locking/realease the Employee.
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = p0003-pernr
importing
return = return.
call function 'HR_INFOTYPE_OPERATION'
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = p0003-pernr
importing
return = return.
12-22-2008 5:58 PM
If I remember correctly then firat you have to CALL this FM to UNlock the record by setting FLAG for this field -
*" VALUE(LOCKINDICATOR) LIKE P0001-SPRPS OPTIONAL
Then second time you need to call this FM to update the value and then,
3rd time to set the lock flag back.
I don't thing ENQUEUE, DEQUEUE will help here....
12-22-2008 6:14 PM
There are more options we've to Lock/Unlock the employee before doing any operation on them.
Just call the FM HR_INFOTYPE_OPERATION first time and pass the OPERATION = "EDQ" and second time of the call FM HR_INFOTYPE_OPERATION and perform your operation for changes.
I don't thing ENQUEUE, DEQUEUE will help here....
Did you tried these FM?
did you got any messages in RETURN table?
12-22-2008 6:21 PM
Yeah.
I tried couple of year back and now I remember
>
> OPERATION = "EDQ"
This will work.
But need to call FM 3 times.
12-22-2008 6:22 PM
12-22-2008 6:48 PM
Thanks for the help.
I will try using FM with operation as 'EDQ' .
I am curious to know whats 'EDQ' '
One doubt :
I am calling this FM in PAI exit ( ZXPADU02) which will be called while saving a record in an infotype XXXX.
If I unlock the pernr , won't it give any problem while saving record for infotype XXXX ?
12-22-2008 6:58 PM
The issue is - record will be unstable for that duration as you are unlocking it. Otherwise no problem with saving the info.
12-22-2008 7:13 PM
Just see the Domain ACTIO and see its value range.The below operations can be performed with FM HR_INFOTYPE_OPERATION
COP Copy
DEL Delete
DIS Display
EDQ Lock/unlock
INS Create
LIS9 Delimit
MOD Change
INSS Create for Actions is not converted to Change
You have all options now in your hand.its up to you which one you prefer.Just play around bit, with all these options you will come to know how proceed further.
12-22-2008 7:19 PM
I have calle the FM with action 'EDQ' .
It did not uloack the pernr .
I am using this code :
SELECT SINGLE STAT2
INTO LV_STAT2
FROM PA0000
WHERE PERNR = INNNN-PERNR AND
ENDDA >= INNNN-BEGDA AND
BEGDA <= INNNN-ENDDA .
IF SY-SUBRC = 0 AND
LV_STAT2 <> '3' .
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
PERNR = INNNN-PERNR
INFTY = '0003'
IMPORTING
SUBRC = LV_SUBRC_1
TABLES
INFTY_TAB = IT_PA0003
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2.
IF LV_SUBRC_1 = 0 .
READ TABLE IT_PA0003 INDEX 1 .
CHECK SY-SUBRC = 0 .
WA_PA0003 = IT_PA0003 .
IF INNNN-BEGDA > IT_PA0003-ABWD1 .
Reset the "Run payroll for pers.no. up to" date
WA_PA0003-ABWD1 = INNNN-BEGDA .
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0003'
NUMBER = INNNN-PERNR
RECORD = WA_PA0003
OPERATION = 'EDQ'
IMPORTING
RETURN = LV_SUBRC_2 .
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0003'
NUMBER = INNNN-PERNR
VALIDITYEND = WA_PA0003-ENDDA
VALIDITYBEGIN = WA_PA0003-BEGDA
RECORD = WA_PA0003
OPERATION = 'MOD'
NOCOMMIT = 'X'
IMPORTING
RETURN = LV_SUBRC_2
12-22-2008 7:23 PM
12-22-2008 7:23 PM
>
> It did not uloack the pernr .
Here You meant by Lock or Unlock?
First time it will Lock not unlock.
12-22-2008 8:11 PM
I have called the FM " HR_Infotype operation" twice with code 'EDQ'
I am getting some error messages on PA30 screen .Looks like I ahve to debug
12-22-2008 8:13 PM
12-22-2008 11:04 PM
Just remember one thing while working with Locks...that employee number should not be open with any of the transactions.....if i is open then this code will fail..
12-22-2008 11:10 PM
If this is the case than, he should be able to get messages in Return table while calling the BAPI_EMPLOYEE* or LOCKINDICATOR or with 'EDQ' whatever he used.
11-26-2011 8:01 PM
Hi Amit,
When i tried to run HR_INFTY_OPERATION with infotype 0003 it gives me the following error in Return.
"No data stored for 0003 in the selected period".
kindly suggest the solution to this error.
Regards,
12-23-2008 6:50 AM
Hi Rohan,
Standard program RPUTRBK0 can be used to update infotype 0003.Check if that solves your purpose.
Regards,
Darshan Mulmule
12-23-2008 6:58 AM
Hi,
First try to use FM HR_MAINTAIN_MASTERDATA. to update infotype 0003 directly
and pass '2' to parameter DIALOG_MODE
If not ok then do it as follows:
1) Use FM BAPI_EMPLOYEE_DEQUEUE.
2) Then use FM HR_MAINTAIN_MASTERDATA. to update infotype 0003
3) Then use FM BAPI_EMPLOYEE_ENQUEUE.
12-29-2008 5:42 PM