Application Development 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: 

Records are not picking if time is given in the selection screen.

Hi Experts,

I am working on a report and it has to fetch some data from the LIKP table. So the selection screen fields are ERDAT, ERZET and LFART. So when i am passing the time in the selection field, and trying to fetch the data it is not doing that. But there are records in the LIKP table for the given time span. could you please tell me how can i modify to make the code pick the records for the given time.

Below is the code :

SELECT vbeln, erzet, erdat, lfart, kunag

FROM likp INTO TABLE @DATA(lt_likp_sto)

WHERE erzet IN @s_crtim

AND erdat IN @s_crdat

AND lfart IN @r_sto.

S_crtim is the time field and of type UZEIT.

Please let me know how can i achieve this.

Thanks in advance.

Regards,

Sri Harsha.

1 ACCEPTED SOLUTION

former_member876
Participant
0 Kudos

Hi Sri Harsha Nihanth,

Are you passing 'BT' for time?

Thanks,

Mukesh

5 REPLIES 5

former_member876
Participant
0 Kudos

Hi Sri Harsha Nihanth,

Are you passing 'BT' for time?

Thanks,

Mukesh

0 Kudos

Its working...Thanks you Mukesh 🙂

0 Kudos

It works for one scenario, but not for others. It isn't the right answer.

What if the user of the report decides to say < 10:00 in the low field and > 11:00 in the high field? You'll select records between 10:00 and 11:00 - but that's not what the user asked for. The user wanted records outside of 10:00-11:00 time frame.

matt
Active Contributor
0 Kudos

Replace the date and time selection options with specific date_from, date_to, time_from, time_to parameters. Otherwise you are likely to get confusion. See my blog here: https://blogs.sap.com/2014/02/07/dates-and-select-options/

Sandra_Rossi
Active Contributor
0 Kudos

You say something like "a time is entered in the screen and the SELECT doesn't work as expected". It "doesn't work", "how to make it work" is a meaningless question. Please indicate what is your test data, actual result, expected result, values of variables in debug. Thank you.