Application Development 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: 

Fetching data using BEGDA, ENDDA in PA0009.

Former Member
0 Kudos

I have to fetch data from PA0009 for <b>one particular PERNR</b>.

let me know if the following condition will <b>always</b> pick a unique record or not.

Select * from PA0009

into table it_pa0009

where BEGDA <= SY-datum and

ENDDA >= Sy-DATUM and

BNKSA = '0'.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You may not get unique record..

Please keep where condition properly

use subty field in where condition ,if you use this condition then you will get it.

Try to see the data in SE11 and run your program in debugging and see the results.

Thanks

Seshu

8 REPLIES 8

Former Member
0 Kudos

You may not get unique record..

Please keep where condition properly

use subty field in where condition ,if you use this condition then you will get it.

Try to see the data in SE11 and run your program in debugging and see the results.

Thanks

Seshu

0 Kudos

Hi Seshu,

So does it mean even if i don't use all the key fields i will be able to pick unique record by giving a specific SUBTY( along with the condition i specified previously).

I really need to know this as i am not using the fields OBJPS and SPRPS for fetching.

Message was edited by:

Mona Ravi

0 Kudos

Hi,

If you need unique records you need to pass all primary keys while making a select.

Primary Key is a column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL.

0 Kudos

Hello,

The combination of 7 fields form the unique primary key

since you are familiar with PERNR/SUBTY/BEGDAand ENDDA

Please see the following documentation for other key fields

SEQNR

____________________________________________________

Text

Number of Infotype Record With Same Key

Definition

The sequential number is used to differentiate between records that have

the same key and '3' as the time constraint (any number of records at a

certain point in time). Unlike the personnel object identification, this

number is assigned automatically.

OBJPS

___________________________________________________

Text

Object Identification

Definition

The object identification (object ID) is used to make a distinction

between data records with the same infotype, subtype, lock indicator,

start date, and end date.

Examples

o The Sequential number field in infotypes 0026 Company Insurance and

0045 Company Loans.

o The Child number field in infotype 0021 Family/Related Person.

SPRPS

_________________________________________________

Text

Lock Indicator for HR Master Data Record

Definition

Lock indicator for the personnel master record.

for PA0009 the time contraint is subtype dependent(T)

in that case if you are passing for a subtype with constraint '3'

its advisable to pass SEQNR for accurate records

Lock indicator : i have set this to 'X' to indicate that this record shouldn't be updated because it is pending for some action...so pls consult if a similar functionality is used...which is setting the lock to indicate no operation on that record from the functional side...if enabling and disabling lock is done then definitely you need to pass the SPRPS

Hope it gave you some idea

Reward if helpful

Regards

Byju

0 Kudos

Hi a®s,

I know the concept of primary key. I was told infotypes ( like 0009 ) are based on date, that is why i wanted to know if my condition

BEGDA

<=

SY-datum and
ENDDA

>=

Sy-DATUM and

BNKSA = '0' and

SUBTY = '2S10'

will fetch a unique record or not ( even without giving the primary key).

0 Kudos

Hi,

I have searched my server and can able to find duplicate records for date.

0 Kudos

Hi mona,

Pls check if my above comments regarding SEQNR and SRPRS.....

<u><b>if subtype '2S10' is not of time constraint '3' you will get a correct answer</b></u>

Regards

Byju

former_member194669
Active Contributor
0 Kudos

Hi,

The following is the primary key in table PA0009.


PERNR
SUBTY
OBJPS
SPRPS
ENDDA  "<<<<
BEGDA "<<<<
SEQNR

So you select will not pick a unique record.