‎2010 Mar 18 8:23 PM
Hi Experts,
I am relatively new to the world of SAP query (Log Database PNPCE), I have written a number of additional fields to retrieve previous info-type data using the select statement E.G
prev_endda = p0008-begda - 1.
SELECT single bsgrd
INTO FTE1
FROM
pa0008
WHERE pernr EQ P0008-pernr
AND endda EQ prev_endda
Although I can retrieve the previous info-type data , I was wondering if there was a easy way where I could take this a step further and show the Previous , Previous record. I.E
Pernr FTE Current FTE1 FTE2
101 60% 30% 75%
I guess what I am asking is , is there a way to loop through the HR info-type records, does anybody know if there is a standard function or macro I can use to achieve this.
Your help is much appreciated.
‎2010 Mar 18 9:47 PM
Hi,
Use FM HR_READ_INFOTYPE To acces PAxxx. It's better than select.
Rgds
‎2010 Mar 18 10:23 PM
Hi ,
Thanks for our reply.
I have pasted some example code into my additional field which I have created in SAP Query But im not sure how the loop bit works and how I can populate the additional fields that I have created , could you please explain this
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = '000000019'
infty = '01'
BEGDA = '18000101'
ENDDA = '99991231'
tables
infty_tab = p0008
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2
LOOP AT p0008.
NOT SURE WHAT TO PUT IN THIS SECTION *****
ENDLOOP.
I have created 3 additional Fields in the infoset Current FTE ,FTE1 FTE2 , and I want to loop through the records and populate the relevant Additional field with the employees FTE (I only want to populate where there is a change)
Sample Data
Begda Endda FTE Salary
1/1/2010 31/12/999 60% 19K (Current FTE)
01/08/2009 31/12/2009 100% 27k (FTE1)
01/07/2008 31/7/2009 50% 17K (FTE2)
Thanks in anticipation
DM