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

FILO CONCEPT

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
1,687

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,233

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.

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?

5 REPLIES 5
Read only

Former Member
0 Likes
1,234

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.

Read only

Former Member
0 Likes
1,233

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.

Read only

Former Member
0 Likes
1,233

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 .

Read only

Shahid
Product and Topic Expert
Product and Topic Expert
0 Likes
1,233

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,

Read only

0 Likes
1,233

yaa ..

sort by the two fields time and in/out