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

pernr

Former Member
0 Likes
812

Hello all,

I want to select all pernr for processing.

But some time there r more than one time same pernr in table (pa0001,pa0000) but begda & endda varies.

i just want all pernrs.

can any body tell me ?

Thanks .

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
757

try using select distinct

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
758

try using select distinct

Read only

0 Likes
757

can u tell me from where i should select 'all pernr' from pa0001 or pa0000.

Thanks a lot.

Read only

0 Likes
757

When u use the LDB say PNP

and mention "get pernr "statement in your program

employees are processed one by one and ie it runs a kind of a loop with every employee being called one by one .

to take an example:

start of selection

get pernr

rp provide from_ last_p0001

statment 2

end of selection

any statement after get pernr and before end of selection would execute for every pernr or employee, so its a kind of loop ,

in this area you can get the information from various infotypes ( where different kind of data for employees is storted) when u get the data from infotypes say by using statement

rp-provide from last p0001 begda endda

it would get the data of only the current pernr from infotype p001 and would get the dta from subseqent pernrs when they are called automatically by statement get pernr

collect the data in work area and append that in the internal table, append the data collected in the work area to internal table in this area before end-of -selection.

please note : iam almost sure "end of selction" marks the end of loop for get pernr , please confirm this with someone.

Read only

Former Member
0 Likes
757

Use thie statement.

>SELECT * from PA0001 INTO TABLE itab WHERE BEGDA LE SY-DATUM AND ENDDA GE SY-DATUM.

This will return only employees which are valid today. This will return only one record per employee.

If you are in HR module its recommended to user LDB PNP/PNPCE and user GET PERAS or GET PERNR statements.

A