04-24-2020 3:34 AM
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.
04-24-2020 4:15 AM
Hi Sri Harsha Nihanth,
Are you passing 'BT' for time?
Thanks,
Mukesh
04-24-2020 4:15 AM
Hi Sri Harsha Nihanth,
Are you passing 'BT' for time?
Thanks,
Mukesh
04-24-2020 4:43 AM
Its working...Thanks you Mukesh 🙂
04-24-2020 7:45 AM
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.
04-24-2020 7:48 AM
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/
04-24-2020 8:58 AM
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.