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

abap-hr

Former Member
0 Likes
682

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

3 REPLIES 3
Read only

Former Member
0 Likes
637

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

Or fetch the last/first record on a P* structure by using these:

rp-provide-from-last
rp-provide-from-first

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

Read only

Former Member
0 Likes
637

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.

Read only

0 Likes
637

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