2008 Aug 06 12:57 PM
Is there any function module which can determine the first in and last out concept?
if i have some n number of records in an internal table, differed by date and some other field(like card swipe in and out).
now i have to take first swipe in and last swipe out?
i feel this is similar to FILO concept of data structures. any hints on this?
2008 Aug 06 1:02 PM
Hi,
Why not u sort the table based on date and then read the 1st and last record of the table?
I think u will get the result by this way...
Regards,
Joy.
Hi,
Why not u sort the table based on date and then read the 1st and last record of the table?
I think u will get the result by this way...
Regards,
Joy.
2008 Aug 06 1:02 PM
Hi,
Why not u sort the table based on date and then read the 1st and last record of the table?
I think u will get the result by this way...
Regards,
Joy.
2008 Aug 06 1:02 PM
You can do other way round.
Sort the data in the internal table by ascending with key fields.
Now, read the first record and last record based on key fields.
You can easily get the required data.
2008 Aug 06 1:04 PM
hi use the sort statement ..
sort itab by field ascending . "first
read table index 1.
sort itab by field descending. "last
read table itab index 1 .
2008 Aug 06 1:09 PM
sorting will be helpful.
if we have case like
employee swipe data in itab
9 30 time in
9 45 time out
10 30 time in
6 00 time out
6 30 time in
now i want
9 30 time in
6 00 time out
i guess sorting with both the fields will solve the requirement,
2008 Aug 06 1:36 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |