Application Development 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: 

Function to update Infotype 0003

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Rohan,

Standard program RPUTRBK0 can be used to update infotype 0003.Check if that solves your purpose.

Regards,

Darshan Mulmule

25 REPLIES 25

former_member181995
Active Contributor
0 Kudos

Do with FM HR_INFOTYPE_OPERATION.

For more help please read FM documentation.

Or search in SCN with term fm to update hr infotype

0 Kudos

Thanks .. But is it posssible without using FM HR_Maintain_Masterdata / HR_Infotype operation ?

Also What is SCN ?

Thanks ,

0 Kudos

Never never never never do manual updates on infotype 3.

0 Kudos
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

0 Kudos

Thank You ..

Former Member
0 Kudos

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 .

0 Kudos

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.

0 Kudos

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....

0 Kudos

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?

0 Kudos

Yeah.

I tried couple of year back and now I remember

>

> OPERATION = "EDQ"

This will work.

But need to call FM 3 times.

0 Kudos

In often case you need to call three FM

0 Kudos

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 ?

0 Kudos

The issue is - record will be unstable for that duration as you are unlocking it. Otherwise no problem with saving the info.

0 Kudos

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.

0 Kudos

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

0 Kudos

What message you are getting?

0 Kudos

>

> It did not uloack the pernr .

Here You meant by Lock or Unlock?

First time it will Lock not unlock.

0 Kudos

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

0 Kudos

True.

0 Kudos

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..

0 Kudos

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.

0 Kudos

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,

Former Member
0 Kudos

Hi Rohan,

Standard program RPUTRBK0 can be used to update infotype 0003.Check if that solves your purpose.

Regards,

Darshan Mulmule

Former Member
0 Kudos

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.

0 Kudos

Thanks All ..

Appreciate it .