2007 May 25 7:00 AM
hi all,
how to retrieve the data from p0000,p0001,p0002,p0006, p0041 infotypes for all UA active employees only.
send me reply asap.
thanq ]
bye
34324
hi all,
how to retrieve the data from p0000,p0001,p0002,p0006, p0041 infotypes for all UA active employees only.
send me reply asap.
thanq ]
bye
34324
2007 May 28 11:48 AM
Create a program, link the program to the PNP logical database (SE38 -> Click Properties -> Logical Database -> PNP).
In the very top line of your top-include or global data section put this instruction:
INFOTYPES: And write all the numbers you need, for example:
INFOTYPES: 0000, 0001, 0002, 0006, 0041.This will buffer those infotypes at runtime.
After, put this line:
TABLES pernr.In the section START-OF-SELECTION...END-OF-SELECTION put this instruction:
GET pernr.You will see P* structures magically filled.
If you want, you can read other records from Infotypes declared in global data section, using the macro:
rp-read-infotypeOr fetch the last/first record on a P* structure by using these:
rp-provide-from-lastrp-provide-from-firstIf you need only active employees, you can use this macro at INITIALIZATION section:
rp-sel-ein-aus-init.This will force the system to check out only active employees.
Hope this helps,
Roby.
2007 May 29 5:25 AM
hi,
&----
*& Report ZSR_HR_EX1
*&
&----
*&
*&
&----
REPORT ZSR_HR_EX1.
.
DATA : BOOLEAN(1) TYPE C.
TABLES : PERNR.
INFOTYPES : 0002,0006.
START-OF-SELECTION.
GET PERNR.
RP-DEF-BOOLEAN .
*write 😕 pernr-pernr.
RP-PROVIDE-FROM-LAST P0002 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WRITE 😕 P0002-PERNR, P0002-NACHN, P0002-VORNA.
ENDIF.
RP-PROVIDE-FROM-LAST P0006 '1' PN-BEGDA PN-ENDDA.
END-OF-SELECTION.
IF PNP-SW-FOUND = 1.
WRITE 😕 P0006-ORT01, P0006-LAND1, P0006-PSTLZ.
ENDIF.
use above logic and get data for remaining p0000,p0001,p0041 also.
2007 May 29 10:35 AM
Hi,
See the sample code.
infotypes : p0000,p0001,p0002,p0006, p0041.
get pernr.
rp_provide_from_last p0000 pn-begda pn-endda.
if p0000-stat2 = '3' "(active employees)
rp_provide_from_last p0001 pn-begda pn-endda.
rp_provide_from_last p0002 pn-begda pn-endda.
rp_provide_from_last p0006 pn-begda pn-endda.
rp_provide_from_last p0041 pn-begda pn-endda.
endif.
What is UA? Is it the country code? check whether u get the country code from infotype 1. if so, then do a similar check like p0000-stat2.
Regards, Krithika
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |