04-17-2008 1:34 PM
Hi people,
My problem is that I need to select over an infotype of SAP HR. But I just want the last information valid, meaning the entries which have the last SEQNR (000, 001, 002 and so on). Usually there is only SEQNR = 000, but sometimes you can find bigger numbers here. This is an automatic field. I just want to fetch the last one.
But I am using a logical database (PNP) and a provide-endprovide statement.
What can I do for making it in an optimal way? Any hint?
Points will be rewarded for sure.
Regards. Elena
04-17-2008 1:47 PM
Usually when U use LDB's (PNP in your case)
say :
infotypes : 0006.
start-of-selection.
GET PERNR. * after this statement P0006 will be filled
*now U can sort this structure P0006 ..
sort P0006 by pernr seqnr descending.
*now P0006 will have the highest seqnr ...
your coding ...
end-of-selection.
04-17-2008 1:47 PM
Usually when U use LDB's (PNP in your case)
say :
infotypes : 0006.
start-of-selection.
GET PERNR. * after this statement P0006 will be filled
*now U can sort this structure P0006 ..
sort P0006 by pernr seqnr descending.
*now P0006 will have the highest seqnr ...
your coding ...
end-of-selection.
04-17-2008 1:50 PM
write: the statmenet
rp_provide_from_last p0006 space pn-begda pn-endda.
Hope this will solve your problem.
Regards
sas
04-17-2008 2:29 PM
Hi,
Check the below code.
tables: pernr.
infotypes : 0001.
start-of-selection.
GET PERNR.
sort P0001 by begda descending seqnr descending.
end-of-selection.
04-17-2008 3:35 PM
Thanks everybody for your fast and helpful response!! I could solve my problem very easily using the sort before and doing some additional checks inside provide-endprovide.
Kind regards.