2008 Mar 27 8:36 PM
In my program doing a simple select from cdhdr table based on date range i have created but it fails .
here is the code I am using.
SELECT SINGLE * FROM tvarv INTO wa_tvarv WHERE name EQ 'Z_SERVICE_CHANGE_DATE' .
move wa_tvarv-low to v_date .
move wa_tvarv-high to v_time .
fill the date range
*write v_date to ra_date-low .
move v_date TO ra_date-low .
*write sy-datum to v_dateh .
ra_date-high = sy-datum .
ra_date-sign = 'I' .
ra_date-option = 'BT' .
APPEND ra_date .
fill the time range
move v_time TO ra_time-low .
*write sy-uzeit to v_timeh .
ra_time-high = sy-uzeit .
ra_time-sign = 'I' .
ra_time-option = 'BT' .
APPEND ra_time .
*Get all the records from cdhdr table for contract i.e VERKBELEG .
*SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE it_cdhdr*
*WHERE objectclas = 'VERKBELEG'*
*AND udate IN ra_date*
*and UTIME in ra_time .*
above select is creating Problem .
Help will be Appreciated .
In my program doing a simple select from cdhdr table based on date range i have created but it fails .
here is the code I am using.
SELECT SINGLE * FROM tvarv INTO wa_tvarv WHERE name EQ 'Z_SERVICE_CHANGE_DATE' .
move wa_tvarv-low to v_date .
move wa_tvarv-high to v_time .
fill the date range
*write v_date to ra_date-low .
move v_date TO ra_date-low .
*write sy-datum to v_dateh .
ra_date-high = sy-datum .
ra_date-sign = 'I' .
ra_date-option = 'BT' .
APPEND ra_date .
fill the time range
move v_time TO ra_time-low .
*write sy-uzeit to v_timeh .
ra_time-high = sy-uzeit .
ra_time-sign = 'I' .
ra_time-option = 'BT' .
APPEND ra_time .
*Get all the records from cdhdr table for contract i.e VERKBELEG .
*SELECT objectclas objectid FROM cdhdr INTO CORRESPONDING FIELDS OF TABLE it_cdhdr*
*WHERE objectclas = 'VERKBELEG'*
*AND udate IN ra_date*
*and UTIME in ra_time .*
above select is creating Problem .
Help will be Appreciated .
2008 Mar 27 8:43 PM
I wonder if you have a conflict between your date and time. If you want all records between 3PM and 3AM the next day, that will cause a conflict. That's because the first date should be "before" the second date, wthin a given day.
To troubleshoot, why don't you try taking the time part out of the SQL?
2008 Mar 27 9:10 PM
Hi ,
Try only using the Date selection criteria.... It's not working because you are trying both data as well as time.
Thanks,
Greetson
2008 Mar 27 9:32 PM
Building a date range using ranges is risky. You might miss a value in HIGH field.
I would suggest you to use select-option no-display and build the date.
Thanks,
SKJ
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |