cancel
Showing results for 
Search instead for 
Did you mean: 

Tools in the kit bag

0 Kudos

Hi SCN Friends,

I'm not often stumped in the SAP world, but a recent conversation left me at a loss for how to resolve what seems like a simple request, using the tools available in the SAP kit bag.

The simple question is, I have n sets of data which are someone's location with a time stamp. How can I tell if any two people were at the same place at the same time?

There are lots of follow on questions and similar scenarios on different data sets, which I'm sure will follow the same approach, but for once, I didn't even know which tools to get out of the kit bag to start with on this problem....

Help me SCN!

Ian

Accepted Solutions (0)

Answers (2)

Answers (2)

Jelena
Active Contributor
0 Kudos

Hmm, it seems like the only SCN question where the answer "Just give it to your ABAPer!" is perfectly appropriate.

This question is simpler when you're talking about comparing the exact timestamps and locations. But for humans "same time" might not be a fraction of a second. If, for example, you're capturing when a person entered location and when they left then it becomes more complex since you need to evaluate a period. "Same place" can also, in fact, be quite fuzzy.

RafkeMagic
Active Contributor
0 Kudos

I assume your n sets are (or could be) stored in 1 (internal) table let's say with key location, time & person.

If you now put that data in a similar table with key location & time and update a counter, you'll know from that new table that all records with a counter > 1 are "doubles". Those can be looked up again in the original table (to show the persons who were at the same place at the same time).

former_member182378
Active Contributor
0 Kudos

raf,

i don't get why you need the second table...(as you said) the check for doubles can be done in the original table itself.

tw

RafkeMagic
Active Contributor
0 Kudos

you're right when it's a dictionary table (then you can deal with that in the select), but when it's an internal table it's a bit messier (sort the table on the first two keys and work with a temporary variable to keep the "previous" value while looping it - I'd rather have a 2nd table)