‎2007 Aug 16 7:58 AM
hi all,
can anyone tell me how to fetch the latest record from ldb for an employee .But i need to get the old record also if the contents inside two particular columns are different.
for eg.i should get only the 2nd record if p0014-lgart and p000-betrg same(latest one)
<u>p0000-pernr.......p000-vorna .......p0000-nachn.......p0014-lgart.....p0014-betrg</u>
1........................ x..........................y ...........................z..................9.00
1........................ x..........................d ...........................z..................9.00
but i should get all the records if it is like this
<u>p0000-pernr.......p000-vorna .......p0000-nachn.......p0014-lgart.....p0014-betrg</u>
1........................ x..........................y ...........................z..................9.00
1........................ x..........................d ...........................t...................9.00
1........................ x..........................d ...........................t...................5.00
‎2007 Aug 16 8:19 AM
Normally we fetch the latest record by using macro RP_PROVIDE_FROM_LAST but for your requirement I will suggest to use SELECT and gett all the records for an employee in the date range in an internal table.
SORT in descending based on BEGDA.
Now use READ statement.
Read t_0015 into wa1 index 1.
read t_0015 into wa2 index 2. now compare required values in wa1 & wa2.
Regards,
Amit
Reward all helpful replies.
‎2007 Aug 16 8:19 AM
Normally we fetch the latest record by using macro RP_PROVIDE_FROM_LAST but for your requirement I will suggest to use SELECT and gett all the records for an employee in the date range in an internal table.
SORT in descending based on BEGDA.
Now use READ statement.
Read t_0015 into wa1 index 1.
read t_0015 into wa2 index 2. now compare required values in wa1 & wa2.
Regards,
Amit
Reward all helpful replies.
‎2007 Aug 16 8:36 AM