2006 Feb 22 2:00 PM
I am creating a report via the HR Logical Database PNPCE. It's pretty straightforward, and I'm returning data for two Infotypes -- 0001 and 0008 (Subtype '0' for Basic Contract).
The clients said they'd like records combined unless there's a data value change between the time period (a two-week period) for Org. Unit (orgeh), Cost Center (kostl), or Time Recording Admin. (sachz). Looking back at my spiffy HR Programming course notes, it looks like I need to do a "join" and a "contraction", so my code looks like this:
PROVIDE orgeh kostl sachz FROM p0001
FROM p0008
BETWEEN pn-begda AND pn-endda
WHERE p0008-subty = '0'.
So far so good. Testing data is nearly non-existent, but I think this is the right approach. Here's the problem: all those other data values I need from p0001 other than orgeh, kostl, and sachz are blank. I can understand why -- instead of *, I've specified three specific fields to return.
So how do I get those other fields I need from p0001? Do I...
1) ...code a separate PROVIDE * FROM p0001 prior to this, and save my values then?
2) ...add them as part of my original PROVIDE statement, so after PROVIDE orgeh kostl sachz, I add other fields as well?
3) ...read the 0001 Infotype directly, through a function, to get the data?
I feel like I'm real close on this one -- I just need to get past this hurdle. It's going to be a huge learning experience for me as well, as I've never done a report using this approach before.
Thank you!
2006 Feb 22 2:10 PM
Hi Dave,
You don't need to go in for any function module.. after the GET PERNr/PERAS event, all the required infotype data will be available for you in the internal tables P0001 & P0008. You can just loop at them like you do in case of any other itab with a header line.
Regards,
Suresh Datti
2006 Feb 22 2:10 PM
Hi Dave,
You don't need to go in for any function module.. after the GET PERNr/PERAS event, all the required infotype data will be available for you in the internal tables P0001 & P0008. You can just loop at them like you do in case of any other itab with a header line.
Regards,
Suresh Datti
2006 Feb 22 3:42 PM
Suresh,
That part I understand. And I think what you're saying is one of the options I was pondering -- using a PROVIDE statement on just the P0001 table prior to the contracting.
For now, I'm going to change it back to PROVIDE * so I can get all of the information and continue working on my project. But if anyone has further advice, please post, as I think this is a key area of HR programming that I need to make sure I understand.
Thanks again,