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

Tracking changes in HR infotypes

Former Member
0 Likes
3,606

Hi everybody,

I would like to hear some ideas about the following task that I need to do.

I have a task where I need to track and report the following changes to a certain group of employee records in a particular org unit:

1. vacation/sick accrual balances and other leave accrual data

2. changes to employee group/sub-group

3. new hires/re-hires in that particular org unit

4. terminations in a particular org unit.

How would I go about doing this? Is there some infotype attributes I can use to track the changes? Or is it more appropriate to keep the current data in some temporary table, and then check that data against new data to reveal if any changes has occurred? Is there maybe some BAPI I can se?

I have to report all these changes in a fixed-length file with the following fields:

PERNR

Org Unit

Emp Group

Emp Sub-group

Sick Accrual

Vac Accrual

I appreciate any ideas ....

1 ACCEPTED SOLUTION
Read only

Puneet_Gupta
Contributor
0 Likes
1,889

Hi Andrei,

You can setup the change documents for different infotypes that you require to log changes to.

Use this path:

SPRO -> IMG -> Personnel Management -> Tools -> Revision -> Set up change document

You can display any changes made to infotype records with report Logged Changes in Infotype Data (RPUAUD00).

If you are evaluating documents in customer-specific reports, you can use the following function modules provided by SAP:

List of All Logged Infotype Records (HR_INFOTYPE_LOG_GET_LIST)

Read Logged Infotype Record (HR_INFOTYPE_LOG_GET_DETAIL).

Hope this helps

Puneet

Hi everybody,

I would like to hear some ideas about the following task that I need to do.

I have a task where I need to track and report the following changes to a certain group of employee records in a particular org unit:

1. vacation/sick accrual balances and other leave accrual data

2. changes to employee group/sub-group

3. new hires/re-hires in that particular org unit

4. terminations in a particular org unit.

How would I go about doing this? Is there some infotype attributes I can use to track the changes? Or is it more appropriate to keep the current data in some temporary table, and then check that data against new data to reveal if any changes has occurred? Is there maybe some BAPI I can se?

I have to report all these changes in a fixed-length file with the following fields:

PERNR

Org Unit

Emp Group

Emp Sub-group

Sick Accrual

Vac Accrual

I appreciate any ideas ....

3 REPLIES 3
Read only

Former Member
0 Likes
1,889

Hello

There is an infotype audit report that tracks all changes made to the various fields in the infotypes. The program is RPUAUD00. All the data changes is stored in cluster PCL4 which you can use to retrieve data in your own program.

Another option is to create a table of your own and log the changes for the relevant infotypes/fields in the exit

EXIT_SAPFP50M_002 (part of the enhancement PBAS0001)

Regards

Shounak

Read only

Puneet_Gupta
Contributor
0 Likes
1,890

Hi Andrei,

You can setup the change documents for different infotypes that you require to log changes to.

Use this path:

SPRO -> IMG -> Personnel Management -> Tools -> Revision -> Set up change document

You can display any changes made to infotype records with report Logged Changes in Infotype Data (RPUAUD00).

If you are evaluating documents in customer-specific reports, you can use the following function modules provided by SAP:

List of All Logged Infotype Records (HR_INFOTYPE_LOG_GET_LIST)

Read Logged Infotype Record (HR_INFOTYPE_LOG_GET_DETAIL).

Hope this helps

Puneet

Read only

venkat_o
Active Contributor
0 Likes
1,889

Hi Andrei,

Take a note all these points .May be helpful.

<b>1</b>.

First consider only active employee.For this the below piece of code in INITIALIZATION.

pnptimed = 'D'.

pnpstat2-low = '3'.

pnpstat2-high = space.

pnpstat2-option = 'EQ'.

pnpstat2-sign = 'I'.

APPEND pnpstat2.

CLEAR pnpstat2.

<b>2</b>.

Howmany days back records u want to check .for this Create one parameter on SELECTION_SCREEN.Like tracking for one week changes.

<b>3</b>.

In every Infotype there is one field called AEDTM(Date of Last Change).

Get the latest record from the infotype using RP-PROVIDE-FROM-LAST .Check this date .If it is in one week take that record in.

<b>4</b>.

Sample code .

START-OF-SELECTION.

pn_begda = pn-begda - p_days.

GET pernr.

PERFORM p0001_data_for_bankdet.

PERFORM p0009_data_for_bankdet.

&----


*& Form p0001_data_for_bankdet

&----


FORM p0001_data_for_bankdet .

rp-provide-from-last p0001 space pn-begda pn-endda.

IF pnp-sw-found = '1'.

i_bank_details-ename = p0001-ename.

ENDIF.

ENDFORM. " p0001_data_for_bankdet

&----


*& Form p0009_data_for_bankdet

&----


FORM p0009_data_for_bankdet .

DATA l_ename LIKE pa0001-ename.

l_ename = i_bank_details-ename.

LOOP AT p0009 WHERE aedtm GE pn_begda.

i_bank_details-pernr = p0009-pernr.

i_bank_details-ename = l_ename.

i_bank_details-uname = p0009-uname.

i_bank_details-zlsch = p0009-zlsch.

i_bank_details-bankl = p0009-bankl.

i_bank_details-bankn = p0009-bankn.

APPEND i_bank_details.

CLEAR i_bank_details.

ENDLOOP.

ENDFORM. " p0009_data_for_bankdet

I hope that it helps

<b>Thanks,

Venkat.O</b>